chiark / gitweb /
improvements?
authorIan Jackson <ian@davenant.relativity.greenend.org.uk>
Fri, 4 Jan 2008 01:32:24 +0000 (01:32 +0000)
committerIan Jackson <ian@davenant.relativity.greenend.org.uk>
Fri, 4 Jan 2008 01:32:24 +0000 (01:32 +0000)
energy.c
graph.c

index 73308ac842bd3fcddb581ce1164b0a852e9a84a1..867330cbf2da74a6293cdf55c58ba58edffc77af 100644 (file)
--- a/energy.c
+++ b/energy.c
@@ -38,9 +38,9 @@ static double compute_energy(const Vertices vertices) {
 
   if (printing) printf("cost > energy |");
 
 
   if (printing) printf("cost > energy |");
 
-//  COST(1e4, edgewise_vertex_displacement_cost(vertices));
-  COST(1e2, graph_layout_cost(vertices,vertex_areas));
-//  COST(1e4, noncircular_rim_cost(vertices));
+  COST(1e2, edgewise_vertex_displacement_cost(vertices));
+//  COST(1e0, graph_layout_cost(vertices,vertex_areas));
+  COST(1e4, noncircular_rim_cost(vertices));
 
   if (printing) printf("| total %# e |", energy);
 
 
   if (printing) printf("| total %# e |", energy);
 
diff --git a/graph.c b/graph.c
index c9cdd2cd773670cbeaef05d846c02b1f88a8a123..31e317d363112027ef1eae6b7405c50cab299218 100644 (file)
--- a/graph.c
+++ b/graph.c
@@ -69,7 +69,6 @@ double graph_layout_cost(const Vertices v, const double vertex_areas[N]) {
    */
   //static const double d2_epsilon= 1e-6;
 
    */
   //static const double d2_epsilon= 1e-6;
 
-  //  double edge_weights[V6<<ESHIFT], vertex_distances[N],
   double total_cost=0;
   int v1,v2,e, nedges=0;
   double totaledgelength=0, meanedgelength, meanedgelength2;
   double total_cost=0;
   int v1,v2,e, nedges=0;
   double totaledgelength=0, meanedgelength, meanedgelength2;
@@ -101,11 +100,6 @@ double graph_layout_cost(const Vertices v, const double vertex_areas[N]) {
 
       double cost= pow(d2/s2, beta_prime);
       
 
       double cost= pow(d2/s2, beta_prime);
       
-      //double s2= s*s + d2_epsilon;
-      //double sd2= s2 / d2;
-      //double cost_contrib= a1*a2 * (sd2 - 1) / (d2*d2);
-      //double cost_contrib= sd2;
-
       //printf("layout %03x..%03x dist^2=%d s^2=%g d^2=%g "
               //" cost+=%g\n", v1,v2, dist2,
               //            s2,d2, cost);
       //printf("layout %03x..%03x dist^2=%d s^2=%g d^2=%g "
               //" cost+=%g\n", v1,v2, dist2,
               //            s2,d2, cost);