Go to the documentation of this file.00001
00002
00003
00004 #ifndef aglowav2Operator_hh
00005 #define aglowav2Operator_hh
00006
00007 #ifdef __GUNG__
00008 #pragma interface
00009 #endif
00010
00011 #include "operator/compositions.hh"
00012 #include "aglowav2/space.hh"
00013 #include "aglowav2/bform.hh"
00014
00015 namespace aglowav2 {
00016
00017
00018
00022 template<class F = concepts::Real>
00023 class Delta {
00024 public:
00026 virtual bool operator()(const Haar3dXXX<F>& elmX,
00027 const Haar3dXXX<F>& elmY) const = 0;
00028 virtual bool operator()(const Haar3d000<F>& elmX,
00029 const Haar3d000<F>& elmY) const;
00030 };
00031
00032 template<class F>
00033 bool Delta<F>::operator()(const Haar3d000<F>& elmX,
00034 const Haar3d000<F>& elmY) const {
00035 const Haar3dXXX<F>& elmXA(elmX);
00036 const Haar3dXXX<F>& elmYA(elmY);
00037 return (*this)(elmXA, elmYA);
00038 }
00039
00040
00041
00047 template<class F = concepts::Real>
00048 class DeltaFull : public Delta<F> {
00049 public:
00050 bool operator()(const Haar3dXXX<F>& elmX,
00051 const Haar3dXXX<F>& elmY) const;
00052 bool operator()(const Haar3d000<F>& elmX,
00053 const Haar3d000<F>& elmY) const;
00054 };
00055
00056
00057
00063 template<class F = concepts::Real>
00064 class Delta00 : public Delta<F> {
00065 public:
00066 Delta00(concepts::Real a, concepts::Real alpha, const Haar3d0<F>& spc);
00067
00068 bool operator()(const Haar3dXXX<F>& elmX,
00069 const Haar3dXXX<F>& elmY) const;
00070 bool operator()(const Haar3d000<F>& elmX,
00071 const Haar3d000<F>& elmY) const;
00072
00073 private:
00075 concepts::Real a_;
00076 concepts::Real alpha_;
00077
00079 concepts::Real Sz_;
00080 concepts::Real h_;
00081 };
00082
00083
00084
00088 template<class F = concepts::Real>
00089 class Operator00 : public concepts::Operator<F> {
00090 public:
00096 Operator00(AglowavBF00<F>& bf, const Haar3d0<F>& spc,
00097 const Delta<F>& delta);
00099 ~Operator00();
00100
00104 void operator()(const concepts::Function<F>& fncY,
00105 concepts::Function<F>& fncX);
00106 void operator()(const concepts::Vector<F>& fncY,
00107 concepts::Vector<F>& fncX);
00108
00110 const concepts::Space<F>& spaceX() const {return spc_;}
00112 const concepts::Space<F>& spaceY() const {return spc_;}
00113
00115 const F* diag() const {return diag_;}
00117 uint memory() const {return mem_;}
00118
00119
00120
00121 uint maxMemory() const {return maxmem_;}
00122
00124 void pattern(std::ostream& os, uint nr) const;
00128 void patternL(std::ostream& os, uint nr) const;
00130 void uncompress(std::ostream& os, uint nr) const;
00134 void uncompressL(std::ostream& os, uint nr) const;
00135
00136 protected:
00138 std::ostream& info(std::ostream& os) const;
00139
00140 private:
00142 struct Pattern {
00144 uint index;
00146 uint length;
00147
00148 Pattern() : index(0), length(0) {}
00149 };
00150
00152 struct Matrix {
00154 F* valuation;
00156 Pattern* pattern;
00157
00158 Matrix() : valuation(0) {}
00159 };
00160
00162 void lstore_(concepts::ElementMatrix<F>& A, uint idx, F* val,
00163 Pattern** pat);
00165 void ustore_(concepts::ElementMatrix<F>& A, uint idx, F** val,
00166 Pattern* pat);
00168 void dstore_(concepts::ElementMatrix<F>& A, uint idx, F** val,
00169 Pattern** pat);
00171 void compress_(uint dim, uint idx, F valbuf[], uint nval,
00172 Pattern patbuf[], uint npat);
00173
00175 const Haar3d0<F>& spc_;
00177 uint n_;
00179 Matrix* mtx_;
00180
00182 uint mem_;
00186 uint maxmem_;
00188 uint nentry_;
00189
00191 F* diag_;
00192 };
00193
00194 }
00195
00196 #endif // aglowav2Operator_hh