From: Matthew Fernandez Date: Thu, 16 Sep 2021 04:21:12 +0000 (-0700) Subject: stress_majorization_kD_mkernel: replace a boolean with a C99 bool X-Git-Tag: 2.49.1~9^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e4ac79df779c6b26b50894d75a07f60392e93fc;p=graphviz stress_majorization_kD_mkernel: replace a boolean with a C99 bool And reflow some text. --- diff --git a/lib/neatogen/stress.c b/lib/neatogen/stress.c index e33602016..d0d6c4e81 100644 --- a/lib/neatogen/stress.c +++ b/lib/neatogen/stress.c @@ -901,7 +901,7 @@ int stress_majorization_kD_mkernel(vtx_data * graph, /* Input graph in sparse re int step; float val; double old_stress, new_stress; - boolean converged; + bool converged; float **b = NULL; float *tmp_coords = NULL; float *dist_accumulator = NULL; @@ -1128,7 +1128,7 @@ int stress_majorization_kD_mkernel(vtx_data * graph, /* Input graph in sparse re start_timer(); } - for (converged = FALSE, iterations = 0; + for (converged = false, iterations = 0; iterations < maxi && !converged; iterations++) { /* First, construct Laplacian of 1/(d_ij*|p_i-p_j|) */ @@ -1237,8 +1237,7 @@ int stress_majorization_kD_mkernel(vtx_data * graph, /* Input graph in sparse re { double diff = old_stress - new_stress; double change = fabs(diff); - converged = (((change / old_stress) < Epsilon) - || (new_stress < Epsilon)); + converged = change / old_stress < Epsilon || new_stress < Epsilon; } old_stress = new_stress;