From: erg Date: Thu, 7 Dec 2006 22:49:37 +0000 (+0000) Subject: Re-do some .h files to limit exposure of internal values, .h files, X-Git-Tag: LAST_LIBGRAPH~32^2~5769 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f94df142e833fb0c84a3903df91af44cb1240be1;p=graphviz Re-do some .h files to limit exposure of internal values, .h files, and dependencies on config.h; return to a simple, concrete boolean type --- diff --git a/lib/neatogen/pca.c b/lib/neatogen/pca.c index 238d83a93..ba748cb34 100644 --- a/lib/neatogen/pca.c +++ b/lib/neatogen/pca.c @@ -58,7 +58,7 @@ PCA_alloc(DistType ** coords, int dim, int n, double **new_coords, } } - power_iteration(DD, dim, new_dim, eigs, evals, true); + power_iteration(DD, dim, new_dim, eigs, evals, TRUE); for (j = 0; j < new_dim; j++) { for (i = 0; i < n; i++) { @@ -78,7 +78,7 @@ PCA_alloc(DistType ** coords, int dim, int n, double **new_coords, free(DD); } -bool +boolean iterativePCA_1D(double **coords, int dim, int n, double *new_direction) { vtx_data *laplacian; @@ -102,7 +102,7 @@ iterativePCA_1D(double **coords, int dim, int n, double *new_direction) free(mat1); /* Compute direction */ - return power_iteration(mat, dim, 1, &new_direction, &eval, true); + return power_iteration(mat, dim, 1, &new_direction, &eval, TRUE); /* ?? When is mat freed? */ } diff --git a/lib/neatogen/pca.h b/lib/neatogen/pca.h index f4850f71c..4f97443d9 100644 --- a/lib/neatogen/pca.h +++ b/lib/neatogen/pca.h @@ -26,7 +26,7 @@ extern "C" { #include "defs.h" extern void PCA_alloc(DistType **, int, int, double **, int); - extern bool iterativePCA_1D(double **, int, int, double *); + extern boolean iterativePCA_1D(double **, int, int, double *); #endif diff --git a/lib/neatogen/quad_prog_solve.c b/lib/neatogen/quad_prog_solve.c index 0ae5654ec..a0e161e6d 100644 --- a/lib/neatogen/quad_prog_solve.c +++ b/lib/neatogen/quad_prog_solve.c @@ -124,7 +124,7 @@ constrained_majorization_new(CMajEnv * e, float *b, float **coords, int num_levels = e->num_levels; int i, j; float new_place_i; - bool converged = false; + boolean converged = FALSE; float upper_bound, lower_bound; int node; int left, right; @@ -186,7 +186,7 @@ constrained_majorization_new(CMajEnv * e, float *b, float **coords, } for (counter = 0; counter < max_iterations && !converged; counter++) { - converged = true; + converged = TRUE; lower_bound = -1e9; /* no lower bound for first level */ for (left = 0; left < n; left = right) { int best_i; @@ -435,7 +435,7 @@ int constrained_majorization_gradient_projection(CMajEnv * e, int *ordering = e->ordering; int *levels = e->levels; int num_levels = e->num_levels; - bool converged = false; + boolean converged = FALSE; float *g = e->fArray1; float *old_place = e->fArray2; float *d = e->fArray4; @@ -462,7 +462,7 @@ int constrained_majorization_gradient_projection(CMajEnv * e, for (counter = 0; counter < max_iterations && !converged; counter++) { float alpha; float numerator = 0, denominator = 0, r; - converged = true; + converged = TRUE; /* find steepest descent direction */ for (i = 0; i < e->n; i++) { old_place[i] = place[i]; @@ -506,9 +506,9 @@ int constrained_majorization_gradient_projection(CMajEnv * e, e->lev[u]), w = 2; float avgPos = sum / w; float pos; - bool finished; + boolean finished; do { - finished = true; + finished = TRUE; if (ui < endOfLevel) { u = ordering[ui]; pos = place[u] - levels_gap * e->lev[u]; @@ -517,7 +517,7 @@ int constrained_majorization_gradient_projection(CMajEnv * e, w++; sum += pos; avgPos = sum / w; - finished = false; + finished = FALSE; } } @@ -529,7 +529,7 @@ int constrained_majorization_gradient_projection(CMajEnv * e, w++; sum += pos; avgPos = sum / w; - finished = false; + finished = FALSE; } } } while (!finished); @@ -593,7 +593,7 @@ int constrained_majorization_gradient_projection(CMajEnv * e, prev_stress = stress; #endif if (test > quad_prog_tol) { - converged = false; + converged = FALSE; } } #ifdef CONMAJ_LOGGING @@ -619,7 +619,7 @@ constrained_majorization_new_with_gaps(CMajEnv * e, float *b, int *levels = e->levels; int num_levels = e->num_levels; float new_place_i; - bool converged = false; + boolean converged = FALSE; float upper_bound, lower_bound; int node; int left, right; @@ -679,7 +679,7 @@ constrained_majorization_new_with_gaps(CMajEnv * e, float *b, gap = e->fArray4; for (counter = 0; counter < max_iterations && !converged; counter++) { - converged = true; + converged = TRUE; lower_bound = -1e9; /* no lower bound for first level */ for (left = 0; left < n; left = right) { int best_i;