00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _FRAMETL_FRAME_INDEX_H
00011 #define _FRAMETL_FRAME_INDEX_H
00012
00013 #include <iostream>
00014 #include <cube/cube_index.h>
00015 #include <aggregated_frame.h>
00016
00017 using std::cout;
00018 using std::endl;
00019
00020 using WaveletTL::CubeIndex;
00021
00022 #include <utils/multiindex.h>
00023
00024 using MathTL::MultiIndex;
00025
00026 namespace FrameTL
00027 {
00028
00035 typedef struct {
00036
00038 int num;
00039
00041 double val;
00042
00043 } Coefficient;
00044
00045
00046
00047 template<class IBASIS, unsigned int DIM_d, unsigned int DIM_m>
00048 class AggregatedFrame;
00049
00055 template <class IBASIS, unsigned int DIM_d, unsigned int DIM_m = DIM_d>
00056 class FrameIndex
00057 {
00058
00059 public:
00060
00062 typedef MultiIndex<int,DIM_d> type_type;
00063
00065 typedef MultiIndex<int,DIM_d> translation_type;
00066
00070 FrameIndex(const AggregatedFrame<IBASIS,DIM_d,DIM_m>* frame = 0);
00071
00075 FrameIndex(const FrameIndex&);
00076
00080 FrameIndex(const FrameIndex*);
00081
00088 FrameIndex(const AggregatedFrame<IBASIS,DIM_d,DIM_m>* frame,
00089 const CubeIndex<IBASIS,DIM_d>&, const int patch);
00090
00097 FrameIndex(const AggregatedFrame<IBASIS,DIM_d,DIM_m>* frame,
00098 const int j,
00099 const type_type& e,
00100 const unsigned int patch,
00101 const translation_type& k);
00102
00109 FrameIndex(const int num,
00110 const AggregatedFrame<IBASIS,DIM_d,DIM_m>* frame);
00111
00112
00114 bool operator == (const FrameIndex& lambda) const;
00115
00117 inline bool operator != (const FrameIndex& lambda) const
00118 { return !(*this == lambda); }
00119
00121 FrameIndex& operator ++ ();
00122
00124 FrameIndex& operator = (const FrameIndex&);
00125
00127 bool operator < (const FrameIndex& lambda) const;
00128
00130 bool operator <= (const FrameIndex& lambda) const
00131 { return (*this < lambda || *this == lambda); }
00132
00134 const int j() const { return j_; }
00135
00137 const type_type& e() const { return e_; }
00138
00140 const translation_type& k() const { return k_; }
00141
00143 const int p() const { return p_; }
00144
00145 const int number() const { return num_; }
00146
00148 const AggregatedFrame<IBASIS,DIM_d,DIM_m>* frame() const
00149 { return frame_; }
00150
00156 void set_number();
00157
00158 protected:
00159
00163 const AggregatedFrame<IBASIS,DIM_d,DIM_m>* frame_;
00164
00166 int j_;
00167
00169 type_type e_;
00170
00174 int p_;
00175
00177 translation_type k_;
00178
00180 int num_;
00181
00182 };
00183
00187 template <class IBASIS, unsigned int DIM_d, unsigned int DIM_m>
00188 std::ostream& operator << (std::ostream&, const FrameIndex<IBASIS, DIM_d, DIM_m>&);
00189
00193 template <class IBASIS, unsigned int DIM_d, unsigned int DIM_m, class FRAME>
00194 FrameIndex<IBASIS,DIM_d,DIM_m>
00195 first_generator(const FRAME* frame, const int j);
00196
00200 template <class IBASIS, unsigned int DIM_d, unsigned int DIM_m, class FRAME>
00201 FrameIndex<IBASIS,DIM_d,DIM_m>
00202 last_generator(const FRAME* frame,const int j);
00203
00204
00208 template <class IBASIS, unsigned int DIM_d, unsigned int DIM_m, class FRAME>
00209 FrameIndex<IBASIS,DIM_d,DIM_m>
00210 first_wavelet(const FRAME* frame, const int j);
00211
00215 template <class IBASIS, unsigned int DIM_d, unsigned int DIM_m, class FRAME>
00216 FrameIndex<IBASIS,DIM_d,DIM_m>
00217 last_wavelet(const FRAME* frame, const int j);
00218
00222 template <class IBASIS, unsigned int DIM_d, unsigned int DIM_m, class FRAME>
00223 int
00224 first_generator_num(const FRAME* frame);
00225
00229 template <class IBASIS, unsigned int DIM_d, unsigned int DIM_m, class FRAME>
00230 int
00231 last_generator_num(const FRAME* frame);
00232
00236 template <class IBASIS, unsigned int DIM_d, unsigned int DIM_m, class FRAME>
00237 int
00238 first_wavelet_num(const FRAME* frame, const int j);
00239
00243 template <class IBASIS, unsigned int DIM_d, unsigned int DIM_m, class FRAME>
00244 int
00245 last_wavelet_num(const FRAME* frame, const int j);
00246
00247
00248
00249
00250
00251
00252
00253 template <class INDEX>
00254 void to_array (const InfiniteVector<double, INDEX>& ivec,
00255 Coefficient* coeff_array);
00256
00257 template <class INDEX, class FRAME>
00258 void array_to_map (const Coefficient* coeff_array,
00259 const FRAME* frame,
00260 InfiniteVector<double, INDEX>& ivec,
00261 const int count);
00262
00263 }
00264
00265 #include "frame_index.cpp"
00266
00267 #endif