chiark / gitweb /
stopping point for 64
[moebius2.git] / energy.c
index f6a4c290c5883d2c04ef0b9150717cc991f409b6..308aebfa3f890aea945bafc0aa38fc1feb18f9c8 100644 (file)
--- a/energy.c
+++ b/energy.c
@@ -46,6 +46,20 @@ static const CostContribution costs[]= {
 #endif
 
 #if XBITS==4
+#define STOP_EPSILON 1.2e-4
+    COST(  3e5,   line_bending_cost)
+    COST( 10e3,   edge_length_variation_cost)
+    COST( 9.0e3,  rim_proximity_cost) // 5e1 is too much
+                                     // 2.5e1 is too little
+    // 0.2e1 grows compared to previous ?
+    // 0.6e0 shrinks compared to previous ?
+
+//    COST(  1e12,   edge_angle_cost)
+                  #define EDGE_ANGLE_COST_CIRCCIRCRAT (0.5/1.3)
+    COST(  1e18,   noncircular_rim_cost)
+#endif
+
+#if XBITS>=5 /* nonsense follows but never mind */
 #define STOP_EPSILON 1e-6
     COST(  3e5,   line_bending_cost)
     COST( 10e2,   edge_length_variation_cost)
@@ -75,7 +89,7 @@ void compute_energy_separately(const struct Vertices *vs,
   int ci;
   
   for (ci=0; ci<NPRECOMPS; ci++) {
-    costs[ci].fn(vs->a, section);
+    precomps[ci](vs->a, section);
     inparallel_barrier();
   }
   for (ci=0; ci<NCOSTS; ci++)