diff --git a/CMakeLists.txt b/CMakeLists.txt index 063374a8..059a144f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project(PSLP LANGUAGES C CXX) # The library is written in C, but we also have so set(PSLP_VERSION_MAJOR 0) set(PSLP_VERSION_MINOR 0) -set(PSLP_VERSION_PATCH 5) +set(PSLP_VERSION_PATCH 6) set(PSLP_VERSION "${PSLP_VERSION_MAJOR}.${PSLP_VERSION_MINOR}.${PSLP_VERSION_PATCH}") add_compile_definitions(PSLP_VERSION="${PSLP_VERSION}") diff --git a/include/PSLP/PSLP_API.h b/include/PSLP/PSLP_API.h index 9e5c490f..2f5eb30c 100644 --- a/include/PSLP/PSLP_API.h +++ b/include/PSLP/PSLP_API.h @@ -126,7 +126,7 @@ extern "C" /* Postsolve the problem given the primal-dual solution (x, y, z) of the reduced problem. The function populates presolver->sol, so if you're - looking for the solution to the original problem, you should look there. + looking for the solution to the original problem, you want to look there. If the solver has added the offset to the objective when solving the reduced problem, the optimal value of the original problem is the same as that of the reduced problem. */ diff --git a/include/PSLP/PSLP_sol.h b/include/PSLP/PSLP_sol.h index c8948d19..e3c7c470 100644 --- a/include/PSLP/PSLP_sol.h +++ b/include/PSLP/PSLP_sol.h @@ -20,12 +20,13 @@ #define PSLP_SOL_H #ifdef __cplusplus +#include // size_t extern "C" { +#else +#include // size_t #endif -#include - typedef struct Solution { double *x; diff --git a/include/PSLP/PSLP_stats.h b/include/PSLP/PSLP_stats.h index 0dd916b6..50fdf12d 100644 --- a/include/PSLP/PSLP_stats.h +++ b/include/PSLP/PSLP_stats.h @@ -19,32 +19,44 @@ #ifndef PSLP_STATS_H #define PSLP_STATS_H -typedef struct PresolveStats +#ifdef __cplusplus +#include // size_t +extern "C" { - size_t n_rows_original; - size_t n_cols_original; - size_t nnz_original; - size_t n_rows_reduced; - size_t n_cols_reduced; - size_t nnz_reduced; - - /* reduction stats */ - size_t nnz_removed_trivial; - size_t nnz_removed_fast; - size_t nnz_removed_primal_propagation; - size_t nnz_removed_parallel_rows; - size_t nnz_removed_parallel_cols; - - /* time stats */ - double time_init; - double time_fast_reductions; - double time_medium_reductions; - double time_primal_propagation; - double time_parallel_rows; - double time_parallel_cols; - double time_presolve; - double time_postsolve; - -} PresolveStats; +#else +#include // size_t +#endif + + typedef struct PresolveStats + { + size_t n_rows_original; + size_t n_cols_original; + size_t nnz_original; + size_t n_rows_reduced; + size_t n_cols_reduced; + size_t nnz_reduced; + + /* reduction stats */ + size_t nnz_removed_trivial; + size_t nnz_removed_fast; + size_t nnz_removed_primal_propagation; + size_t nnz_removed_parallel_rows; + size_t nnz_removed_parallel_cols; + + /* time stats */ + double time_init; + double time_fast_reductions; + double time_medium_reductions; + double time_primal_propagation; + double time_parallel_rows; + double time_parallel_cols; + double time_presolve; + double time_postsolve; + + } PresolveStats; + +#ifdef __cplusplus +} +#endif #endif // PSLP_STATS_H