From f97bd9d5966f520dceb4370bee2d2fd02288452c Mon Sep 17 00:00:00 2001 From: vasiloglou Date: Fri, 4 May 2007 23:03:14 +0000 Subject: [PATCH] compiled --- fastlib/u/nvasil/tree/.binary_tree.h.swp | Bin 16384 -> 16384 bytes fastlib/u/nvasil/tree/binary_tree.h | 6 +++--- fastlib/u/nvasil/tree/binary_tree.h~ | 6 +++--- fastlib/u/nvasil/tree/binary_tree_impl.h | 12 ++++++------ fastlib/u/nvasil/tree/binary_tree_impl.h~ | 12 ++++++------ fastlib/u/nvasil/tree/binary_tree_unit.cc | 2 +- fastlib/u/nvasil/tree/binary_tree_unit.cc~ | 2 +- fastlib/u/nvasil/tree/node.h | 2 +- fastlib/u/nvasil/tree/node.h~ | 2 +- fastlib/u/nvasil/tree/node_impl.h | 6 +++--- fastlib/u/nvasil/tree/node_impl.h~ | 8 ++++---- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/fastlib/u/nvasil/tree/.binary_tree.h.swp b/fastlib/u/nvasil/tree/.binary_tree.h.swp index 2f8a077d0c2bc6485014cc1d1912961222d37f49..eeaf822662bd4f208ff225fa6ea7c9728b956d1c 100644 GIT binary patch delta 370 zcmW;IFGvGn7{~GFo%hb2={R95>3QHlg>fJgESq5lgVh5?!?GB33uBC369f&rG%y-O z1(6pq92hJX{{(FsOo9V(OfdV^2R`sT<;U|pQKX_sxz%80Y1x}A%nId*bdw8rFs^;3 zp0T~MYTuh(J5h=^%dW}!hnAX-FY}YBX3MDuiPw%FOWp3f(Hirj-=tLZd;4n-uSmi)b&}cAtGfdcB6a)>|#A*-~ zlv^+i3xOlasChAzjDhAQ+m5va=M-C}`_efowp@9{Qqhq9Z zqxh~c8*f&!i92*`882>n!)7LV_C_4r;cG2+O6~B`kk1AYz(0gkut4o#(9HNH6PK-5RCBf9Lm2{`msXxJ6 BKf(Y2 diff --git a/fastlib/u/nvasil/tree/binary_tree.h b/fastlib/u/nvasil/tree/binary_tree.h index 8c8a177700..c03e2be598 100644 --- a/fastlib/u/nvasil/tree/binary_tree.h +++ b/fastlib/u/nvasil/tree/binary_tree.h @@ -74,9 +74,9 @@ class BinaryTree { Result_t *ptr_; index_t num_; }; - BinaryTree(); + BinaryTree(){} ~BinaryTree(); - void Init(BinaryDataset &data); + void Init(BinaryDataset *data); void Destruct() {} // Call this function to build Depth first a tree void BuildDepthFirst(); @@ -153,7 +153,7 @@ class BinaryTree { // Parent/Root NodePtr_t parent_; // Source of data - BinaryDataset data_; + BinaryDataset *data_; // Total number of points on the tree index_t num_of_points_; // Number of Leafs on the tree diff --git a/fastlib/u/nvasil/tree/binary_tree.h~ b/fastlib/u/nvasil/tree/binary_tree.h~ index 474f76a341..6d29f4afdc 100644 --- a/fastlib/u/nvasil/tree/binary_tree.h~ +++ b/fastlib/u/nvasil/tree/binary_tree.h~ @@ -76,7 +76,7 @@ class BinaryTree { }; BinaryTree(); ~BinaryTree(); - void Init(BinaryDataset &data); + void Init(BinaryDataset *data); void Destruct() {} // Call this function to build Depth first a tree void BuildDepthFirst(); @@ -87,7 +87,7 @@ class BinaryTree { // Builds tree k depth first. It builds all the subtrees depth first up to k level void BuildKDepthFirst(); template - void NearestNeighbor(POINTTYPE &test_point, + void NearestNeighbor(POINTTYPE test_point, vector > *nearest_point, NEIGHBORTYPE range); @@ -153,7 +153,7 @@ class BinaryTree { // Parent/Root NodePtr_t parent_; // Source of data - BinaryDataset data_; + BinaryDataset *data_; // Total number of points on the tree index_t num_of_points_; // Number of Leafs on the tree diff --git a/fastlib/u/nvasil/tree/binary_tree_impl.h b/fastlib/u/nvasil/tree/binary_tree_impl.h index 6d877d2ed6..8538bb8c1d 100644 --- a/fastlib/u/nvasil/tree/binary_tree_impl.h +++ b/fastlib/u/nvasil/tree/binary_tree_impl.h @@ -10,10 +10,10 @@ template // traits_nearest_neighbor.h file TEMPLATE__ -void TREE__::Init(BinaryDataset &data) { +void TREE__::Init(BinaryDataset *data) { data_ = data; - dimension_ = data.get_dimension(); - num_of_points_ = data.get_num_of_points(); + dimension_ = data->get_dimension(); + num_of_points_ = data->get_num_of_points(); node_id_=0; num_of_leafs_=0; current_level_=0; @@ -89,7 +89,7 @@ void TREE__::BuildBreadthFirst( fifo_pair.second->start_, fifo_pair.second->num_of_points_, dimension_, - &data_); + data_); num_of_leafs_++; node_id_++; @@ -144,7 +144,7 @@ void TREE__::BuildDepthFirst(typename TREE__::NodePtr_t &ptr, pivot_pair.second->start_, pivot_pair.second->num_of_points_, dimension_, - &data_); + data_); node_id_++; num_of_leafs_++; @@ -176,7 +176,7 @@ void TREE__::BuildDepthFirst(typename TREE__::NodePtr_t &ptr, pivot_info->start_, pivot_info->num_of_points_, dimension_, - &data_); + data_); node_id_++; num_of_leafs_++; diff --git a/fastlib/u/nvasil/tree/binary_tree_impl.h~ b/fastlib/u/nvasil/tree/binary_tree_impl.h~ index c485858411..5ec34abe6b 100644 --- a/fastlib/u/nvasil/tree/binary_tree_impl.h~ +++ b/fastlib/u/nvasil/tree/binary_tree_impl.h~ @@ -10,7 +10,7 @@ template // traits_nearest_neighbor.h file TEMPLATE__ -void TREE__::Init(BinaryDataset &data) { +void TREE__::Init(BinaryDataset *data) { data_ = data; dimension_ = data.get_dimension(); num_of_points_ = data.get_num_of_points(); @@ -89,7 +89,7 @@ void TREE__::BuildBreadthFirst( fifo_pair.second->start_, fifo_pair.second->num_of_points_, dimension_, - &data_); + data_); num_of_leafs_++; node_id_++; @@ -144,7 +144,7 @@ void TREE__::BuildDepthFirst(typename TREE__::NodePtr_t &ptr, pivot_pair.second->start_, pivot_pair.second->num_of_points_, dimension_, - &data_); + data_); node_id_++; num_of_leafs_++; @@ -176,7 +176,7 @@ void TREE__::BuildDepthFirst(typename TREE__::NodePtr_t &ptr, pivot_info->start_, pivot_info->num_of_points_, dimension_, - &data_); + data_); node_id_++; num_of_leafs_++; @@ -347,8 +347,8 @@ void TREE__::AllNearestNeighbors(typename TREE__::NodePtr_t query, range, closest_child.second.second); query->set_min_dist_so_far( - min(query->get_min_dist_so_far(), - max(query->get_left()->get_min_dist_so_far(), + std::min(query->get_min_dist_so_far(), + std::max(query->get_left()->get_min_dist_so_far(), query->get_right()->get_min_dist_so_far()))); } diff --git a/fastlib/u/nvasil/tree/binary_tree_unit.cc b/fastlib/u/nvasil/tree/binary_tree_unit.cc index 34d39771f8..26a2da5677 100644 --- a/fastlib/u/nvasil/tree/binary_tree_unit.cc +++ b/fastlib/u/nvasil/tree/binary_tree_unit.cc @@ -62,7 +62,7 @@ class BinaryTreeTest { } data_.set_id(i,i); } - tree_.Init(data_); + tree_.Init(&data_); } void Destruct() { tree_.Destruct(); diff --git a/fastlib/u/nvasil/tree/binary_tree_unit.cc~ b/fastlib/u/nvasil/tree/binary_tree_unit.cc~ index f48ab44a29..34d39771f8 100644 --- a/fastlib/u/nvasil/tree/binary_tree_unit.cc~ +++ b/fastlib/u/nvasil/tree/binary_tree_unit.cc~ @@ -104,7 +104,7 @@ class BinaryTreeTest { &nearest_tree, range_); Naive(i, nearest_naive); - for(index_t j=0; j::epsilon()); diff --git a/fastlib/u/nvasil/tree/node.h b/fastlib/u/nvasil/tree/node.h index c3089d6902..bf2cf58c92 100644 --- a/fastlib/u/nvasil/tree/node.h +++ b/fastlib/u/nvasil/tree/node.h @@ -152,7 +152,7 @@ class Node { NodePtr_t right_; typename Allocator_t::template ArrayPtr index_; typename Allocator_t::template ArrayPtr points_; - typename Allocator_t::template Ptr statistics_; + NodeCachedStatistics_t statistics_; index_t num_of_points_; union { NNResult *kneighbors_; diff --git a/fastlib/u/nvasil/tree/node.h~ b/fastlib/u/nvasil/tree/node.h~ index bc426c796b..c3089d6902 100644 --- a/fastlib/u/nvasil/tree/node.h~ +++ b/fastlib/u/nvasil/tree/node.h~ @@ -19,7 +19,7 @@ class Node { typedef typename TYPELIST::Metric_t Metric_t; typedef typename TYPELIST::BoundingBox_t BoundingBox_t; typedef typename TYPELIST::NodeCachedStatistics_t NodeCachedStatistics_t; - typedef typename TYPELIST::PointIdDescriminator_t PointIdDiscriminator_t; + typedef typename TYPELIST::PointIdDiscriminator_t PointIdDiscriminator_t; typedef typename Allocator_t::template ArrayPtr Array_t; typedef Node Node_t; typedef typename Allocator_t::template Ptr NodePtr_t; diff --git a/fastlib/u/nvasil/tree/node_impl.h b/fastlib/u/nvasil/tree/node_impl.h index d1366a9526..eb6d740018 100644 --- a/fastlib/u/nvasil/tree/node_impl.h +++ b/fastlib/u/nvasil/tree/node_impl.h @@ -22,8 +22,8 @@ void NODE__::Init(const BoundingBox_t &box, const NodeCachedStatistics_t &statistics, index_t node_id, index_t num_of_points) { - box_=box; - statistics_=statistics; + box_.Alias(box); + statistics_.Alias(statistics); node_id_ = node_id; num_of_points_ = num_of_points; } @@ -37,7 +37,7 @@ void NODE__::Init(const typename NODE__::BoundingBox_t &box, int32 dimension, BinaryDataset *dataset) { box_.Alias(box); - statistics_->Alias(statistics); + statistics_.Alias(statistics); node_id_ = node_id; num_of_points_ = num_of_points; points_.Reset(Allocator_t::template malloc diff --git a/fastlib/u/nvasil/tree/node_impl.h~ b/fastlib/u/nvasil/tree/node_impl.h~ index 336df455ca..200263fbdb 100644 --- a/fastlib/u/nvasil/tree/node_impl.h~ +++ b/fastlib/u/nvasil/tree/node_impl.h~ @@ -22,8 +22,8 @@ void NODE__::Init(const BoundingBox_t &box, const NodeCachedStatistics_t &statistics, index_t node_id, index_t num_of_points) { - box_=box; - statistics_=statistics; + box_.Alias(box); + statistics_.Alias(statistics); node_id_ = node_id; num_of_points_ = num_of_points; } @@ -195,8 +195,8 @@ inline void NODE__::FindAllNearest( ==temp[j].second.get_id()) { break; } - query_node->kneighbors_[i*range+j].distance_=temp[j].first; - query_node->kneighbors_[i*range+j].nearest_=temp[j].second; + query_node->kneighbors_[i*(index_t)range+j].distance_=temp[j].first; + query_node->kneighbors_[i*(index_t)range+j].nearest_=temp[j].second; } // Estimate the maximum nearest neighbor distance comp.UpdateComparisons();