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 
14 namespace 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 {
39  const NodeX* clstX_;
40  const NodeY* clstY_;
42  uint m_;
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 {
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 
68 
71 
73  uint m_;
77  uint minsz_;
78 
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 {
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
Ffld * link() const
Definition: f02.hh:52
virtual FColExp * getCol(uint blksz) const =0
Allocates memory for the expansion coefficients.
const NodeY * clstY_
Definition: f02.hh:40
Class to store the far field coefficients.
Definition: f02.hh:35
uint m_
Expansion order.
Definition: f02.hh:42
Ffld * lnk_
Next far field entry.
Definition: f02.hh:37
uint nffld_
Number of far field entries.
Definition: f02.hh:82
concepts::Real eps_
Definition: f02.hh:74
uint m() const
Definition: f02.hh:58
uint nnfld_
Number of near field entries.
Definition: f02.hh:87
const Tree< NodeX > & treeX_
Cluster trees.
Definition: f02.hh:66
Joiner class with multiple successors, i.e.
Scanner for a list.
std::ostream & info(std::ostream &os) const
Some basic informations.
static const concepts::Real3d & center(const Node *nd)
Definition: tree.hh:261
TraitsY::F FY
Definition: f.hh:48
uint tau() const
Definition: f02.hh:54
void operator()(const ClstY< NodeY > &vecY, ClstX< NodeX > &vecX) const
Application operator.
float memory() const
Memory used by F02 in bytes.
Definition: f02.hh:117
Ffld(const NodeX *clstX, const NodeY *clstY, uint m, Ffld *lnk=0)
Definition: f02.hh:47
Interface class for a node in a cluster tree.
Definition: tree.hh:252
F02(const Tree< NodeX > &treeX, const Tree< NodeY > &treeY, const ExpansionF< FX > &exp, concepts::Real eps, concepts::Real s, uint minsz)
void constructor_(const NodeX *clstX, const NodeY *clstY)
Constructor for recursive calls.
uint sigma() const
Definition: f02.hh:53
ClstF< NodeX, NodeY >::TraitsY TraitsY
Definition: f02.hh:27
FColExp * val() const
Definition: f02.hh:62
Class to store a pair of clusters in the near field.
Definition: f.hh:22
NfldScan * scan() const
Definition: f02.hh:108
FColExp * val(uint blksz, const ExpansionF< FX > &exp)
Definition: f02.hh:59
An abstract class for scanning a mesh (a set of cells) or a space (a set of elements).
concepts::Real s_
Definition: f02.hh:75
uint m_
Expansion order.
Definition: f02.hh:73
static uint index(const Node *nd)
Definition: tree.hh:268
uint minsz_
Minimal size for a cluster pair in the far field.
Definition: f02.hh:77
Abstract class for a far field matrix F.
Definition: f.hh:42
TraitsX::F FX
Definition: f.hh:47
Ffld * ffld_
Far field entries.
Definition: f02.hh:80
ClstF< NodeX, NodeY >::FX FX
Definition: f02.hh:28
ClstF< NodeX, NodeY >::NfldScan NfldScan
Definition: f02.hh:31
const NodeX * clstX_
Pointer to two clusters belonging to the far field.
Definition: f02.hh:39
ClstF< NodeX, NodeY >::NfldNodes NfldNodes
Definition: f02.hh:30
std::ostream & info(std::ostream &os, uint idxX, uint idxY) const
Used for the cluster classes for the boundary element method.
Definition: cebysev.hh:13
ClstF< NodeX, NodeY >::FY FY
Definition: f02.hh:29
const ExpansionF< FX > & exp_
Kernel expansion.
Definition: f02.hh:70
FColExp * val_
Far field coefficients of the kernel expansion.
Definition: f02.hh:44
Far field matrix F.
Definition: f02.hh:23
const Tree< NodeY > & treeY_
Definition: f02.hh:67
ClstF< NodeX, NodeY >::TraitsX TraitsX
Interface of the far field.
Definition: f02.hh:26
uint info_(uint idx, const Nd *clst, std::unordered_map< uint, uint > &nlf) const
concepts::Real3d z() const
Definition: f02.hh:55
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
uint nffldval_
Definition: f02.hh:83
concepts::Joiner< NfldNodes, 1 > * nfld_
Near field entries.
Definition: f02.hh:85
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