X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=moebius2.git;a=blobdiff_plain;f=energy.c;h=a4cfbb1491221f90b4e454105e8e04473ed89f99;hp=c0090677b40f43c4cb09da43b36412741a06c63d;hb=cd84cbc4ca24530cfd110b53019706babc3986a5;hpb=fb621741c0f6d16a6c465585bf423452aad069ab diff --git a/energy.c b/energy.c index c009067..a4cfbb1 100644 --- a/energy.c +++ b/energy.c @@ -174,6 +174,8 @@ void compute_edge_lengths(const Vertices vertices, int section) { edge_lengths[v1][e]= hypotD(vertices[v1],vertices[v2]); } +#include + void compute_vertex_areas(const Vertices vertices, int section) { int v0,v1,v2, e1,e2; // int k; @@ -248,7 +250,24 @@ double line_bending_cost(const Vertices vertices, int section) { double a[D3], b[D3], axb[D3]; double total_cost= 0; + if (quitting_last_iteration) { + char buf[100]; + int n= sprintf(buf, + "section=%d thr=%#08lx qi=0x%03x START\n", + section,(unsigned long)pthread_self(), N); + write(2,buf,n); + quitting_reported_threads= 1; + } + FOR_EDGE(qi,e,ri, OUTER) { + if (quitting_last_iteration) { + char buf[100]; + int n= sprintf(buf, + "section=%d thr=%#08lx qi=0x%03x,e=%d,ri=0x%03x\n", + section,(unsigned long)pthread_self(),qi,e,ri); + write(2,buf,n); + } + pi= EDGE_END2(qi,(e+3)%V6); if (pi<0) continue; //if (!(qi&XMASK)) fprintf(stderr,"%02x-%02x-%02x (%d)\n",pi,qi,ri,e);