MathTL
|
00001 // -*- c++ -*- 00002 00003 // +--------------------------------------------------------------------+ 00004 // | This file is part of MathTL - the Mathematical Template Library | 00005 // | | 00006 // | Copyright (c) 2002-2009 | 00007 // | Thorsten Raasch, Manuel Werner | 00008 // +--------------------------------------------------------------------+ 00009 00010 #ifndef _MATHTL_POINT_H 00011 #define _MATHTL_POINT_H 00012 00013 #include <iostream> 00014 #include "algebra/tensor.h" 00015 00016 namespace MathTL 00017 { 00022 template <unsigned int DIM, class VALUE = double> 00023 class Point : public Tensor<1, DIM, VALUE> 00024 { 00025 public: 00029 typedef VALUE value_type; 00030 00034 typedef value_type* pointer; 00035 00039 typedef const value_type* const_pointer; 00040 00044 typedef value_type* iterator; 00045 00049 typedef const value_type* const_iterator; 00050 00054 typedef value_type& reference; 00055 00059 typedef const value_type& const_reference; 00060 00064 typedef size_t size_type; 00065 00070 Point(); 00071 00075 Point(const Tensor<1, DIM, VALUE>&); 00076 00080 explicit Point(const VALUE x); 00081 00085 Point(const VALUE x, const VALUE y); 00086 00090 Point(const VALUE x, const VALUE y, const VALUE z); 00091 00096 Point<DIM, VALUE>& operator = (const VALUE x); 00097 00098 // /*! 00099 // assignment operator (for safety, Tensor class already has one) 00100 // */ 00101 // Point<DIM, VALUE>& operator = (const Point<DIM, VALUE>& p); 00102 00106 const size_type size() const; 00107 00112 const VALUE operator () (const size_type i) const; 00113 00118 VALUE& operator () (const size_type i); 00119 }; 00120 00124 template <unsigned int DIM, class VALUE> 00125 std::ostream& operator << (std::ostream& os, const Point<DIM, VALUE>& p); 00126 } 00127 00128 #include "geometry/point.cpp" 00129 00130 #endif