printf("cost > energy |");
COST(1e4, edgewise_vertex_displacement_cost(vertices));
-// COST(1e2, graph_layout_cost(vertices,vertex_areas));
+ COST(1e2, graph_layout_cost(vertices,vertex_areas));
// COST(1e4, noncircular_rim_cost(vertices));
printf("| total %# e |", energy);
*/
double edgewise_vertex_displacement_cost(const Vertices vertices) {
- static const double /*d_epsilon= 1e-6,*/ axb_epsilon= 1e-6;
+ static const double axb_epsilon= 1e-6;
int pi,e,qi,ri,si, k;
double m[D3], a[D3], b[D3], axb[D3];
xprod(axb,a,b);
- double l= 1; //hypotD(vertices[pi], vertices[qi]);
- double d= 1; //hypotD(vertices[ri], vertices[si]) + d_epsilon;
double delta= atan2(magnD(axb) + axb_epsilon, dotprod(a,b));
-
- double cost= l * delta * delta / d;
-
+ double cost= delta * delta;
total_cost += cost;
}
return total_cost;