checkpoint
[anneal.git] / src / edu / berkeley / qfat / Mesh.java
index 55052b9..74ccd4b 100644 (file)
@@ -186,19 +186,15 @@ public class Mesh implements Iterable<Mesh.T> {
         public void unApplyQuadricToNeighbor() {
             if (nearest_in_other_mesh == null) return;
             if (fundamentalQuadric == null) return;
-            nearest_in_other_mesh.unsc();
+            nearest_in_other_mesh.unComputeError();
             nearest_in_other_mesh.quadric = nearest_in_other_mesh.quadric.minus(fundamentalQuadric);
             nearest_in_other_mesh.quadric_count--;
             if (nearest_in_other_mesh.quadric_count==0)
                 nearest_in_other_mesh.quadric = Matrix.ZERO;
-            nearest_in_other_mesh.resc();
+            nearest_in_other_mesh.computeError();
             nearest_in_other_mesh = null;
         }
 
-        public void unsc() {
-            score -= oldscore;
-            oldscore = 0;
-        }
         public void applyQuadricToNeighbor() {
             if (score_against == null) return;
 
@@ -210,16 +206,24 @@ public class Mesh implements Iterable<Mesh.T> {
                 if (nearest_in_other_mesh.e == null || nearest_in_other_mesh.norm().dot(norm()) < 0) {
                     nearest_in_other_mesh = null;
                 } else {
-                    nearest_in_other_mesh.unsc();
+                    nearest_in_other_mesh.unComputeError();
                     nearest_in_other_mesh.quadric = nearest_in_other_mesh.quadric.plus(fundamentalQuadric());
                     nearest_in_other_mesh.quadric_count++;
-                    nearest_in_other_mesh.resc();
+                    nearest_in_other_mesh.computeError();
                 }
             }
-            unsc();
-            resc();
+            reComputeError();
+        }
+
+        public void reComputeError() {
+            unComputeError();
+            computeError();
+        }
+        public void unComputeError() {
+            score -= oldscore;
+            oldscore = 0;
         }
-        public void resc() {
+        public void computeError() {
             oldscore = quadric_count == 0 ? 0 : (quadric.preAndPostMultiply(p) / quadric_count);
             score += oldscore;
         }