From 5afae427575cbaf1b91c3ac0620fc39e8dde77a3 Mon Sep 17 00:00:00 2001 From: Ben Hermans Date: Fri, 3 Sep 2021 09:53:17 -0500 Subject: [PATCH] Ifdef cplusplus in headers --- include/ladel.h | 8 ++++++++ include/ladel_add.h | 8 ++++++++ include/ladel_col_counts.h | 8 ++++++++ include/ladel_constants.h | 8 ++++++++ include/ladel_copy.h | 8 ++++++++ include/ladel_debug_print.h | 8 ++++++++ include/ladel_etree.h | 8 ++++++++ include/ladel_global.h | 8 ++++++++ include/ladel_ldl_numeric.h | 8 ++++++++ include/ladel_ldl_symbolic.h | 8 ++++++++ include/ladel_matmat.h | 8 ++++++++ include/ladel_matvec.h | 8 ++++++++ include/ladel_pattern.h | 8 ++++++++ include/ladel_permutation.h | 8 ++++++++ include/ladel_postorder.h | 8 ++++++++ include/ladel_rank1_mod.h | 8 ++++++++ include/ladel_row_mod.h | 8 ++++++++ include/ladel_scale.h | 8 ++++++++ include/ladel_submatrix.h | 9 +++++++++ include/ladel_transpose.h | 8 ++++++++ include/ladel_types.h | 8 ++++++++ include/ladel_upper_diag.h | 8 ++++++++ 22 files changed, 177 insertions(+) diff --git a/include/ladel.h b/include/ladel.h index 32e8065..6d842e5 100644 --- a/include/ladel.h +++ b/include/ladel.h @@ -12,6 +12,10 @@ #ifndef LADEL_H #define LADEL_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_col_counts.h" #include "ladel_constants.h" #include "ladel_copy.h" @@ -251,4 +255,8 @@ ladel_int ladel_row_del(ladel_factor *LD, * @} */ +#ifdef __cplusplus +} +#endif + #endif /*LADEL_H*/ \ No newline at end of file diff --git a/include/ladel_add.h b/include/ladel_add.h index 428296a..2344946 100644 --- a/include/ladel_add.h +++ b/include/ladel_add.h @@ -9,6 +9,10 @@ #ifndef LADEL_ADD_H #define LADEL_ADD_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** @@ -58,4 +62,8 @@ ladel_sparse_matrix *ladel_add_matrices_advanced( ladel_double alpha, ladel_int values, ladel_work *work); +#ifdef __cplusplus +} +#endif + #endif /* LADEL_ADD_H */ \ No newline at end of file diff --git a/include/ladel_col_counts.h b/include/ladel_col_counts.h index e4a8bf3..8961f4b 100644 --- a/include/ladel_col_counts.h +++ b/include/ladel_col_counts.h @@ -10,6 +10,10 @@ #ifndef LADEL_COL_COUNTS_H #define LADEL_COL_COUNTS_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** @@ -26,4 +30,8 @@ ladel_int ladel_col_counts( ladel_sparse_matrix *M, ladel_symbolics *sym, ladel_work *work); +#ifdef __cplusplus +} +#endif + #endif /*LADEL_COL_COUNTS_H*/ \ No newline at end of file diff --git a/include/ladel_constants.h b/include/ladel_constants.h index 27185f7..71ce418 100644 --- a/include/ladel_constants.h +++ b/include/ladel_constants.h @@ -7,6 +7,10 @@ #ifndef LADEL_CONSTANTS_H #define LADEL_CONSTANTS_H +#ifdef __cplusplus +extern "C" { +#endif + /** * @name Constants * @{ @@ -64,4 +68,8 @@ * @} */ +#ifdef __cplusplus +} +#endif + #endif /*LADEL_CONSTANTS_H*/ \ No newline at end of file diff --git a/include/ladel_copy.h b/include/ladel_copy.h index 48a3931..17e7e5b 100644 --- a/include/ladel_copy.h +++ b/include/ladel_copy.h @@ -7,6 +7,10 @@ #ifndef LADEL_COPY_H #define LADEL_COPY_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** @@ -51,4 +55,8 @@ void ladel_double_vector_copy( ladel_double *x, ladel_int size, ladel_double *y); +#ifdef __cplusplus +} +#endif + #endif /*LADEL_COPY_H*/ \ No newline at end of file diff --git a/include/ladel_debug_print.h b/include/ladel_debug_print.h index 7f14aab..2c571d1 100644 --- a/include/ladel_debug_print.h +++ b/include/ladel_debug_print.h @@ -8,6 +8,10 @@ #ifndef LADEL_DEBUG_PRINT_H #define LADEL_DEBUG_PRINT_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_global.h" #include "ladel_types.h" @@ -62,4 +66,8 @@ void ladel_print_factor_matlab(ladel_factor *LD); */ void ladel_print_set(ladel_set *set); +#ifdef __cplusplus +} +#endif + #endif \ No newline at end of file diff --git a/include/ladel_etree.h b/include/ladel_etree.h index ac40097..89c76c0 100644 --- a/include/ladel_etree.h +++ b/include/ladel_etree.h @@ -10,6 +10,10 @@ #ifndef LADEL_ETREE_H #define LADEL_ETREE_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** * Computes the elimination tree of a matrix. @@ -43,4 +47,8 @@ ladel_int ladel_etree_and_col_counts( ladel_sparse_matrix *M, ladel_work *work); #endif +#ifdef __cplusplus +} +#endif + #endif /*LADEL_ETREE_H*/ \ No newline at end of file diff --git a/include/ladel_global.h b/include/ladel_global.h index 80a804a..f78eac2 100644 --- a/include/ladel_global.h +++ b/include/ladel_global.h @@ -7,6 +7,10 @@ #ifndef LADEL_GLOBAL_H #define LADEL_GLOBAL_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" #include "ladel_constants.h" #include "ladel_copy.h" @@ -199,4 +203,8 @@ ladel_work *ladel_workspace_free(ladel_work* work); ladel_work *ladel_workspace_allocate(ladel_int ncol); +#ifdef __cplusplus +} +#endif + #endif /*LADEL_GLOBAL_H*/ \ No newline at end of file diff --git a/include/ladel_ldl_numeric.h b/include/ladel_ldl_numeric.h index dd0c5b2..3d1b439 100644 --- a/include/ladel_ldl_numeric.h +++ b/include/ladel_ldl_numeric.h @@ -7,6 +7,10 @@ #ifndef LDL_NUMERIC_H #define LDL_NUMERIC_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** @@ -39,4 +43,8 @@ ladel_int ladel_ldl_numeric(ladel_sparse_matrix *Mpp, ladel_factor *LD, ladel_work *work); +#ifdef __cplusplus +} +#endif + #endif /*LDL_NUMERIC_H*/ \ No newline at end of file diff --git a/include/ladel_ldl_symbolic.h b/include/ladel_ldl_symbolic.h index 5701990..df7e823 100644 --- a/include/ladel_ldl_symbolic.h +++ b/include/ladel_ldl_symbolic.h @@ -7,6 +7,10 @@ #ifndef LADEL_LDL_SYMBOLIC_H #define LADEL_LDL_SYMBOLIC_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** @@ -25,4 +29,8 @@ ladel_int ladel_ldl_symbolic( ladel_sparse_matrix *M, ladel_sparse_matrix *Mpp, ladel_work *work); +#ifdef __cplusplus +} +#endif + #endif /*LADEL_LDL_SYMBOLIC_H*/ diff --git a/include/ladel_matmat.h b/include/ladel_matmat.h index 1af7d70..7f9c8eb 100644 --- a/include/ladel_matmat.h +++ b/include/ladel_matmat.h @@ -8,6 +8,10 @@ #ifndef LADEL_MATMAT_H #define LADEL_MATMAT_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** @@ -65,4 +69,8 @@ ladel_sparse_matrix *ladel_mat_mat_transpose_advanced( ladel_sparse_matrix *M, ladel_int values, ladel_work *work); +#ifdef __cplusplus +} +#endif + #endif /* LADEL_MATMAT_H */ \ No newline at end of file diff --git a/include/ladel_matvec.h b/include/ladel_matvec.h index 00d55f8..c3f2114 100644 --- a/include/ladel_matvec.h +++ b/include/ladel_matvec.h @@ -7,6 +7,10 @@ #ifndef LADEL_MATVEC_H #define LADEL_MATVEC_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_global.h" #include "ladel_types.h" @@ -49,4 +53,8 @@ void ladel_symmetric_matvec(const ladel_sparse_matrix *M, ladel_double *y, ladel_int reset); +#ifdef __cplusplus +} +#endif + #endif /* LADEL_MATVEC_H */ \ No newline at end of file diff --git a/include/ladel_pattern.h b/include/ladel_pattern.h index 07e179b..b40b34c 100644 --- a/include/ladel_pattern.h +++ b/include/ladel_pattern.h @@ -9,6 +9,10 @@ #ifndef LADEL_PATTERN_H #define LADEL_PATTERN_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** @@ -45,4 +49,8 @@ ladel_int ladel_etree_dfs( ladel_sparse_matrix *W, ladel_int col_in_W, ladel_int maximum_row); +#ifdef __cplusplus +} +#endif + #endif /*LADEL_PATTERN_H*/ \ No newline at end of file diff --git a/include/ladel_permutation.h b/include/ladel_permutation.h index 15d25b4..c81a408 100644 --- a/include/ladel_permutation.h +++ b/include/ladel_permutation.h @@ -7,6 +7,10 @@ #ifndef LADEL_PERMUTATION_H #define LADEL_PERMUTATION_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** @@ -72,4 +76,8 @@ void ladel_permute_sparse_vector( ladel_sparse_matrix *x, ladel_int *p, ladel_work *work); +#ifdef __cplusplus +} +#endif + #endif /*LADEL_PERMUTATION_H*/ \ No newline at end of file diff --git a/include/ladel_postorder.h b/include/ladel_postorder.h index 057fff4..2fcb489 100644 --- a/include/ladel_postorder.h +++ b/include/ladel_postorder.h @@ -8,6 +8,10 @@ #ifndef LADEL_POSTORDER_H #define LADEL_POSTORDER_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** @@ -24,4 +28,8 @@ ladel_int ladel_postorder( ladel_sparse_matrix *M, ladel_symbolics *sym, ladel_work *work); +#ifdef __cplusplus +} +#endif + #endif /*LADEL_POSTORDER_H*/ \ No newline at end of file diff --git a/include/ladel_rank1_mod.h b/include/ladel_rank1_mod.h index 56f3aa2..3bd9538 100644 --- a/include/ladel_rank1_mod.h +++ b/include/ladel_rank1_mod.h @@ -9,6 +9,10 @@ #ifndef LADEL_RANK1_MOD_H #define LADEL_RANK1_MOD_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** @@ -54,4 +58,8 @@ ladel_int ladel_set_union( ladel_set *first_set, ladel_int *insertions, ladel_int threshold); +#ifdef __cplusplus +} +#endif + #endif \ No newline at end of file diff --git a/include/ladel_row_mod.h b/include/ladel_row_mod.h index 4f9bfc8..f8a88f6 100644 --- a/include/ladel_row_mod.h +++ b/include/ladel_row_mod.h @@ -7,6 +7,14 @@ #ifndef LADEL_ROW_MOD_H #define LADEL_ROW_MOD_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" +#ifdef __cplusplus +} +#endif + #endif /*LADEL_ROW_MOD_H*/ \ No newline at end of file diff --git a/include/ladel_scale.h b/include/ladel_scale.h index 892a758..8857470 100644 --- a/include/ladel_scale.h +++ b/include/ladel_scale.h @@ -8,6 +8,10 @@ #ifndef LADEL_SCALE_H #define LADEL_SCALE_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** @@ -56,4 +60,8 @@ void ladel_infinity_norm_rows( ladel_sparse_matrix *M, ladel_double *norms); +#ifdef __cplusplus +} +#endif + #endif /*LADEL_SCALE_H*/ \ No newline at end of file diff --git a/include/ladel_submatrix.h b/include/ladel_submatrix.h index dfeb8eb..d2ad621 100644 --- a/include/ladel_submatrix.h +++ b/include/ladel_submatrix.h @@ -7,6 +7,10 @@ #ifndef LADEL_SUBMATRIX_H #define LADEL_SUBMATRIX_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** @@ -20,4 +24,9 @@ ladel_sparse_matrix *ladel_column_submatrix(ladel_sparse_matrix *M, ladel_int *cols, ladel_int nb_cols); + +#ifdef __cplusplus +} +#endif + #endif /* LADEL_SUBMATRIX_H */ \ No newline at end of file diff --git a/include/ladel_transpose.h b/include/ladel_transpose.h index e509778..c7da589 100644 --- a/include/ladel_transpose.h +++ b/include/ladel_transpose.h @@ -7,6 +7,10 @@ #ifndef LADEL_TRANSPOSE_H #define LADEL_TRANSPOSE_H +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** @@ -24,4 +28,8 @@ ladel_sparse_matrix *ladel_transpose( ladel_sparse_matrix *M, ladel_int values, ladel_work *work); +#ifdef __cplusplus +} +#endif + #endif /*LADEL_TRANSPOSE_H*/ \ No newline at end of file diff --git a/include/ladel_types.h b/include/ladel_types.h index 8435335..04e9603 100644 --- a/include/ladel_types.h +++ b/include/ladel_types.h @@ -7,6 +7,10 @@ #ifndef LADEL_TYPES_H #define LADEL_TYPES_H +#ifdef __cplusplus +extern "C" { +#endif + #ifdef DFLOAT typedef float ladel_double; /**< Type for floating point numbers (default: double) */ #else @@ -114,4 +118,8 @@ typedef struct workspace ladel_double *array_double_ncol1; /**< An array of @a ncol doubles */ } ladel_work; +#ifdef __cplusplus +} +#endif + #endif /*LADEL_TYPES_H*/ \ No newline at end of file diff --git a/include/ladel_upper_diag.h b/include/ladel_upper_diag.h index ff7219d..cd42ca2 100644 --- a/include/ladel_upper_diag.h +++ b/include/ladel_upper_diag.h @@ -7,6 +7,10 @@ #ifndef LADEL_UPPER_DIAG #define LADEL_UPPER_DIAG +#ifdef __cplusplus +extern "C" { +#endif + #include "ladel_types.h" /** @@ -16,4 +20,8 @@ */ void ladel_to_upper_diag(ladel_sparse_matrix *M); +#ifdef __cplusplus +} +#endif + #endif /* LADEL_UPPER_DIAG */ \ No newline at end of file