f01.hh

Go to the documentation of this file.
1 
6 #ifndef clusterF01_hh
7 #define clusterF01_hh
8 
10 #include "toolbox/hashMap.hh"
11 #include "cluster/expansion.hh"
12 #include "cluster/f.hh"
13 
14 namespace cluster {
15 
16  // ******************************************************************* F01 **
17 
23  template<class NodeX, class NodeY>
24  class F01 : public ClstF<NodeX, NodeY> {
25  public:
29  typedef typename ClstF<NodeX, NodeY>::FX FX;
30  typedef typename ClstF<NodeX, NodeY>::FY FY;
33  private:
36  class Ffld {
40  uint sigma_, tau_;
43 
44  public:
45  inline Ffld(uint blksz, const ExpansionF<FX>& exp, uint sigma,
46  uint tau, Ffld* lnk)
47  : lnk_(lnk), sigma_(sigma), tau_(tau) {
48  val_ = exp.getCol(blksz);
49  }
50  inline ~Ffld() {delete val_;}
51 
52  inline Ffld* link() const {return lnk_;}
53  inline uint sigma() const {return sigma_;}
54  inline uint tau() const {return tau_;}
55  inline FColExp* val() const {return val_;}
56  };
57 
61 
64 
66  uint m_;
70  uint minsz_;
74  uint nffld_;
78  uint nnfld_;
79 
81  void constructor_(const NodeX* clstX, const NodeY* clstY);
83  void constructorSym_(const NodeX* clstX, const NodeY* clstY);
87  template<class Trts, class Nd>
88  uint info_(uint idx, const Nd* clst,
89  std::unordered_map<uint, uint>& nlf) const;
90 
91  protected:
93  std::ostream& info(std::ostream& os) const;
94 
95  public:
105  F01(const Tree<NodeX>& treeX, const Tree<NodeY>& treeY,
106  const ExpansionF<FX>& exp, concepts::Real eta, uint minsz);
115  F01(const Tree<NodeX>& tree, const ExpansionF<FX>& exp,
116  concepts::Real eta, uint minsz);
117 
118  ~F01();
119 
121  void operator()(const ClstY<NodeY>& vecY, ClstX<NodeX>& vecX) const;
123  inline NfldScan* scan() const {
125  }
127  inline float memory() const;
133  std::ostream& info(std::ostream& os, uint idxX, uint idxY) const;
134  };
135 
136  template<class NodeX, class NodeY>
137  inline float F01<NodeX,NodeY>::memory() const {
138  return sizeof(F01<NodeX,NodeY>)
139  + (float)nffld_ *
140  (sizeof(typename F01<NodeX,NodeY>::Ffld)
141  + (ffld_ ? ffld_->val()->memory(exp_.blksz(m_)) : 0))
142  + (float)nnfld_ * sizeof(concepts::Joiner<NfldNodes, 1>);
143  }
144 
145 } // namespace cluster
146 
147 #endif // clusterF01_hh
ClstF< NodeX, NodeY >::FX FX
Definition: f01.hh:29
const Tree< NodeY > & treeY_
Definition: f01.hh:60
virtual FColExp * getCol(uint blksz) const =0
Allocates memory for the expansion coefficients.
Class to store the far field coefficients.
Definition: f01.hh:36
ClstF< NodeX, NodeY >::NfldNodes NfldNodes
Definition: f01.hh:31
Joiner class with multiple successors, i.e.
Scanner for a list.
uint info_(uint idx, const Nd *clst, std::unordered_map< uint, uint > &nlf) const
Information routine for recursive calls used by info(os, idxX, idxY)
F01(const Tree< NodeX > &treeX, const Tree< NodeY > &treeY, const ExpansionF< FX > &exp, concepts::Real eta, uint minsz)
Constructor.
TraitsY::F FY
Definition: f.hh:48
FColExp * val() const
Definition: f01.hh:55
ClstF< NodeX, NodeY >::NfldScan NfldScan
Definition: f01.hh:32
const ExpansionF< FX > & exp_
Kernel expansion.
Definition: f01.hh:63
concepts::Joiner< NfldNodes, 1 > * nfld_
Near field entries.
Definition: f01.hh:76
ClstF< NodeX, NodeY >::TraitsY TraitsY
Definition: f01.hh:28
Interface class for a node in a cluster tree.
Definition: tree.hh:252
uint tau() const
Definition: f01.hh:54
F01(const Tree< NodeX > &tree, const ExpansionF< FX > &exp, concepts::Real eta, uint minsz)
Constructor.
void constructor_(const NodeX *clstX, const NodeY *clstY)
Constructor for recursive calls (non symmetric)
uint nffld_
Number of far field entries.
Definition: f01.hh:74
std::ostream & info(std::ostream &os, uint idxX, uint idxY) const
Some detailed information about the far field concering two DoF's.
Ffld(uint blksz, const ExpansionF< FX > &exp, uint sigma, uint tau, Ffld *lnk)
Definition: f01.hh:45
Class to store a pair of clusters in the near field.
Definition: f.hh:22
uint minsz_
Minimal size for a cluster pair in the far field.
Definition: f01.hh:70
ClstF< NodeX, NodeY >::FY FY
Definition: f01.hh:30
const Tree< NodeX > & treeX_
Cluster trees.
Definition: f01.hh:59
std::ostream & info(std::ostream &os) const
Some basic informations.
An abstract class for scanning a mesh (a set of cells) or a space (a set of elements).
uint sigma_
Number of two clusters belonging to the far field.
Definition: f01.hh:40
uint sigma() const
Definition: f01.hh:53
Far field matrix F.
Definition: f01.hh:24
Abstract class for a far field matrix F.
Definition: f.hh:42
TraitsX::F FX
Definition: f.hh:47
FColExp * val_
Far field coefficients of the kernel expansion.
Definition: f01.hh:42
concepts::Real eta_
Far field coefficient.
Definition: f01.hh:68
Used for the cluster classes for the boundary element method.
Definition: cebysev.hh:13
uint nnfld_
Number of near field entries.
Definition: f01.hh:78
ClstF< NodeX, NodeY >::TraitsX TraitsX
Interface of the far field.
Definition: f01.hh:27
NfldScan * scan() const
Scanner for the nearfield.
Definition: f01.hh:123
Ffld * lnk_
Next far field entry.
Definition: f01.hh:38
Ffld * link() const
Definition: f01.hh:52
void operator()(const ClstY< NodeY > &vecY, ClstX< NodeX > &vecX) const
Application operator.
float memory() const
Memory used by F01 in bytes.
Definition: f01.hh:137
void constructorSym_(const NodeX *clstX, const NodeY *clstY)
Constructor for recursive calls (symmetric)
uint m_
Expansion order.
Definition: f01.hh:66
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Ffld * ffld_
Far field entries.
Definition: f01.hh:72
Abstract class to hold the expansion coefficients.
Definition: expansion.hh:143
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich