Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

aglowav2/trafo.hh
Go to the documentation of this file.
00001 /* Transformation operators for agglomerated wavelets.
00002  */
00003 
00004 #ifndef aglowav2trafo_hh
00005 #define aglowav2trafo_hh
00006 
00007 #ifdef __GUNG__
00008 #pragma interface
00009 #endif
00010 
00011 #include "aglowav2/space.hh"
00012 #include "operator/compositions.hh"
00013 
00014 namespace aglowav2 {
00015 
00016   // ******************************************************************* C2W **
00017 
00021   template<class F = concepts::Real>
00022   class C2W : public concepts::Operator<F> {
00023   public:
00025     C2W(const Haar3d0<F>& wavspc);
00027     ~C2W() {delete[] leven_;  delete[] lodd_;}
00028 
00032     void operator()(const concepts::Function<F>& fncC,
00033         concepts::Function<F>& fncW);
00034     void operator()(const concepts::Vector<F>& fncC,
00035                     concepts::Vector<F>& fncW);
00037     const Haar3d0<F>& spaceX() const {return wavspc_;}
00038     const concepts::Space<F>&  spaceY() const {return wavspc_.space();}
00039 
00040   protected:
00042     std::ostream& info(std::ostream& os) const;
00043 
00044   private:
00045     const Haar3d0<F>& wavspc_;
00046 
00048     F* leven_;
00049     F* lodd_;
00050   };
00051 
00052   template<class F>
00053   C2W<F>::C2W(const Haar3d0<F>& wavspc) 
00054     : concepts::Operator<F>(wavspc.dim(), wavspc.space().dim())
00055     , wavspc_(wavspc)
00056   {
00057     leven_ = new F[wavspc_.dim()];
00058     lodd_  = new F[wavspc_.dim()];
00059   }
00060 
00061   template<class F>
00062   std::ostream& C2W<F>::info(std::ostream& os) const {
00063     os << "aglowav2::C2W(" << wavspc_.space() << " --> ";
00064     return os << wavspc_ << ')';
00065   }
00066 
00067   // ******************************************************************* W2C **
00068 
00072   template<class F = concepts::Real>
00073   class W2C : public concepts::Operator<F> {
00074   public:
00076     W2C(const Haar3d0<F>& wavspc);
00078     ~W2C() {delete[] ptrs_;  delete[] data_;  delete[] locdata_;}
00079 
00083     void operator()(const concepts::Function<F>& fncW,
00084         concepts::Function<F>& fncC);
00085     void operator()(const concepts::Vector<F>& fncW,
00086                     concepts::Vector<F>& fncC);
00088     const concepts::Space<F>& spaceX() const {return wavspc_.space();}
00089     const Haar3d0<F>& spaceY() const {return wavspc_;}
00090 
00091   protected:
00093     std::ostream& info(std::ostream& os) const;
00094 
00095   private:
00096     const Haar3d0<F>& wavspc_;
00097 
00099     uint maxdim_;
00101     uint nlvl_;
00102 
00104     F** ptrs_;
00105     F*  data_;
00106     F*  locdata_;
00107   };
00108 
00109   template<class F>
00110   W2C<F>::W2C(const Haar3d0<F>& wavspc)
00111     : concepts::Operator<F>(wavspc.space().dim(), wavspc.dim())
00112     , wavspc_(wavspc), maxdim_(wavspc_.maxLocDim()), nlvl_(wavspc_.nlvl() + 1)
00113   {
00114     ptrs_    = new F*[nlvl_];
00115     data_    = new F[maxdim_ * nlvl_];
00116     locdata_ = new F[maxdim_];
00117   }
00118 
00119   template<class F>
00120   std::ostream& W2C<F>::info(std::ostream& os) const {
00121     os << "aglowav2::W2C(" << wavspc_ << " --> ";
00122     return os << wavspc_.space() << ')';
00123   }
00124 
00125 } // namespace aglowav
00126 
00127 #endif // aglowav2trafo_hh
00128 

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)