Go to the documentation of this file.00001
00004 #ifndef appRaduTree03_hh
00005 #define appRaduTree03_hh
00006
00007 #include "cluster/tree03.hh"
00008
00009
00010
00015 template<class Node>
00016 class CebyCenter3d {
00017 public:
00019 typedef cluster::TreeTraits03<Node> Traits;
00020 typedef typename Traits::F F;
00021
00025 inline CebyCenter3d(uint nvtx);
00026 inline ~CebyCenter3d() {delete[] vtx_;}
00027
00036 void operator()(const Node* lfset, concepts::Real3d& c, concepts::Real& r,
00037 const concepts::Real3d* (&e)[4], uint& ne);
00038
00039 private:
00040 static concepts::Real eps_;
00042 uint nvtx_;
00044 const concepts::Real3d** vtx_;
00046 __gnu_cxx::hash_map<uint, uint> vtxtag_;
00048 uint tag_;
00049 };
00050
00051 template<class Node>
00052 inline CebyCenter3d<Node>::CebyCenter3d(uint nvtx)
00053 : nvtx_(nvtx), vtxtag_(), tag_(0) {
00054 vtx_ = new const concepts::Real3d*[nvtx_];
00055 }
00056
00057
00058
00064 template<class CNode>
00065 class Tree3d03 : public cluster::Tree<CNode> {
00066 public:
00068 typedef cluster::TreeTraits03<CNode> Traits;
00069 typedef typename Traits::F F;
00070
00077 Tree3d03(const concepts::Space<F>& spc, const cluster::BBall<F>& ball,
00078 uint nlfmin = 1);
00079 inline ~Tree3d03() {destructor_(root_); delete root_;}
00080
00082 inline uint nclst() const {return nclst_;}
00084 inline uint nleaf() const {return nlf_;}
00086 inline const CNode* root() const {return root_;}
00087
00093 void sketch(std::ostream& os, const CNode* lnk = 0, uint l = 0);
00094
00095 private:
00097 uint nlfmin_;
00099 uint nlf_;
00101 uint nclst_;
00103 CNode* root_;
00104
00108 CNode* constructor_(CNode* lfset, CebyCenter3d<CNode>& cby);
00110 void destructor_(CNode* clst);
00112 CNode* concat_(CNode* a, CNode* b);
00113 };
00114
00115 #endif