fprintf(fp,"}]\n");
}
-void pedge_print(char *comments, pedge e){
+#ifdef DEBUG
+static void pedge_print(char *comments, pedge e){
int i, j, dim;
dim = e->dim;
fprintf(stderr,"%s", comments);
}
fprintf(stderr,"\n");
}
+#endif
pedge pedge_realloc(pedge e, int n){
if (n <= e->npoints) return e;
}
step = step*0.9;
+ if (Verbose)
fprintf(stderr, "iter ==== %d cpu = %f npoints = %d\n",iter, ((real) (clock() - start))/CLOCKS_PER_SEC, np - 2);
#ifdef OPENGL
-pedge* modularity_ink_bundling(int dim, int ne, SparseMatrix B, pedge* edges, real angle_param, real angle){
+static pedge* modularity_ink_bundling(int dim, int ne, SparseMatrix B, pedge* edges, real angle_param, real angle){
int *assignment = NULL, flag, nclusters;
real modularity;
int *clusterp, *clusters;
clusters = D->ja;
for (i = 0; i < nclusters; i++){
ink1 = ink(edges, clusterp[i+1] - clusterp[i], &(clusters[clusterp[i]]), &ink0, &meet1, &meet2, angle_param, angle);
- fprintf(stderr,"nedges = %d ink0 = %f, ink1 = %f\n",clusterp[i+1] - clusterp[i], ink0, ink1);
+ if (Verbose)
+ fprintf(stderr,"nedges = %d ink0 = %f, ink1 = %f\n",clusterp[i+1] - clusterp[i], ink0, ink1);
if (ink1 < ink0){
for (j = clusterp[i]; j < clusterp[i+1]; j++){
/* make this edge 5 points, insert two meeting points at 1 and 2, make 3 the last point */
//SparseMatrix_print("C",C);
SparseMatrix_delete(B);
B = C;
- fprintf(stderr, "edge compatibilitu time = %f\n",((real) (clock() - start))/CLOCKS_PER_SEC);
+ if (Verbose)
+ fprintf(stderr, "edge compatibilitu time = %f\n",((real) (clock() - start))/CLOCKS_PER_SEC);
return B;
}
double ink_count;
-point_t addPoint (point_t a, point_t b)
+static point_t addPoint (point_t a, point_t b)
{
a.x += b.x;
a.y += b.y;
return a;
}
-point_t subPoint (point_t a, point_t b)
+static point_t subPoint (point_t a, point_t b)
{
a.x -= b.x;
a.y -= b.y;
return a;
}
-point_t scalePoint (point_t a, double d)
+static point_t scalePoint (point_t a, double d)
{
a.x *= d;
a.y *= d;
return a;
}
-double dotPoint(point_t a, point_t b){
+static double dotPoint(point_t a, point_t b){
return a.x*b.x + a.y*b.y;
}
/* sumLengths:
*/
-double sumLengths_avoid_bad_angle(point_t* points, int npoints, point_t end, point_t meeting, real angle_param)
+static double sumLengths_avoid_bad_angle(point_t* points, int npoints, point_t end, point_t meeting, real angle_param)
{
/* avoid sharp turns, we want cos_theta to be as close to -1 as possible */
int i;
// distance of single line from 'meeting' to 'end'
return sum*(cos_max + angle_param);/* straight line gives angle_param - 1, turning angle of 180 degree gives angle_param + 1 */
}
-double sumLengths(point_t* points, int npoints, point_t end, point_t meeting)
+static double sumLengths(point_t* points, int npoints, point_t end, point_t meeting)
{
int i;
double sum = 0;
/* bestInk:
*/
-double bestInk(point_t* points, int npoints, point_t begin, point_t end, double prec, point_t *meet, real angle_param)
+static double bestInk(point_t* points, int npoints, point_t begin, point_t end, double prec, point_t *meet, real angle_param)
{
point_t first, second, third, fourth, diff, meeting;
double value1, value2, value3, value4;