Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

cluster/tree02.hh
Go to the documentation of this file.
00001 /* Cluster tree 02
00002  */
00003 
00004 #ifndef clusterTree02_hh
00005 #define clusterTree02_hh
00006 
00007 #include "cluster/tree.hh"
00008 
00009 namespace cluster {
00010 
00011   // ********************************************************** TreeTraits02 **
00012 
00017   template<class Node>
00018   class TreeTraits02 : public TreeTraits<Node> {
00019   public:
00020     typedef typename TreeTraits<Node>::F F;
00021 
00022     static Node* newNode(const concepts::Element<F>& elm, const BBall<F>& ball,
00023        Node* lnk) {return new Node(elm, ball, lnk);}
00024     static Node* newNode(uint idx, Node& chld, const concepts::Real3d& c,
00025        concepts::Real r, uint nlf = 0) {
00026       return new Node(idx, chld, c, r, nlf);
00027     }
00028 
00029     static Node* child(const Node* nd) {return nd->child();}
00030     static Node* link(const Node* nd) {return nd->link();}
00031     static Node*& link(Node* nd) {return nd->link();}
00032   };
00033 
00034   // **************************************************************** Tree02 **
00035 
00039   template<class CNode>
00040   class Tree02 : public Tree<CNode> {
00041   public:
00043     typedef TreeTraits02<CNode> Traits;
00044     typedef typename Traits::F F;
00045 
00050     Tree02(const concepts::Space<F>& spc, const BBall<F>& ball);
00051     ~Tree02();
00052 
00054     inline uint nclst() const {return nclst_;}
00056     inline uint nleaf() const {return nlf_;}
00058     inline const CNode* root() const {return root_;}
00059 
00060   private:
00062     uint nlf_;
00064     uint nclst_;
00066     CNode* root_;
00067   };
00068 
00069 } // namespace cluster
00070 
00071 #endif // clusterTree02_hh

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)