From: Matthew Fernandez Date: Wed, 15 Dec 2021 15:33:04 +0000 (-0800) Subject: power_iteration/iterativePCA_1D: [nfc] return C99 bools instead of boolean X-Git-Tag: 3.0.0~124^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f353dcf223a300a2bdbb16ca8ecfbc2efe0eab8;p=graphviz power_iteration/iterativePCA_1D: [nfc] return C99 bools instead of boolean --- diff --git a/lib/neatogen/matrix_ops.c b/lib/neatogen/matrix_ops.c index e1330b544..633f2c0d8 100644 --- a/lib/neatogen/matrix_ops.c +++ b/lib/neatogen/matrix_ops.c @@ -11,14 +11,14 @@ #include #include +#include #include #include #include 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 */ diff --git a/lib/neatogen/matrix_ops.h b/lib/neatogen/matrix_ops.h index cb9832186..90c766b13 100644 --- a/lib/neatogen/matrix_ops.h +++ b/lib/neatogen/matrix_ops.h @@ -10,6 +10,8 @@ #pragma once +#include + #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); /***************************** diff --git a/lib/neatogen/pca.c b/lib/neatogen/pca.c index 2acc7e6d5..7fc2df5d8 100644 --- a/lib/neatogen/pca.c +++ b/lib/neatogen/pca.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -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; diff --git a/lib/neatogen/pca.h b/lib/neatogen/pca.h index c13f3b3ed..4aaa866a0 100644 --- a/lib/neatogen/pca.h +++ b/lib/neatogen/pca.h @@ -10,6 +10,8 @@ #pragma once +#include + #ifdef __cplusplus extern "C" { #endif @@ -17,7 +19,7 @@ extern "C" { #include 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 }