24 template<
class o2mNode>
27 static o2mNode* child(
const o2mNode* nd, uint j) {
return nd->child(j);}
32 template<
class o2mNode>
35 template<
class o2mNode>
36 inline std::ostream& operator<<(std::ostream& os,
41 template<
class o2mNode>
44 friend std::ostream& operator<< <>(std::ostream& os,
56 virtual const o2mNode*
root()
const = 0;
61 virtual std::ostream&
info(std::ostream& os)
const;
66 void sketch(std::ostream& os,
const o2mNode* rt = 0, uint l = 0)
const;
77 static Node*
lft(
const Node* nd) {
return nd->lft();}
78 static Node*&
lft(Node* nd) {
return nd->lft();}
80 static Node*
rght(
const Node* nd) {
return nd->rght();}
87 template<
class biNode>
94 virtual const biNode*
root()
const = 0;
101 template<
class BiClNode>
111 return new BiClNode(elm, ball,
lft);
117 return new BiClNode(idx,
lft,
rght, c, r, nlf);
127 inline std::ostream& operator<<(std::ostream& os,
const BiClNode00<F>& nd) {
128 os <<
"aglowav::BiClNode00(idx = " << nd.
index()
129 <<
", nleaf = " << nd.
nleaf();
130 return os <<
", r = " << nd.
radius() <<
", c = " << nd.
center() <<
')';
138 friend std::ostream& operator<< <> (std::ostream& os,
BiClNode00(uint idx, BiClNode00< F > &lft, BiClNode00< F > &rght, const concepts::Real3d &c, concepts::Real r, uint nleaf=0)
BiClNode00< F > * child(uint j) const
j-th child of the node
const concepts::Real3d & center() const
Cluster center.
F CF
Type of element (Real || Cmplx)
BiClNode00< F > * lft() const
Left child of the node.
uint nleaf() const
Number of leafs in the subtree of the node.
BiClNode00(const concepts::Element< F > &elm, const cluster::BBall< F > &ball, BiClNode00< F > *lft)
concepts::Real radius() const
Cluster radius.
const bem::Constant3d001< F > * element() const
Element of the node.
BiClNode00< F > * rght() const
Right child of the node.
uint index() const
Cluster number.
static Node * lft(const Node *nd)
Left node.
static Node * rght(const Node *nd)
Right node.
virtual const biNode * root() const =0
Root of the tree.
BiTreeTraits< biNode > Traits
How a Node has to behave.
cluster::TreeTraits< BiClNode >::F F
Type of element (Real || Cmplx)
static BiClNode * newNode(uint idx, BiClNode &lft, BiClNode &rght, const concepts::Real3d &c, concepts::Real r, uint nlf=0)
Constructor of a new node (no leaf)
static BiClNode * newNode(const concepts::Element< F > &elm, const cluster::BBall< F > &ball, BiClNode *lft)
Constructor of a new leaf list (next leaf = left child)
virtual ~One2ManyTree()
Virtual destructor.
One2ManyTreeTraits< o2mNode > Traits
How a Node has to behave.
virtual const o2mNode * root() const =0
Root of the tree.
virtual uint nleaf() const =0
Number of leafs.
virtual std::ostream & info(std::ostream &os) const
Information about the tree.
void sketch(std::ostream &os, const o2mNode *rt=0, uint l=0) const
Node::CF F
Field of the node (Real or Cmplx)