]> granicus.if.org Git - graphviz/commitdiff
conjugate_gradient_f: [nfc] take a C99 bool parameter instead of a boolean
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 5 Dec 2021 19:33:41 +0000 (11:33 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 11 Dec 2021 17:20:37 +0000 (09:20 -0800)
lib/neatogen/conjgrad.c
lib/neatogen/conjgrad.h
lib/neatogen/smart_ini_x.c
lib/neatogen/stress.c

index 92107ebc356a7f5fc4baf3d21f9cc4208346fd1a..99b237ac186e4bae28f7f19c4e7c4edc1e62af8c 100644 (file)
@@ -12,6 +12,7 @@
 #include <neatogen/matrix_ops.h>
 #include <neatogen/conjgrad.h>
 /* #include <math.h> */
+#include <stdbool.h>
 #include <stdlib.h>
 
 
@@ -94,7 +95,7 @@ cleanup0 :
 
 int conjugate_gradient_f
     (float **A, double *x, double *b, int n, double tol,
-     int max_iterations, boolean ortho1) {
+     int max_iterations, bool ortho1) {
     /* Solves Ax=b using Conjugate-Gradients method */
     /* 'x' and 'b' are orthogonalized against 1 if 'ortho1=true' */
 
index 6c1e679aab34764631e87f9371ef1258e9c80409..f71918072f9c2df956167a4c698a5f82078ab81f 100644 (file)
@@ -15,6 +15,7 @@ extern "C" {
 #endif
 
 #include <neatogen/defs.h>
+#include <stdbool.h>
 
 /*************************
  * C.G. method - SPARSE  *
@@ -28,7 +29,7 @@ extern "C" {
  ************************/
 
     extern int conjugate_gradient_f(float **, double *, double *, int,
-                                    double, int, boolean);
+                                    double, int, bool);
 
     extern int conjugate_gradient_mkernel(float *, float *, float *, int,
                                           double, int);
index 6e8a516f221eba0c5bf4d834d7378cb3204d6e2c..16cff6387ba1d2ed905e213393de3cb370e7244e 100644 (file)
@@ -13,6 +13,7 @@
 #include <neatogen/kkutils.h>
 #include <neatogen/matrix_ops.h>
 #include <neatogen/conjgrad.h>
+#include <stdbool.h>
 
 static void
 standardize(double* orthog, int nvtxs) 
@@ -343,7 +344,7 @@ int IMDS_given_dim(vtx_data* graph, int n, double* given_coords,
        }
 
        for (converged=FALSE,iterations2=0; iterations2<200 && !converged; iterations2++) {
-               if (conjugate_gradient_f(lap, y, balance, n, conj_tol, n, TRUE) < 0) {
+               if (conjugate_gradient_f(lap, y, balance, n, conj_tol, n, true) < 0) {
                    rv = 1;
                    goto cleanup;
                }
index 0f8ef58a2fcb221370f8d4e6f371d76308b0bf2d..a3a674fd93972baa6f1f0c0e82c489eceb44bde7 100644 (file)
@@ -651,7 +651,7 @@ static int sparse_stress_subspace_majorization_kD(vtx_data * graph, /* Input gra
                                     b_restricted);
            if (conjugate_gradient_f(matrix, directions[k], b_restricted,
                                 subspace_dim, conj_tol, subspace_dim,
-                                FALSE)) {
+                                false)) {
                iterations = -1;
                goto finish0;
            }