Class documentation of Concepts

Loading...
Searching...
No Matches
space.hh
Go to the documentation of this file.
1
6#ifndef aglowavSpace_hh
7#define aglowavSpace_hh
8
9#ifdef __GUNG__
10 #pragma interface
11#endif
12
14#include "space/space.hh"
15#include "aglowav/element.hh"
16#include "aglowav/tree.hh"
17#include "basics/output.hh"
18
19namespace aglowav {
20
21 // ********************************************************* Haar3dDFSScan **
22
27 template<class F = concepts::Real>
28 class Haar3dDFSScan : public concepts::Scan<concepts::Element<F> > {
29 public:
31 virtual Haar3dXXX<F>& operator++(int) = 0;
32 };
33
34
35 // ********************************************************* Haar3dBFSScan **
36
41 template<class F = concepts::Real>
42 class Haar3dBFSScan : public concepts::Scan<concepts::Element<F> > {
43 public:
45 virtual Haar3dXXX<F>& operator++(int) = 0;
47 virtual void skip(uint lvl) = 0;
48 };
49
50 // **************************************************************** Haar3d **
51
55 template<class F = concepts::Real>
56 class Haar3d : public concepts::Space<F> {
57 public:
59 virtual ~Haar3d() {}
60
62 virtual uint nlvl() const = 0;
64 virtual Haar3dDFSScan<F>* dfsscan() const = 0;
66 virtual Haar3dBFSScan<F>* bfsscan() const = 0;
67 };
68
69 // ******************************************************* BiHaar3dDFSScan **
70
75 template<class F = concepts::Real>
76 class BiHaar3dDFSScan : public Haar3dDFSScan<F> {
77 public:
86 inline ~BiHaar3dDFSScan() {delete[] stk_;}
87
91 inline BiHaar3dDFSScan<F>* clone() const {
92 return new BiHaar3dDFSScan<F>(*this);
93 }
95 inline bool eos() const {return sptr_[0] ? 0 : 1;}
96
97 private:
99 uint ht_;
101 Haar3d000<F>** stk_;
103 Haar3d000<F>** sptr_;
104 };
105
106 // ******************************************************* BiHaar3dBFSScan **
107
112 template<class F = concepts::Real>
113 class BiHaar3dBFSScan : public Haar3dBFSScan<F> {
114 public:
123 inline ~BiHaar3dBFSScan() {delete[] stk_;}
124
128 inline BiHaar3dBFSScan* clone() const {
129 return new BiHaar3dBFSScan<F>(*this);
130 }
132 inline bool eos() const {return sptr_[0] ? 0 : 1;}
134 void skip(uint lvl);
135
136 private:
138 uint ht_;
140 Haar3d000<F>** stk_;
142 Haar3d000<F>** sptr_;
143 };
144
145 // ************************************************************** BiHaar3d **
146
151 template<class F = concepts::Real>
152 class BiHaar3d : public Haar3d<F> {
153 public:
157 inline ~BiHaar3d() {destructor_(elm_);}
158
160 inline uint dim() const {return dim_;}
162 inline uint nelm() const {return nelm_;}
164 inline uint nlvl() const {return nlvl_;}
170 inline BiHaar3dBFSScan<F>* scan() const;
171
172 protected:
174 std::ostream& info(std::ostream& os) const;
175
176 private:
178 Haar3d000<F>* constructor_(BiClNode00<F>* nd, concepts::Real* m,
179 typename Haar3dXXX<F, 2>::Key& key);
180
182 void destructor_(Haar3d000<F>* elm);
183
185 uint dim_;
187 uint nelm_;
189 uint nlvl_;
191 Haar3d000<F>* elm_;
192 };
193
194 template<class F>
196 return new BiHaar3dDFSScan<F>(elm_, nlvl_);
197 }
198
199 template<class F>
201 return new BiHaar3dBFSScan<F>(elm_, nlvl_);
202 }
203
204 template<class F>
206 return new BiHaar3dBFSScan<F>(elm_, nlvl_);
207 }
208
209 template<class F>
210 std::ostream& BiHaar3d<F>::info(std::ostream& os) const {
211 os << "aglowav::" << concepts::typeOf(*this)<< "(dim = " << dim_ << ", nlevel = " << nlvl_;
212 return os << ", nElement = " << nelm_ << ')';
213 }
214
215} // namespace aglowav
216
217#endif // aglowavSpace_hh
BiHaar3dBFSScan(Haar3d000< F > *elm, uint ht)
~BiHaar3dBFSScan()
Destructor.
Definition space.hh:123
Haar3d000< F > & operator++(int)
Next element.
bool eos() const
End of scan.
Definition space.hh:132
void skip(uint lvl)
Skips the levels l > lvl of the subtree.
BiHaar3dBFSScan(const BiHaar3dBFSScan< F > &sc)
Copy constructor.
BiHaar3dBFSScan * clone() const
New scanner.
Definition space.hh:128
BiHaar3dDFSScan(const BiHaar3dDFSScan< F > &sc)
Copy constructor.
Haar3d000< F > & operator++(int)
Next element.
~BiHaar3dDFSScan()
Destructor.
Definition space.hh:86
bool eos() const
End of scan.
Definition space.hh:95
BiHaar3dDFSScan< F > * clone() const
New scanner.
Definition space.hh:91
BiHaar3dDFSScan(Haar3d000< F > *elm, uint ht)
uint nlvl() const
Maximal number of levels.
Definition space.hh:164
BiHaar3dBFSScan< F > * bfsscan() const
Scanner ("breadth" first search (1. parent, 2. children))
Definition space.hh:200
BiHaar3dDFSScan< F > * dfsscan() const
Scanner (depth first search (1. children, 2. parent))
Definition space.hh:195
std::ostream & info(std::ostream &os) const
Information about the space.
Definition space.hh:210
~BiHaar3d()
Destructor.
Definition space.hh:157
BiHaar3dBFSScan< F > * scan() const
Scanner (same as bfsscan())
Definition space.hh:205
uint dim() const
Dimenstion of the space.
Definition space.hh:160
BiHaar3d(BiTree< BiClNode00< F > > &tree)
Constructor.
uint nelm() const
Number of elements.
Definition space.hh:162
virtual void skip(uint lvl)=0
Skips the levels of the subtree.
virtual Haar3dXXX< F > & operator++(int)=0
Next element.
virtual Haar3dXXX< F > & operator++(int)=0
Next element.
virtual Haar3dBFSScan< F > * bfsscan() const =0
Scanner ("breadth" first search (1. parent, 2. children))
virtual Haar3dDFSScan< F > * dfsscan() const =0
Scanner (depth first search (1. children, 2. parent))
virtual uint nlvl() const =0
Maximal number of levels.
virtual ~Haar3d()
Destructor.
Definition space.hh:59
std::string typeOf(const T &t)
Definition output.hh:43
double Real
Definition typedefs.hh:39