Class documentation of Concepts

Loading...
Searching...
No Matches
f04.hh
Go to the documentation of this file.
1
6#ifndef clusterF04_hh
7#define clusterF04_hh
8
10#include "toolbox/hashMap.hh"
11#include "cluster/expansion.hh"
12#include "cluster/f.hh"
13
14namespace cluster {
15
16 // ******************************************************************* F04 **
17
22 template<class NodeX, class NodeY>
23 class F04 : public ClstF<NodeX, NodeY> {
24 public:
28 typedef typename ClstF<NodeX, NodeY>::FX FX;
29 typedef typename ClstF<NodeX, NodeY>::FY FY;
32 private:
35 class Ffld {
37 Ffld* lnk_;
39 const NodeX* clstX_;
40 const NodeY* clstY_;
42 uint m_;
44 FColExp* val_;
45
46 public:
47 inline Ffld(const NodeX* clstX, const NodeY* clstY,
48 Ffld* lnk = 0)
49 : lnk_(lnk), clstX_(clstX), clstY_(clstY), m_(0), val_(0) {}
50 inline ~Ffld() {delete val_;}
51
52 inline Ffld* link() const {return lnk_;}
53 inline uint sigma() const {return TraitsX::index(clstX_);}
54 inline uint tau() const {return TraitsY::index(clstY_);}
55 inline concepts::Real3d z() const {
56 return TraitsY::center(clstY_) - TraitsX::center(clstX_);
57 }
58 inline uint m(uint m) {if (m) m_ = m; return m_;}
59 inline uint m() const {return m_;}
60 inline FColExp* val(uint blksz, const ExpansionF<FX>& exp) {
61 if (blksz) {delete val_; val_ = exp.getCol(blksz);} return val_;
62 }
63 inline FColExp* val() const {return val_;}
64 inline concepts::Real intensity(concepts::Real s) const {
65 concepts::Real I = TraitsX::nleaf(clstX_);
66 if (I < TraitsY::nleaf(clstY_)) I = TraitsY::nleaf(clstY_);
67 //concepts::Real I =
68 // (concepts::Real)TraitsX::nleaf(clstX_) * TraitsY::nleaf(clstY_);
69 return I * pow(z().l2(), -s);
70 }
71 };
72
74 const Tree<NodeX>& treeX_;
75 const Tree<NodeY>& treeY_;
76
78 const ExpansionF<FX>& exp_;
79
81 uint m_;
82 concepts::Real eta_;
85 uint minsz_;
86
88 Ffld* ffld_;
90 uint nffld_;
91 uint nffldval_;
95 uint nnfld_;
96
98 void constructor_(const NodeX* clstX, const NodeY* clstY,
99 concepts::Real* Imax);
100 template<class Trts, class Nd>
101 uint info_(uint idx, const Nd* clst,
102 std::unordered_map<uint, uint>& nlf) const;
103
104 protected:
105 std::ostream& info(std::ostream& os) const;
106
107 public:
108 F04(const Tree<NodeX>& treeX, const Tree<NodeY>& treeY,
109 const ExpansionF<FX>& exp, concepts::Real eta,
110 concepts::Real s, uint minsz);
111 ~F04();
112
114 void operator()(const ClstY<NodeY>& vecY, ClstX<NodeX>& vecX) const;
115
116 inline NfldScan* scan() const {
117 return new concepts::ListScan<NfldNodes>(*nfld_);
118 }
120 inline float memory() const;
121 std::ostream& info(std::ostream& os, uint idxX, uint idxY) const;
122 };
123
124 template<class NodeX, class NodeY>
125 inline float F04<NodeX, NodeY>::memory() const {
126 return sizeof(F04<NodeX, NodeY>)
127 + (float)nffld_ * sizeof(typename F04<NodeX, NodeY>::Ffld)
128 + (float)nnfld_ * sizeof(concepts::Joiner<NfldNodes, 1>)
129 + nffldval_ *
130 (ffld_->val() ? ffld_->val()->memory(1)
131 : ffld_->val(1, exp_)->memory(1));
132 }
133
134} // namespace cluster
135
136#endif // clusterF04_hh
virtual FColExp * getCol(uint blksz) const =0
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
void operator()(const ClstY< NodeY > &vecY, ClstX< NodeX > &vecX) const
Application operator.
ClstF< NodeX, NodeY >::TraitsX TraitsX
Interface of the far field.
Definition f04.hh:26
float memory() const
Memory used by F04 in bytes.
Definition f04.hh:125
double Real
Definition typedefs.hh:39
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320