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

luis at geodynamics.org luis at geodynamics.org
Wed Apr 2 03:24:47 PDT 2008


Author: luis
Date: 2008-04-02 03:24:47 -0700 (Wed, 02 Apr 2008)
New Revision: 11715

Modified:
   cs/benchmark/cigma/trunk/src/PointField.cpp
Log:
Oops. Fixed bad if-statement in PointField::eval()


Modified: cs/benchmark/cigma/trunk/src/PointField.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/PointField.cpp	2008-04-02 10:24:45 UTC (rev 11714)
+++ cs/benchmark/cigma/trunk/src/PointField.cpp	2008-04-02 10:24:47 UTC (rev 11715)
@@ -34,7 +34,7 @@
 
 bool PointField::eval(double *point, double *value)
 {
-    //* XXX: quick sanity check
+    /* XXX: quick sanity check
     static int checked = 0;
     if (!checked)
     {
@@ -48,19 +48,16 @@
 
     // Find index of closest point
     int n;
-    points->find_ann_index(point, &n);
-    
-    //assert(0 <= n);
-    //assert(n < points->n_points());
-    if ((0 <= n) || (n < points->n_points()))
+    bool found = points->find_ann_index(point, &n);
+
+    if (found && (0 <= n) && (n < points->n_points()))
     {
-        return false;
+        // Retrieve corresponding value
+        value = (*values)[n];
+        return true;
     }
 
-    // Retrieve corresponding value
-    value = (*values)[n];
-
-    return true;
+    return false;
 }
 
 // ---------------------------------------------------------------------------



More information about the cig-commits mailing list