00001 #ifndef __AFProductSeqSMatrix_H__ 00002 #define __AFProductSeqSMatrix_H__ 00003 00035 #include <stdio.h> 00036 #include "FloatVector.hpp" 00037 00038 #include "AFSymMatrix.hpp" 00039 00040 00041 // P= B0 * B2 * ... * Bn 00042 class AFProductSeqSMatrix : public AFSymMatrix 00043 { 00044 protected: 00045 00046 int nSubMatrices; 00047 00048 FloatVector* tmp; // cache vector 00049 00050 public: 00051 AFProductSeqSMatrix(int w, int n):AFSymMatrix(w){ nSubMatrices= n; tmp=0; } 00052 AFProductSeqSMatrix(AFProductSeqSMatrix& m):AFSymMatrix(m){ nSubMatrices= m.nSubMatrices; tmp=0; } 00053 virtual ~AFProductSeqSMatrix(){if(tmp != 0 ) delete tmp;} 00054 00055 virtual AFloatMatrix* copy() 00056 {printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); return 0;} 00057 virtual AFloatMatrix* t(AFloatMatrix* result=0){return 0;} 00058 00059 virtual int numberOfSubMatrices() const {return nSubMatrices;} 00060 virtual AFSymMatrix* getSubMatrix(int i)=0; // Bi 00061 virtual void setSubMatrix(int i, AFSymMatrix* Bi)=0; // Bi 00062 00063 // base 0 00064 virtual float get0(int i, int j){return 0.0;} 00065 virtual void set0(int i, int j, float value){ /* not expected to change */ } 00066 00067 // base 1 00068 virtual float get(int i, int j){return 0.0;} 00069 virtual void set(int i, int j, float value){ /* not expected to change */ } 00070 00071 virtual AFSymMatrix* compact()=0; // B1*B2*... --> A 00072 00073 // Matrix vector products (redundant, uses symmetry) 00074 // u= A*v including implicit transposition 00075 virtual FloatVector* mult_Av(FloatVector* v, FloatVector* result=0); 00076 virtual FloatVector* mult_ATv(FloatVector* v, FloatVector* result=0); 00077 // u= v*A 00078 virtual FloatVector* mult_vA(FloatVector* v, FloatVector* result=0); 00079 virtual FloatVector* mult_vAT(FloatVector* vt, FloatVector* result=0); 00080 00081 // sub vector usage 00082 // u= A*v 00083 virtual FloatVector* mult_Av(FloatVector* v, int col0, int row0, bool incremental=false, FloatVector* result=0) 00084 {printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); return 0;} 00085 virtual FloatVector* mult_ATv(FloatVector* v, int col0, int row0, bool incremental=false, FloatVector* result=0) 00086 {printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); return 0;} 00087 // u= v*A 00088 virtual FloatVector* mult_vA(FloatVector* v, int row0, int col0, bool incremental=false, FloatVector* result=0) 00089 {printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); return 0;} 00090 virtual FloatVector* mult_vAT(FloatVector* vt, int row0, int col0, bool incremental=false, FloatVector* result=0) 00091 {printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); return 0;} 00092 00093 virtual float det(){printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); return 0.0;} 00094 virtual float trace(){printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); return 0.0;} 00095 00096 virtual float norme2(){printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); return 0.0;} 00097 virtual float sum(){printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); return 0.0;} 00098 00099 virtual float minimum(){printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); return 0.0;} 00100 virtual float maximum(){printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); return 0.0;} 00101 float mean(){ return sum()/size(); } 00102 virtual float sigma(){printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); return 0.0;} 00103 00104 // scalar single operations 00105 virtual void add(float value){printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); } 00106 virtual void subst(float value){printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); } 00107 virtual void mult(float value){printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); } 00108 virtual void div(float value){printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); } 00109 00110 // vector single operations 00111 virtual void add(AFloatMatrix& m){printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); } 00112 virtual void subst(AFloatMatrix& m){printf("%s() %s: not Implemented\n",__FUNCTION__, __FILE__); } 00113 00114 00115 virtual void output(){} 00116 virtual void output(FILE* file){} 00117 }; 00118 00119 #endif 00120