[cig-commits] r11719 - cs/benchmark/cigma/trunk/src
luis at geodynamics.org
luis at geodynamics.org
Wed Apr 2 11:01:35 PDT 2008
Author: luis
Date: 2008-04-02 11:01:34 -0700 (Wed, 02 Apr 2008)
New Revision: 11719
Modified:
cs/benchmark/cigma/trunk/src/AnnLocator.cpp
cs/benchmark/cigma/trunk/src/AnnLocator.h
cs/benchmark/cigma/trunk/src/Locator.h
Log:
Split Locator's search() into search_bbox() and search_point()
Modified: cs/benchmark/cigma/trunk/src/AnnLocator.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/AnnLocator.cpp 2008-04-02 15:29:14 UTC (rev 11718)
+++ cs/benchmark/cigma/trunk/src/AnnLocator.cpp 2008-04-02 18:01:34 UTC (rev 11719)
@@ -98,7 +98,7 @@
assert(npts > 0);
assert(ndim > 0);
- // XXX watch out for when you change the ANNpoint type to floaT
+ // XXX: watch out for when you change the ANNpoint type to float
assert(sizeof(ANNcoord) == sizeof(double));
//dataPoints = (ANNpointArray)(points->data); // questionable cast..
@@ -127,7 +127,7 @@
// ---------------------------------------------------------------------------
-void AnnLocator::search(double *point)
+void AnnLocator::search_bbox(double *point)
{
for (int i = 0; i < ndim; i++)
{
@@ -138,5 +138,14 @@
kdtree->annkSearch(queryPoint, nnk, nnIdx, nnDists, epsilon);
}
+void AnnLocator::search_point(double *point)
+{
+ for (int i = 0; i < ndim; i++)
+ {
+ queryPoint[i] = point[i];
+ }
+ kdtree->annkSearch(queryPoint, nnk, nnIdx, nnDists, epsilon);
+}
+
// ---------------------------------------------------------------------------
Modified: cs/benchmark/cigma/trunk/src/AnnLocator.h
===================================================================
--- cs/benchmark/cigma/trunk/src/AnnLocator.h 2008-04-02 15:29:14 UTC (rev 11718)
+++ cs/benchmark/cigma/trunk/src/AnnLocator.h 2008-04-02 18:01:34 UTC (rev 11719)
@@ -23,7 +23,8 @@
void initialize(Points *points);
public:
- void search(double *point);
+ void search_bbox(double *point);
+ void search_point(double *point);
public:
int n_idx();
Modified: cs/benchmark/cigma/trunk/src/Locator.h
===================================================================
--- cs/benchmark/cigma/trunk/src/Locator.h 2008-04-02 15:29:14 UTC (rev 11718)
+++ cs/benchmark/cigma/trunk/src/Locator.h 2008-04-02 18:01:34 UTC (rev 11719)
@@ -22,7 +22,8 @@
virtual void initialize(Points *points) = 0;
public:
- virtual void search(double *point) = 0;
+ virtual void search_bbox(double *point) = 0;
+ virtual void search_point(double *point) = 0;
public:
virtual int n_idx() = 0;
More information about the cig-commits
mailing list