Point.h
00001 
00002 
00003 /******************************************************************************
00004 
00005  Copyright 2008 Departamento de Realidad Virtual
00006  y Unidad de Cómputo Aplicado DGSGA, UNAM.
00007 
00008 
00009  This file is part of RBF++.
00010 
00011  RBF++ is free software: you can redistribute it and/or modify
00012  it under the terms of the GNU General Public License as published by
00013  the Free Software Foundation, either version 3 of the License, or
00014  (at your option) any later version.
00015 
00016  RBF++ is distributed in the hope that it will be useful,
00017  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019  GNU General Public License for more details.
00020 
00021  You should have received a copy of the GNU General Public License
00022  along with RBF++. If not, see .
00023 
00024 
00025 *******************************************************************************/
00026 
00027 
00028 
00029 
00030 #ifndef _POINT_H_
00031 # define _POINT_H_
00032 
00033 #include 
00034 
00035 namespace LA{
00036   
00037 using namespace std;  
00038 
00055 template 
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
00078     friend ostream& operator<<(ostream&,const Point&); 
00079  
00080   
00081  
00082   template
00083     friend Point& Point::operator=(const  Point&); 
00085   template 
00086     friend Point  operator-(const Point&, const Point&);
00088   template 
00089     friend Point  operator+(const Point&, const Point&);
00091   template
00092     friend Point operator*(const U & c, const Point& v );
00094   template
00095     friend Point operator*(const Point& v, const U & c);
00097   template
00098     friend U operator*(const Point& v1, const Point & v2 );
00100   template
00101     friend Point operator+=( Point & v1,const Point & v2 );
00102 
00103  
00104 protected:   
00106   int dim;         
00108   T* _v;  
00109   
00110 };
00111 
00112 };
00113 #include "../../src/LA/Point.cpp"
00114 
00115 #endif /* !POINT_H_ */
00116