00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _POINT_H_
00031 # define _POINT_H_
00032
00033 #include <iostream>
00034
00035 namespace LA{
00036
00037 using namespace std;
00038
00055 template<typename T>
00056 class Point {
00057
00058 public:
00060 Point();
00062 Point(int);
00064 Point(const Point&);
00066 ~Point();
00067
00068 int dimension() const { return dim; };
00069 void resize(int);
00070
00071 T& operator [] (int);
00072 const T& operator [] (int) const;
00073
00075 Point& operator=(const Point&);
00077 template<typename U>
00078 friend ostream& operator<<(ostream&,const Point<U>&);
00079
00080
00081
00082 template<typename U>
00083 friend Point<U>& Point<U>::operator=(const Point<U>&);
00085 template <typename U>
00086 friend Point<U> operator-(const Point<U>&, const Point<U>&);
00088 template <typename U>
00089 friend Point<U> operator+(const Point<U>&, const Point<U>&);
00091 template<typename U>
00092 friend Point<U> operator*(const U & c, const Point<U>& v );
00094 template<typename U>
00095 friend Point<U> operator*(const Point<U>& v, const U & c);
00097 template<typename U>
00098 friend U operator*(const Point<U>& v1, const Point<U> & v2 );
00100 template<typename U>
00101 friend Point<U> operator+=( Point<U> & v1,const Point<U> & v2 );
00102
00103
00104 protected:
00106 int dim;
00108 T* _v;
00109
00110 };
00111
00112 };
00113 #include "../../src/LA/Point.cpp"
00114
00115 #endif
00116