chiark / gitweb /
tuning
authorIan Jackson <ian@davenant.relativity.greenend.org.uk>
Fri, 4 Jan 2008 19:21:31 +0000 (19:21 +0000)
committerIan Jackson <ian@davenant.relativity.greenend.org.uk>
Fri, 4 Jan 2008 19:21:31 +0000 (19:21 +0000)
energy.c
mgraph.h

index b53199e2555bf8d28be3c258ad5ddcf4a6da71a4..78b8f31ff44be4942efb40cb91f61d21718217b2 100644 (file)
--- a/energy.c
+++ b/energy.c
@@ -39,7 +39,7 @@ static double compute_energy(const Vertices vertices) {
   if (printing) printf("cost > energy |");
 
   COST(1e2, edgewise_vertex_displacement_cost(vertices));
   if (printing) printf("cost > energy |");
 
   COST(1e2, edgewise_vertex_displacement_cost(vertices));
-//  COST(1e0, graph_layout_cost(vertices,vertex_areas));
+  COST(1e2, graph_layout_cost(vertices,vertex_areas));
 //  COST(1e4, noncircular_rim_cost(vertices));
 
   if (printing) printf("| total %# e |", energy);
 //  COST(1e4, noncircular_rim_cost(vertices));
 
   if (printing) printf("| total %# e |", energy);
@@ -124,7 +124,7 @@ static void compute_vertex_areas(const Vertices vertices, double areas[N]) {
 
 static gsl_multimin_fminimizer *minimiser;
 
 
 static gsl_multimin_fminimizer *minimiser;
 
-static const double stop_epsilon= 1e-4;
+static const double stop_epsilon= 1e-6;
 
 static double minfunc_f(const gsl_vector *x, void *params) {
   assert(x->size == DIM);
 
 static double minfunc_f(const gsl_vector *x, void *params) {
   assert(x->size == DIM);
@@ -258,7 +258,7 @@ double edgewise_vertex_displacement_cost(const Vertices vertices) {
     double cost= pow(delta,3);
 
     if (!e && !(qi & YMASK))
     double cost= pow(delta,3);
 
     if (!e && !(qi & YMASK))
-      cost *= 1e3;
+      cost *= 10;
 
     total_cost += cost;
   }
 
     total_cost += cost;
   }
index 19cd60137c624b16ff62148643e42303510cfc40..eb4bd129fb990bb650d1da0605e780e1a13680af 100644 (file)
--- a/mgraph.h
+++ b/mgraph.h
@@ -62,7 +62,7 @@
 
 #include "common.h"
 
 
 #include "common.h"
 
-#define XBITS 4
+#define XBITS 3
 #define X (1<<XBITS)
 #define YBITS 3
 #define Y ((1<<YBITS) - 1)
 #define X (1<<XBITS)
 #define YBITS 3
 #define Y ((1<<YBITS) - 1)