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 
14 namespace 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 {
42  const NodeX* clstX_;
43  const NodeY* clstY_;
45  uint m_;
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 {
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 
71 
74 
76  uint m_;
80  uint minsz_;
82 
86  uint nffld_;
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,
106  const ExpansionF<FX>& exp, concepts::Real eps, concepts::Real s,
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 {
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
uint info_(uint idx, const Nd *clst, std::unordered_map< uint, uint > &nlf) const
int maxnffldval_
Definition: f03.hh:81
uint m_
Expansion order.
Definition: f03.hh:45
FColExp * ffldval_
Buffer for the values computed on the fly.
Definition: f03.hh:88
virtual FColExp * getCol(uint blksz) const =0
Allocates memory for the expansion coefficients.
uint m() const
Definition: f03.hh:61
Class to store the far field coefficients.
Definition: f03.hh:38
uint nffld_
Number of far field entries.
Definition: f03.hh:86
Joiner class with multiple successors, i.e.
concepts::Joiner< NfldNodes, 1 > * nfld_
Near field entries.
Definition: f03.hh:91
uint nnfld_
Number of near field entries.
Definition: f03.hh:93
Scanner for a list.
static const concepts::Real3d & center(const Node *nd)
Definition: tree.hh:261
TraitsY::F FY
Definition: f.hh:48
NfldScan * scan() const
Definition: f03.hh:113
Ffld * lnk_
Next far field entry.
Definition: f03.hh:40
uint nffldval_
Definition: f03.hh:89
ClstF< NodeX, NodeY >::FX FX
Definition: f03.hh:31
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
const Tree< NodeX > & treeX_
Cluster trees.
Definition: f03.hh:69
uint sigma() const
Definition: f03.hh:56
FColExp * val(uint blksz, const ExpansionF< FX > &exp)
Definition: f03.hh:62
Interface class for a node in a cluster tree.
Definition: tree.hh:252
const NodeX * clstX_
Pointer to two clusters belonging to the far field.
Definition: f03.hh:42
Class to store a pair of clusters in the near field.
Definition: f.hh:22
const NodeY * clstY_
Definition: f03.hh:43
uint minsz_
Minimal size for a cluster pair in the far field.
Definition: f03.hh:80
void constructor_(const NodeX *clstX, const NodeY *clstY)
Constructor for recursive calls.
An abstract class for scanning a mesh (a set of cells) or a space (a set of elements).
static uint index(const Node *nd)
Definition: tree.hh:268
ClstF< NodeX, NodeY >::TraitsY TraitsY
Definition: f03.hh:30
Abstract class for a far field matrix F.
Definition: f.hh:42
TraitsX::F FX
Definition: f.hh:47
ClstF< NodeX, NodeY >::FY FY
Definition: f03.hh:32
FColExp * val() const
Definition: f03.hh:65
const ExpansionF< FX > & exp_
Kernel expansion.
Definition: f03.hh:73
std::ostream & info(std::ostream &os, uint idxX, uint idxY) const
float memory() const
Memory used by F03 in bytes.
Definition: f03.hh:122
Ffld * link() const
Definition: f03.hh:55
concepts::Real s_
Definition: f03.hh:78
Used for the cluster classes for the boundary element method.
Definition: cebysev.hh:13
F03(const Tree< NodeX > &treeX, const Tree< NodeY > &treeY, const ExpansionF< FX > &exp, concepts::Real eps, concepts::Real s, uint minsz, int maxnffldval)
uint tau() const
Definition: f03.hh:57
ClstF< NodeX, NodeY >::NfldScan NfldScan
Definition: f03.hh:34
Ffld(const NodeX *clstX, const NodeY *clstY, uint m, Ffld *lnk=0)
Definition: f03.hh:50
Far field matrix F.
Definition: f03.hh:26
void operator()(const ClstY< NodeY > &vecY, ClstX< NodeX > &vecX) const
Application operator.
uint m_
Expansion order.
Definition: f03.hh:76
concepts::Real3d z() const
Definition: f03.hh:58
Ffld * ffld_
Far field entries.
Definition: f03.hh:84
ClstF< NodeX, NodeY >::TraitsX TraitsX
Interface of the far field.
Definition: f03.hh:29
const Tree< NodeY > & treeY_
Definition: f03.hh:70
ClstF< NodeX, NodeY >::NfldNodes NfldNodes
Definition: f03.hh:33
concepts::Real eps_
Definition: f03.hh:77
FColExp * val_
Far field coefficients of the kernel expansion.
Definition: f03.hh:47
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
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