00001 #ifndef OPERATORMATRIX_HPP
00002 # define OPERATORMATRIX_HPP
00003
00004
00005 #include "Matrix2D.hpp"
00006
00007 struct IndexSet;
00008 struct Wavelets;
00009 struct doubleBuffer;
00010
00011 struct MatrixShape {
00012 int M,N,BL0,BL1,BR0,BR1,U,O ;
00013 void Transpose() ;
00014 void Print() ;
00015 } ;
00016
00020 struct OperatorMatrix {
00022 OperatorMatrix() ;
00023
00033 void MatVec (double *T,IndexSet *IT,int *BCT , double *F,IndexSet *IF,int *BCF,int level,int clearflag, double DX, doubleBuffer *buf) ;
00034
00035 void MatVec (double *T,int *BCT , double *F,int *BCF, int level, double DX) ;
00036
00040 void MatVec2(double *T,IndexSet *IT,int *BCT , double *F,IndexSet *IF,int *BCF,int level,int clearflag, double DX, doubleBuffer *buf) ;
00041
00043 void MatTVec(double *T,IndexSet *IT,int *BCT , double *F,IndexSet *IF,int *BCF,int level, double DX, doubleBuffer *buf) ;
00044
00045 void GetShape(int Level,MatrixShape *S) ;
00046
00048 void Print() ;
00049
00051 Matrix2D AL [3][3] ;
00053 Matrix2D ALT[3][3] ;
00055 Matrix2D AR [3][3] ;
00057 Matrix2D ART[3][3] ;
00058
00060 double a[100] ;
00062 int U,O ;
00063
00065 int IsWT,IsWF ;
00067 double power ;
00068 } ;
00069 #ifdef _TYPEDEF_STRUCTS_
00070 typedef struct OperatorMatrix OperatorMatrix;
00071 #endif
00072
00073
00074
00075 void OperatorMatrixInnerLoop44Odd (int *ii , int *rr , double *F, double *T , IndexSet *IF ,
00076 int BR11 , double *a , double q) ;
00077 void OperatorMatrixInnerLoop12Odd (int *ii , int *rr , double *F, double *T , IndexSet *IF ,
00078 int BR11 , double *a , double q) ;
00079 void OperatorMatrixInnerLoop76Odd (int *ii , int *rr , double *F, double *T , IndexSet *IF ,
00080 int BR11 , double *a , double q) ;
00081 void OperatorMatrixInnerLoop44Even(int *ii , int *rr , double *F, double *T , IndexSet *IF ,
00082 int BR11 , double *a , double q) ;
00083 void OperatorMatrixInnerLoop12Even(int *ii , int *rr , double *F, double *T , IndexSet *IF ,
00084 int BR11 , double *a , double q) ;
00085 void OperatorMatrixInnerLoop76Even(int *ii , int *rr , double *F, double *T , IndexSet *IF ,
00086 int BR11 , double *a , double q) ;
00087
00088 void TransformMatrixInnerLoop00(int *ii , int *rr , double *F, double *T , IndexSet *IF ,
00089 int BR11 , double *a) ;
00090
00091 void TransformMatrixTransposeInnerLoop55(int *ii , int *rr , double *F, double *T , IndexSet *IF ,
00092 int BR11 , double *a) ;
00093 void TransformMatrixTransposeInnerLoopM11(int *ii , int *rr , double *F, double *T , IndexSet *IF ,
00094 int BR11 , double *a) ;
00095
00096 struct LiftingMatrix {
00097 Matrix2D QL[3] ;
00098 Matrix2D PL[3] ;
00099 Matrix2D QR[3] ;
00100 Matrix2D PR[3] ;
00101
00102 double a[100] ;
00103 int U,O ;
00104
00105 void MatVec (double *T, IndexSet *IT , double *F , IndexSet *IF,int *BC,int level,int clearflag, doubleBuffer *buf) ;
00106 void MatVec (double *T, double *F , int *BC , int level , int clearflag) ;
00107
00108
00109
00110
00111 void MatTVec(double *T,IndexSet *IT , double *F,IndexSet *IF, int *BC, int level , int add, doubleBuffer *buf) ;
00112 void MatTVec(double *T, double *F , int *BC , int level , int add) ;
00113
00114 void GetShape(int Level,MatrixShape *S) ;
00115 } ;
00116 #ifdef _TYPEDEF_STRUCTS_
00117 typedef struct LiftingMatrix LiftingMatrix;
00118 #endif
00119
00120
00123 struct TransformMatrix {
00125 void Print () ;
00126
00135 void MatVec (double *T,IndexSet *IT , double *F,IndexSet *IF,int *BC,int level,int clearflag, doubleBuffer *buf) ;
00136
00138 void MatTVec(double *T,IndexSet *IT , double *F,IndexSet *IF,int *BC,int level,int clearflag, doubleBuffer *buf) ;
00139
00140 void GetShape(int Level,MatrixShape *S) ;
00141 void Copy(TransformMatrix *M) ;
00142
00143
00144 Matrix2D AL[3],AR[3] ;
00145 double a[100] ;
00146 int U,O ;
00147 int IsWT ;
00148
00149
00150
00151 friend void bwt(double *d,int *dec,double *c,struct Wavelets *From,struct Wavelets *,int J,int lev) ;
00152 friend void ibwt(double *d,int *dec,double *c,struct Wavelets *From,struct Wavelets *,int J,int lev) ;
00153
00154 friend void MatVecTest(double *d,double *c,Wavelets *W,int l) ;
00155 } ;
00156 #ifdef _TYPEDEF_STRUCTS_
00157 typedef struct TransformMatrix TransformMatrix;
00158 #endif
00159
00160
00161
00162
00163
00164
00165 int LiftingMatrixTransposeFirstNZE (int j,MatrixShape *S) ;
00166 int LiftingMatrixTransposeLastNZE (int j,MatrixShape *S) ;
00167
00168 int LiftingMatrixTransposeFirstNZEP (int j,MatrixShape *S) ;
00169 int LiftingMatrixTransposeLastNZEP (int j,MatrixShape *S) ;
00170
00171 int OperatorMatrixFirstNZE (int j,MatrixShape *S) ;
00172 int OperatorMatrixLastNZE (int j,MatrixShape *S) ;
00173
00174 int OperatorMatrixFirstNZEP (int j,MatrixShape *S) ;
00175 int OperatorMatrixLastNZEP (int j,MatrixShape *S) ;
00176
00177
00178 int OperatorMatrixFirst2NZE (int j,MatrixShape *S) ;
00179 int OperatorMatrixLast2NZE (int j,MatrixShape *S) ;
00180
00181 int OperatorMatrixFirst2NZEP (int j,MatrixShape *S) ;
00182 int OperatorMatrixLast2NZEP (int j,MatrixShape *S) ;
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193 int TransformMatrixFirstNZE (int j,MatrixShape *S) ;
00194 int TransformMatrixLastNZE (int j,MatrixShape *S) ;
00195
00196 int TransformMatrixFirstNZEP (int j,MatrixShape *S) ;
00197 int TransformMatrixLastNZEP (int j,MatrixShape *S) ;
00198
00199 int TransformMatrixTransposeFirstNZE (int j,MatrixShape *S) ;
00200 int TransformMatrixTransposeLastNZE (int j,MatrixShape *S) ;
00201
00202 int TransformMatrixTransposeFirstNZEP(int j,MatrixShape *S) ;
00203 int TransformMatrixTransposeLastNZEP (int j,MatrixShape *S) ;
00204
00205
00206 int TransformMatrixFirst2NZE (int j,MatrixShape *S) ;
00207 int TransformMatrixLast2NZE (int j,MatrixShape *S) ;
00208
00209 int TransformMatrixFirst2NZEP (int j,MatrixShape *S) ;
00210 int TransformMatrixLast2NZEP (int j,MatrixShape *S) ;
00211
00212 #endif