Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members

tntVector.h

00001 00003 // This software is distributed as part of the Improla library. 00004 // Improla is a GUI framework for image processing. 00005 // 00006 // Copyright (c) 2004, B. R. Siva Chandra, India 00007 // 00008 // This program is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU General Public License 00010 // as published by the Free Software Foundation; either version 2 00011 // of the License, or (at your option) any later version. 00012 // 00013 // This program is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with this program; if not, write to the Free Software 00020 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00021 // 00022 // In case you would like to contact the author, use the following e-mail 00023 // address: sivachandra_br@yahoo.com 00025 00026 #ifndef __UTILITY_VECTOR_H__ 00027 #define __UTILITY_VECTOR_H__ 00028 00029 #include <tnt/tnt_array1d.h> 00030 #include <tnt/tnt_array2d.h> 00031 #include <cstdio> 00032 #include <cmath> 00033 00034 namespace mutk 00035 { // Start of namespace brace. 00036 00040 class Vector : public TNT::Array1D< double > 00041 { 00042 public: 00043 Vector(void); // Default constructor... 00044 Vector(int dimension, double initVal); 00045 Vector(const Vector &v); // Copy constructor. 00046 00047 // Utils... 00048 double magnitude(void); 00049 void normalise(void); 00050 void fPrintf(FILE *fp); 00051 }; 00052 00053 } // End of namespace brace. 00054 00055 double dotProduct(const mutk::Vector &v1, const mutk::Vector &v2); 00056 mutk::Vector operator+(const mutk::Vector &v1, const mutk::Vector &v2); 00057 mutk::Vector operator-(const mutk::Vector &v1, const mutk::Vector &v2); 00058 mutk::Vector operator*(const mutk::Vector &v, double factor); 00059 mutk::Vector operator*(double factor, const mutk::Vector &v); 00060 00063 mutk::Vector columnView(const TNT::Array2D< double > &m, int c); 00064 00067 mutk::Vector rowView(const TNT::Array2D< double > &m, int r); 00068 00071 mutk::Vector loadVector(FILE *fp); 00072 00073 #endif // __UTILITY_VECTOR_H__ 00074

Generated on Mon Nov 22 11:12:41 2004 for ImprolaLib by doxygen 1.3.7