tree02.hh

Go to the documentation of this file.
1 
6 #ifndef clusterTree02_hh
7 #define clusterTree02_hh
8 
9 #include "cluster/tree.hh"
10 
11 namespace cluster {
12 
13  // ********************************************************** TreeTraits02 **
14 
19  template<class Node>
20  class TreeTraits02 : public TreeTraits<Node> {
21  public:
22  typedef typename TreeTraits<Node>::F F;
23 
24  static Node* newNode(const concepts::Element<F>& elm, const BBall<F>& ball,
25  Node* lnk) {return new Node(elm, ball, lnk);}
26  static Node* newNode(uint idx, Node& chld, const concepts::Real3d& c,
27  concepts::Real r, uint nlf = 0) {
28  return new Node(idx, chld, c, r, nlf);
29  }
30 
31  static Node* child(const Node* nd) {return nd->child();}
32  static Node* link(const Node* nd) {return nd->link();}
33  static Node*& link(Node* nd) {return nd->link();}
34  };
35 
36  // **************************************************************** Tree02 **
37 
41  template<class CNode>
42  class Tree02 : public Tree<CNode> {
43  public:
46  typedef typename Traits::F F;
47 
52  Tree02(const concepts::Space<F>& spc, const BBall<F>& ball);
54 
56  inline uint nclst() const {return nclst_;}
58  inline uint nleaf() const {return nlf_;}
60  inline const CNode* root() const {return root_;}
61 
62  private:
64  uint nlf_;
66  uint nclst_;
68  CNode* root_;
69  };
70 
71 } // namespace cluster
72 
73 #endif // clusterTree02_hh
An abstract class for an element of a space.
Definition: exceptions.hh:15
static Node * link(const Node *nd)
Definition: tree02.hh:32
TreeTraits02< CNode > Traits
Interface of the tree.
Definition: tree02.hh:45
Abstract class for a space.
uint nleaf() const
Number of leafs.
Definition: tree02.hh:58
CNode * root_
First node of the cluster list.
Definition: tree02.hh:68
Tree02(const concepts::Space< F > &spc, const BBall< F > &ball)
Constructor.
uint nclst() const
Number of clusters.
Definition: tree02.hh:56
static Node * newNode(const concepts::Element< F > &elm, const BBall< F > &ball, Node *lnk)
Definition: tree02.hh:24
Cluster list, i.e., all leafs are on level 0.
Definition: tree02.hh:42
static Node * newNode(uint idx, Node &chld, const concepts::Real3d &c, concepts::Real r, uint nlf=0)
Definition: tree02.hh:26
Interface class for a node in a cluster tree.
Definition: tree.hh:252
TreeTraits< Node >::F F
Definition: tree02.hh:22
static Node *& link(Node *nd)
Definition: tree02.hh:33
Abstract class to compute a bounding ball of an element (the leafs of a cluster tree).
Definition: tree.hh:36
Node::CF F
Field of the node (Real or Cmplx)
Definition: tree.hh:255
const CNode * root() const
First node of the cluster list.
Definition: tree02.hh:60
Abstract class for a cluster tree.
Definition: tree.hh:274
Used for the cluster classes for the boundary element method.
Definition: cebysev.hh:13
Traits::F F
Definition: tree02.hh:46
static Node * child(const Node *nd)
Definition: tree02.hh:31
uint nlf_
Number of leafs in the tree.
Definition: tree02.hh:64
uint nclst_
Number of clusters in the tree.
Definition: tree02.hh:66
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Interface class for a node in the cluster tree Tree02.
Definition: tree02.hh:20
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich