Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

FloatVectorT.hpp

00001 #ifndef __FloatVectorT_H__
00002 #define __FloatVectorT_H__
00003 
00004 
00023 #include <stdio.h>
00024 
00025 class FloatVector;
00026 
00027 class FloatVectorT
00028 {
00029 private:
00030         
00031 int             dataSize;
00032 float*  data;
00033 
00034 float*  data1;
00035 
00036 public:
00037         
00038 FloatVectorT(int size);
00039 FloatVectorT(int size, float adata);
00040 FloatVectorT(const FloatVectorT& v);
00041 FloatVectorT operator=(const FloatVectorT& v);
00042 
00043 ~FloatVectorT(){ data=0; delete[] data1; }
00044 
00045 FloatVector t();
00046 
00047 FloatVectorT* sub(int start, int step, int end);
00048 
00049 inline int size(){ return dataSize; }
00050 
00051 void load(FloatVectorT* v);
00052 
00053 // base 0
00054 inline void set0(int index, float value){ data[index]= value; }
00055 inline float get0(int index){ return data[index]; }
00056 
00057 // base 1
00058 inline void set(int index, float value){ data1[index]= value; }
00059 inline float get(int index){ return data1[index]; }
00060 
00061 // computations
00062 float vT_v();
00063 float norme2();
00064 float sum();
00065 
00066 float minimum();
00067 float maximum();
00068 float mean(){ return sum()/dataSize; }
00069 float sigma();
00070 
00071 // differences
00072 float undividedDiff(int cellj, int order);
00073 float dividedDiff(int cellj, int order, float dx=1.0);
00074 
00075 // math vectorial op
00076 FloatVectorT sqrt();
00077 FloatVectorT pow(float pow);
00078 FloatVectorT sqr();
00079 FloatVectorT exp();
00080 FloatVectorT log();
00081 FloatVectorT log(float base);
00082 
00083 FloatVectorT sin();
00084 FloatVectorT cos();
00085 FloatVectorT tan();
00086 
00087 // scalar single operations
00088 void operator+=(float value);
00089 void operator-=(float value);
00090 void operator*=(float value);
00091 void operator/=(float value);
00092 
00093 // vector single operations
00094 void operator+=(FloatVectorT& v);
00095 void operator-=(FloatVectorT& v);
00096 void operator*=(FloatVectorT& v);
00097 void operator/=(FloatVectorT& v);
00098 
00099 // friends
00100 friend float operator*(FloatVectorT& vt, FloatVector& u);                       // scalar product
00101 
00102 friend FloatVectorT operator+(FloatVectorT& v, float a);                        // v<op>a
00103 friend FloatVectorT operator+(float a, FloatVectorT& v);                        // a<op>v
00104 friend FloatVectorT operator-(FloatVectorT& v, float a);                        // v<op>a
00105 friend FloatVectorT operator-(float a, FloatVectorT& v);                        // a<op>v
00106 friend FloatVectorT operator*(FloatVectorT& v, float a);                        // v<op>a
00107 friend FloatVectorT operator*(float a, FloatVectorT& v);                        // a<op>v
00108 friend FloatVectorT operator/(FloatVectorT& v, float a);                        // v<op>a
00109 
00110 friend FloatVectorT operator+(FloatVectorT& v1, FloatVectorT& v2);                      // v1<op>v2
00111 friend FloatVectorT operator-(FloatVectorT& v1, FloatVectorT& v2);                      // v1<op>v2
00112         
00113 void output();
00114 void output(FILE* file);
00115 };
00116 
00117 #endif
00118 
SourceForge.net Logo
Restoreinpaint sourceforge project `C++/Java Image Processing, Restoration, Inpainting Project'.

Bernard De Cuyper: Open Project Leader: Concept, design and development.
Bernard De Cuyper & Eddy Fraiha 2002, 2003. Bernard De Cuyper 2004. Open and free, for friendly usage only.
Modifications on Belgium ground of this piece of artistic work, by governement institutions or companies, must be notified to Bernard De Cuyper.
bern_bdc@hotmail.com