[cig-commits] r11567 - cs/benchmark/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Wed Mar 26 03:27:57 PDT 2008


Author: luis
Date: 2008-03-26 03:27:57 -0700 (Wed, 26 Mar 2008)
New Revision: 11567

Modified:
   cs/benchmark/cigma/trunk/src/AnnLocator.cpp
   cs/benchmark/cigma/trunk/src/AnnLocator.h
Log:
Updates to AnnLocator.{h,cpp}


Modified: cs/benchmark/cigma/trunk/src/AnnLocator.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/AnnLocator.cpp	2008-03-26 10:27:56 UTC (rev 11566)
+++ cs/benchmark/cigma/trunk/src/AnnLocator.cpp	2008-03-26 10:27:57 UTC (rev 11567)
@@ -10,7 +10,7 @@
     epsilon = 0;
 
     npts = 0;
-    dim = 0;
+    ndim2 = 0;
 
     dataPoints = 0;
     kdtree = 0;
@@ -45,35 +45,35 @@
     assert(nnk > 0);
 
     npts = meshPart->nel;
-    nsd = meshPart->nsd;
-    dim = 2 * nsd;
+    ndim = meshPart->nsd;
+    ndim2 = ndim * 2;
     
     assert(npts > 0);
-    assert(nsd > 0);
+    assert(ndim > 0);
 
-    dataPoints = annAllocPts(npts, dim);
-    queryPoint = annAllocPt(dim);
+    dataPoints = annAllocPts(npts, ndim);
+    queryPoint = annAllocPt(ndim2);
 
     nnIdx = new ANNidx[nnk];
     nnDists = new ANNdist[nnk];
 
     int i,j;
-    double minpt[nsd];
-    double maxpt[nsd];
+    double minpt[ndim];
+    double maxpt[ndim];
 
     for (i = 0; i < npts; i++)
     {
         ANNpoint pt = dataPoints[i];
         meshPart->select_cell(i);
         meshPart->cell->bbox(minpt, maxpt);
-        for (j = 0; j < nsd; j++)
+        for (j = 0; j < ndim; j++)
         {
-            pt[nsd*0 + j] = minpt[j];
-            pt[nsd*1 + j] = maxpt[j];
+            pt[ndim*0 + j] = minpt[j];
+            pt[ndim*1 + j] = maxpt[j];
         }
     }
 
-    kdtree = new ANNkd_tree(dataPoints, npts, dim);
+    kdtree = new ANNkd_tree(dataPoints, npts, ndim2);
 
     locatorType = CELL_LOCATOR;
 }
@@ -86,21 +86,21 @@
     assert(nnk > 0);
 
     npts = points->n_points();
-    dim  = points->n_dim();
+    ndim = points->n_dim();
 
     assert(npts > 0);
-    assert(nsd > 0);
+    assert(ndim > 0);
 
     // XXX watch out for when you change the ANNpoint type to float
     assert(sizeof(ANNpoint) == sizeof(double));
 
     dataPoints = (ANNpointArray)(points->data);
-    queryPoint = annAllocPt(dim);
+    queryPoint = annAllocPt(ndim);
 
     nnIdx = new ANNidx[nnk];
     nnDists = new ANNdist[nnk];
 
-    kdtree = new ANNkd_tree(dataPoints, npts, dim);
+    kdtree = new ANNkd_tree(dataPoints, npts, ndim);
 
     locatorType = POINT_LOCATOR;
 }
@@ -108,12 +108,12 @@
 
 // ---------------------------------------------------------------------------
 
-void cigma::AnnLocator::search(double *globalPoint)
+void cigma::AnnLocator::search(double *point)
 {
-    for (int i = 0; i < nsd; i++)
+    for (int i = 0; i < ndim; i++)
     {
-        queryPoint[nsd*0 + i] = globalPoint[i];
-        queryPoint[nsd*1 + i] = globalPoint[i];
+        queryPoint[ndim*0 + i] = point[i];
+        queryPoint[ndim*1 + 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-03-26 10:27:56 UTC (rev 11566)
+++ cs/benchmark/cigma/trunk/src/AnnLocator.h	2008-03-26 10:27:57 UTC (rev 11567)
@@ -23,7 +23,7 @@
     void initialize(Points *points);
 
 public:
-    void search(double *globalPoint);
+    void search(double *point);
 
 public:
     int n_idx();
@@ -33,7 +33,7 @@
 public:
     int nnk;            // number of nearest neighbors
     int npts;           // number of points (bounding boxes)
-    int dim;            // dimension of bounding box (2 * nsd)
+    int ndim2;          // dimension of bounding box (ndim * 2)
     double epsilon;     // tolerance (in bbox space)
 
 public:



More information about the cig-commits mailing list