Class documentation of Concepts

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