3static int solve_copp3_socp_with_temporary_diagnostics(
const char *label,
22 "%s expert diagnostics failed: %s\n",
30 "%s expert diagnostics: solver_status=%d, has_profile=%d, iterations=%u, "
31 "r_prim=%.17g, r_dual=%.17g, obj_val=%.17g, obj_val_dual=%.17g, solve_time=%.17g, "
32 "x.len=%zu, z.len=%zu, s.len=%zu\n",
34 (
int)result.solver_status,
35 (
int)result.has_profile,
59 struct CoppProfile3rd profile_qp1 = {{NULL, 0, 0}, {NULL, 0, 0}, 0, 0};
60 struct CoppProfile3rd profile_qp2 = {{NULL, 0, 0}, {NULL, 0, 0}, 0, 0};
68 if (example_create_analytic_path_3rd(&path))
99 if (example_expect_ok(status,
"copp_clarabel_default_options"))
127 if (solve_copp3_socp_with_temporary_diagnostics(
128 "copp3_socp first iteration",
136 double t_final1 = 0.0;
137 if (example_time_from_third_order(s,
EXAMPLE_NUM_POINTS, profile_qp1, &t_final1, &t_s1) ||
143 printf(
"COPP3-SOCP done. (The first-iteration)\n");
145 printf(
"t_final = %.6f s\n", t_final1);
146 printf(
"a_profile.len() = %zu\n", profile_qp1.
a.
len);
147 printf(
"b_profile.len() = %zu\n", profile_qp1.
b.
len);
148 printf(
"s(t) samples = %zu\n", s_t1.
len);
168 if (solve_copp3_socp_with_temporary_diagnostics(
169 "copp3_socp second iteration",
177 double t_final2 = 0.0;
178 if (example_time_from_third_order(s,
EXAMPLE_NUM_POINTS, profile_qp2, &t_final2, &t_s2) ||
184 printf(
"---------\nCOPP3-SOCP done. (The second-iteration)\n");
186 printf(
"t_final = %.6f s <= %.6f s\n", t_final2, t_final1);
187 printf(
"a_profile.len() = %zu\n", profile_qp2.
a.
len);
188 printf(
"b_profile.len() = %zu\n", profile_qp2.
b.
len);
189 printf(
"s(t) samples = %zu\n", s_t2.
len);
enum CoppStatus copp3_socp(struct Copp3Problem problem, struct CoppClarabelOptions options, struct CoppProfile3rd *out_profile)
Solve a COPP3-SOCP problem.
void copp3_socp_result_free(struct Copp3SocpResult result)
Release memory owned by a Copp3SocpResult.
enum CoppStatus copp3_socp_expert(struct Copp3Problem problem, struct CoppClarabelOptions options, struct Copp3SocpResult *out_result)
Solve a COPP3-SOCP problem and always return Clarabel diagnostics.
const char * copp_status_message(enum CoppStatus status)
Return a short static message for a COPP status code.
CoppStatus
C ABI status code returned by COPP FFI functions.
void copp_vec_f64_free(struct CoppVecF64 vec)
Release a library-owned f64 vector returned by COPP.
const char * copp_last_error_message(void)
Return the current thread's last detailed error message as UTF-8.
enum CoppStatus copp_clarabel_default_options(struct CoppClarabelOptions *out_options)
Write default shared Clarabel options into out_options.
@ COPP_STATUS_OK
Operation completed successfully.
struct CoppPath CoppPath
Opaque C handle for a library-owned Path.
void copp_path_free(struct CoppPath *path)
Release a path handle created by this module.
struct CoppRobot CoppRobot
Opaque C handle for a library-owned robot and constraint buffer.
void copp_robot_free(struct CoppRobot *robot)
Release a robot handle created by copp_robot_create.
Borrowed value descriptor for a COPP3 problem solved from C.
struct CoppRobot * robot
Mutable robot handle that owns station-indexed constraint storage.
Compact COPP3-SOCP expert result returned to C.
struct CoppVecF64 s
Raw Clarabel primal-cone slack vector.
Shared Clarabel options for COPP SOCP solvers.
bool allow_insufficient_progress
Accept Clarabel status InsufficientProgress as usable.
bool allow_almost_solved
Accept Clarabel status AlmostSolved as usable.
Borrowed objective descriptor for COPP solvers.
Owned third-order profile returned by TOPP3/COPP3 C ABI solvers.
struct CoppVecF64 b
Node-based profile b[k] = ddot{s}_k.
struct CoppVecF64 a
Node-based profile a[k] = dot{s}_k^2.
Borrowed immutable f64 slice passed from C to COPP.
Library-owned f64 vector returned to C.
size_t len
Number of initialized elements.
double * data
Pointer to the first element, or null for an empty vector.