]> granicus.if.org Git - graphviz/commitdiff
power_iteration/iterativePCA_1D: [nfc] return C99 bools instead of boolean
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 15 Dec 2021 15:33:04 +0000 (07:33 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 15 Dec 2021 15:33:04 +0000 (07:33 -0800)
lib/neatogen/matrix_ops.c
lib/neatogen/matrix_ops.h
lib/neatogen/pca.c
lib/neatogen/pca.h

index e1330b544d5d1b5826cfb82e51f429a20a71ed2d..633f2c0d8f69ebfab9a82708290300d08f5e17e8 100644 (file)
 
 #include <neatogen/matrix_ops.h>
 #include <common/memory.h>
+#include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <math.h>
 
 static double p_iteration_threshold = 1e-3;
 
-int
-power_iteration(double **square_mat, int n, int neigs, double **eigs,
+bool power_iteration(double **square_mat, int n, int neigs, double **eigs,
                double *evals, int initialize)
 {
     /* compute the 'neigs' top eigenvectors of 'square_mat' using power iteration */
index cb9832186fafb135f622c74ef9715b92a501157c..90c766b1353fdf945bc887332725161926259beb 100644 (file)
@@ -10,6 +10,8 @@
 
 #pragma once
 
+#include <stdbool.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -48,7 +50,7 @@ extern "C" {
                                 double ***CC);
     extern void mult_sparse_dense_mat_transpose(vtx_data *, double **, int,
                                                int, float ***);
-    extern int power_iteration(double **, int, int, double **, double *, int);
+    extern bool power_iteration(double **, int, int, double **, double *, int);
 
 
 /*****************************
index 2acc7e6d5b294462cdaafb26a80549a07150665f..7fc2df5d8dc31d938be835ca8c8e432c751b80a9 100644 (file)
@@ -12,6 +12,7 @@
 #include <neatogen/matrix_ops.h>
 #include <neatogen/pca.h>
 #include <neatogen/closest.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
@@ -72,9 +73,7 @@ PCA_alloc(DistType ** coords, int dim, int n, double **new_coords,
     free(DD);
 }
 
-boolean
-iterativePCA_1D(double **coords, int dim, int n, double *new_direction)
-{
+bool iterativePCA_1D(double **coords, int dim, int n, double *new_direction) {
     vtx_data *laplacian;
     float **mat1 = NULL;
     double **mat = NULL;
index c13f3b3edef6e74cc7950fa30c4168df13bb9ffc..4aaa866a0873f321fae08df162573544b2324e08 100644 (file)
@@ -10,6 +10,8 @@
 
 #pragma once
 
+#include <stdbool.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -17,7 +19,7 @@ extern "C" {
 #include <neatogen/defs.h>
 
     extern void PCA_alloc(DistType **, int, int, double **, int);
-    extern boolean iterativePCA_1D(double **, int, int, double *);
+    extern bool iterativePCA_1D(double **, int, int, double *);
 
 #ifdef __cplusplus
 }