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 <http://www.gnu.org/licenses/>.
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 /* !POINT_H_ */
00116
Superior

Tenemos 11 visitantes y ningun miembro en Línea