From d6cebe11201a9e5a3367ed56314cbde192f15a07 Mon Sep 17 00:00:00 2001 From: dance858 Date: Sun, 17 Nov 2024 11:54:46 -0800 Subject: [PATCH] changed tolerance in test --- src/cones.c | 2 +- src/spectral_cones/logdeterminant/log_cone_Newton.c | 4 ++-- src/spectral_cones/logdeterminant/log_cone_wrapper.c | 2 +- test/spectral_cones_problems/several_logdet_cones.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cones.c b/src/cones.c index 46b449c7..7140fff0 100644 --- a/src/cones.c +++ b/src/cones.c @@ -49,7 +49,7 @@ scs_float SCS(proj_pd_exp_cone)(scs_float *v0, scs_int primal); // Forward declare spectral matrix cone projections scs_int SCS(proj_logdet_cone)(scs_float *tvX, const scs_int n, ScsConeWork *c, scs_int offset, bool *warmstart); -scs_int SCS(proj_nuclear_cone)(scs_float *tX, size_t m, size_t n, ScsConeWork *c); +scs_int SCS(proj_nuclear_cone)(scs_float *tX, scs_int m, scs_int n, ScsConeWork *c); void SCS(proj_ell_one)(scs_float *tx, size_t n, ScsConeWork *c); scs_int SCS(proj_sum_largest_evals)(scs_float *tX, scs_int n, scs_int k, ScsConeWork *c); diff --git a/src/spectral_cones/logdeterminant/log_cone_Newton.c b/src/spectral_cones/logdeterminant/log_cone_Newton.c index a7531922..d90a67ba 100644 --- a/src/spectral_cones/logdeterminant/log_cone_Newton.c +++ b/src/spectral_cones/logdeterminant/log_cone_Newton.c @@ -140,7 +140,7 @@ scs_int log_cone_Newton(scs_float t0, scs_float v0, const scs_float *x0, { *v = (v0 > MIN_INIT_LOG_CONE) ? v0 : MIN_INIT_LOG_CONE; - for (size_t i = 0; i < n; ++i) + for (scs_int i = 0; i < n; ++i) { x[i] = (x0[i] > MIN_INIT_LOG_CONE) ? x0[i] : MIN_INIT_LOG_CONE; } @@ -175,7 +175,7 @@ scs_int log_cone_Newton(scs_float t0, scs_float v0, const scs_float *x0, // To avoid pathological cases where some components of // x approach 0 we use a minimum threshold. // ------------------------------------------------------------------- - for (size_t i = 0; i < n; i++) + for (scs_int i = 0; i < n; i++) { x[i] = MAX(x[i], MIN_X); } diff --git a/src/spectral_cones/logdeterminant/log_cone_wrapper.c b/src/spectral_cones/logdeterminant/log_cone_wrapper.c index 3b7a5018..d1e12c97 100644 --- a/src/spectral_cones/logdeterminant/log_cone_wrapper.c +++ b/src/spectral_cones/logdeterminant/log_cone_wrapper.c @@ -203,7 +203,7 @@ static void check_opt_cond_log_cone(const scs_float *tvx, scs_float t0, dual_res += dualv * dualv; } - for (size_t i = 0; i < n; i++) + for (scs_int i = 0; i < n; i++) { if (dualx[i] < 0) { diff --git a/test/spectral_cones_problems/several_logdet_cones.h b/test/spectral_cones_problems/several_logdet_cones.h index c294fbaf..28099c7d 100644 --- a/test/spectral_cones_problems/several_logdet_cones.h +++ b/test/spectral_cones_problems/several_logdet_cones.h @@ -180,8 +180,8 @@ static const char *several_logdet_cones(void) k->sl_size = sl_size; scs_set_default_settings(stgs); - stgs->eps_abs = 1e-6; - stgs->eps_rel = 1e-6; + stgs->eps_abs = 1e-7; + stgs->eps_rel = 1e-7; stgs->eps_infeas = 1e-9;