Class documentation of Concepts

Loading...
Searching...
No Matches
f02.hh
Go to the documentation of this file.
1
6#ifndef clusterF02_hh
7#define clusterF02_hh
8
10#include "toolbox/hashMap.hh"
11#include "cluster/expansion.hh"
12#include "cluster/f.hh"
13
14namespace cluster {
15
16 // ******************************************************************* F02 **
17
22 template<class NodeX, class NodeY>
23 class F02 : 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 uint m, Ffld* lnk = 0)
49 : lnk_(lnk), clstX_(clstX), clstY_(clstY), m_(m), 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() const {return m_;}
59 inline FColExp* val(uint blksz, const ExpansionF<FX>& exp) {
60 delete val_; val_ = blksz ? exp.getCol(blksz) : 0; return val_;
61 }
62 inline FColExp* val() const {return val_;}
63 };
64
66 const Tree<NodeX>& treeX_;
67 const Tree<NodeY>& treeY_;
68
70 const ExpansionF<FX>& exp_;
71
73 uint m_;
74 concepts::Real eps_;
77 uint minsz_;
78
80 Ffld* ffld_;
82 uint nffld_;
83 uint nffldval_;
87 uint nnfld_;
88
90 void constructor_(const NodeX* clstX, const NodeY* clstY);
91 template<class Trts, class Nd>
92 uint info_(uint idx, const Nd* clst,
93 std::unordered_map<uint, uint>& nlf) const;
94
95 protected:
97 std::ostream& info(std::ostream& os) const;
98
99 public:
100 F02(const Tree<NodeX>& treeX, const Tree<NodeY>& treeY,
101 const ExpansionF<FX>& exp, concepts::Real eps,
102 concepts::Real s, uint minsz);
103 ~F02();
104
106 void operator()(const ClstY<NodeY>& vecY, ClstX<NodeX>& vecX) const;
107
108 inline NfldScan* scan() const {
109 return new concepts::ListScan<NfldNodes>(*nfld_);
110 }
112 inline float memory() const;
113 std::ostream& info(std::ostream& os, uint idxX, uint idxY) const;
114 };
115
116 template<class NodeX, class NodeY>
117 inline float F02<NodeX, NodeY>::memory() const {
118 return sizeof(F02<NodeX, NodeY>)
119 + (float)nffld_ * sizeof(typename F02<NodeX, NodeY>::Ffld)
120 + nffldval_ * (ffld_->val() ? ffld_->val()->memory(1)
121 : ffld_->val(1, exp_)->memory(1))
122 + (float)nnfld_ * sizeof(concepts::Joiner<NfldNodes, 1>);
123 }
124
125} // namespace cluster
126
127#endif // clusterF02_hh
virtual FColExp * getCol(uint blksz) const =0
void operator()(const ClstY< NodeY > &vecY, ClstX< NodeX > &vecX) const
Application operator.
ClstF< NodeX, NodeY >::TraitsX TraitsX
Interface of the far field.
Definition f02.hh:26
float memory() const
Memory used by F02 in bytes.
Definition f02.hh:117
std::ostream & info(std::ostream &os) const
Some basic informations.
double Real
Definition typedefs.hh:39
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320