Files | |
| file | bindings/c/include/copp/core.h |
| Core status, memory, matrix, and shared solver option types. | |
Data Structures | |
| struct | CoppClarabelLinearSolverInfo |
| Linear solver metadata reported by Clarabel. More... | |
| struct | CoppClarabelSettings |
| Advanced raw Clarabel solver settings. More... | |
| struct | CoppClarabelOptions |
| Shared Clarabel options for COPP SOCP solvers. More... | |
| struct | CoppMatrixViewF64 |
| Borrowed immutable f64 matrix passed from C to COPP. More... | |
| struct | CoppSliceF64 |
| Borrowed immutable f64 slice passed from C to COPP. More... | |
| struct | CoppSliceMutF64 |
| Borrowed mutable f64 slice passed from C to COPP. More... | |
| struct | CoppVecF64 |
| Library-owned f64 vector returned to C. More... | |
| struct | CoppVecUsize |
| Library-owned usize vector returned to C. More... | |
| struct | CoppMatrixF64 |
| Library-owned column-major f64 matrix returned to C. More... | |
Macros | |
| #define | COPP_MATRIX_VIEW_F64_COLUMN_MAJOR(data_, rows_, cols_) |
| Build a contiguous column-major matrix view. | |
| #define | COPP_MATRIX_VIEW_F64_ROW_MAJOR(data_, rows_, cols_) |
| Build a contiguous row-major matrix view. | |
Functions | |
| const char * | copp_status_message (enum CoppStatus status) |
| Return a short static message for a COPP status code. | |
| enum CoppStatus | copp_last_error_code (void) |
| Return the status code associated with the current thread's last error. | |
| const char * | copp_last_error_message (void) |
| Return the current thread's last detailed error message as UTF-8. | |
| size_t | copp_last_error_message_len (void) |
| Return the length in bytes of the current thread's last UTF-8 error message. | |
| enum CoppStatus | copp_last_error_message_copy (char *buffer, size_t capacity, size_t *out_len) |
| Copy the current thread's last UTF-8 error message into a caller buffer. | |
| void | copp_clear_last_error (void) |
| Clear the current thread's last detailed error message. | |
| enum CoppStatus | copp_set_last_error_message (enum CoppStatus status, const char *message) |
| Set the current thread's last detailed error message from a C string. | |
| enum CoppStatus | copp_set_last_error_message_n (enum CoppStatus status, const char *message, size_t len) |
| Set the current thread's last detailed error message from a byte slice. | |
| const char * | copp_version (void) |
| Return the COPP library version. | |
| enum CoppStatus | copp_clarabel_default_options (struct CoppClarabelOptions *out_options) |
| Write default shared Clarabel options into out_options. | |
| void | copp_vec_f64_free (struct CoppVecF64 vec) |
| Release a library-owned f64 vector returned by COPP. | |
| void | copp_vec_usize_free (struct CoppVecUsize vec) |
| Release a library-owned usize vector returned by COPP. | |
| void | copp_matrix_f64_free (struct CoppMatrixF64 matrix) |
| Release a library-owned f64 matrix returned by COPP. | |
| enum CoppStatus | copp_clarabel_solution_to_profile_2nd (size_t s_len, struct CoppSliceF64 x, struct CoppVecF64 *out_a) |
| Extract a second-order COPP profile from a Clarabel primal solution. | |
| enum CoppStatus | copp_clarabel_solution_to_profile_3rd (struct CoppSliceF64 s, struct CoppSliceF64 x, size_t num_stationary_start, size_t num_stationary_end, struct CoppProfile3rd *out_profile) |
| Extract a third-order COPP profile from a Clarabel primal solution. | |
| #define COPP_MATRIX_VIEW_F64_COLUMN_MAJOR | ( | data_, | |
| rows_, | |||
| cols_ ) |
Build a contiguous column-major matrix view.
This is the recommended zero-copy input layout for COPP C APIs.
| #define COPP_MATRIX_VIEW_F64_ROW_MAJOR | ( | data_, | |
| rows_, | |||
| cols_ ) |
Build a contiguous row-major matrix view.
COPP accepts this layout, but it converts the input to column-major temporary storage before use.
| enum CoppStatus |
C ABI status code returned by COPP FFI functions.
The numeric ranges are grouped by subsystem so future bindings can preserve source compatibility while still reporting precise failure classes.
| enum CoppVerbosity |
C ABI verbosity level for solver diagnostics.
Direct linear solver method forwarded to Clarabel.
Clarabel solver status returned by SOCP expert results.
| enum CoppMatrixLayout |
Matrix memory layout used by CoppMatrixViewF64.
COPP recommends column-major input because it matches nalgebra. Strictly contiguous column-major input (leading_dim == rows) can be borrowed as a slice, and padded column-major input (leading_dim >= rows) can be borrowed as a strided matrix view. Row-major input is accepted, but COPP copies it into column-major storage before passing it to COPP internals.
| const char * copp_status_message | ( | enum CoppStatus | status | ) |
Return a short static message for a COPP status code.
The returned pointer is a static null-terminated string owned by the library.
| enum CoppStatus copp_last_error_code | ( | void | ) |
Return the status code associated with the current thread's last error.
A successful COPP C ABI call clears this slot back to COPP_STATUS_OK.
| const char * copp_last_error_message | ( | void | ) |
Return the current thread's last detailed error message as UTF-8.
The returned pointer is owned by COPP and remains valid until the next COPP C ABI call on the same thread updates or clears the last-error slot. When no error is stored, this returns an empty string.
| size_t copp_last_error_message_len | ( | void | ) |
Return the length in bytes of the current thread's last UTF-8 error message.
The terminating null byte is not included in the returned length.
| enum CoppStatus copp_last_error_message_copy | ( | char * | buffer, |
| size_t | capacity, | ||
| size_t * | out_len ) |
Copy the current thread's last UTF-8 error message into a caller buffer.
out_len, when non-null, receives the full message length in bytes, excluding the terminating null byte, even when capacity is too small. If buffer is non-null and capacity > 0, COPP always writes a null-terminated, possibly truncated UTF-8 prefix.
The example below reports both the portable status string and the thread-local detail, then copies the detail into caller-owned storage. Inline snippets elsewhere in this reference use check(...) as shorthand for this kind of status handling.
| void copp_clear_last_error | ( | void | ) |
Clear the current thread's last detailed error message.
| enum CoppStatus copp_set_last_error_message | ( | enum CoppStatus | status, |
| const char * | message ) |
Set the current thread's last detailed error message from a C string.
The message is interpreted as UTF-8 with lossy replacement for invalid byte sequences. Interior null bytes cannot appear in this C-string variant; use copp_set_last_error_message_n when the message length is known.
The example below sets callback-specific detail before returning a non-OK status to COPP.
| enum CoppStatus copp_set_last_error_message_n | ( | enum CoppStatus | status, |
| const char * | message, | ||
| size_t | len ) |
Set the current thread's last detailed error message from a byte slice.
The message is interpreted as UTF-8 with lossy replacement for invalid byte sequences, interior null bytes are replaced, and the stored message is capped at 64 KiB.
| const char * copp_version | ( | void | ) |
Return the COPP library version.
The returned pointer is a static null-terminated string owned by the library.
| enum CoppStatus copp_clarabel_default_options | ( | struct CoppClarabelOptions * | out_options | ) |
Write default shared Clarabel options into out_options.
Defaults use COPP's default Clarabel settings and accept Solved and AlmostSolved statuses.
| void copp_vec_f64_free | ( | struct CoppVecF64 | vec | ) |
Release a library-owned f64 vector returned by COPP.
| void copp_vec_usize_free | ( | struct CoppVecUsize | vec | ) |
Release a library-owned usize vector returned by COPP.
| void copp_matrix_f64_free | ( | struct CoppMatrixF64 | matrix | ) |
Release a library-owned f64 matrix returned by COPP.
| enum CoppStatus copp_clarabel_solution_to_profile_2nd | ( | size_t | s_len, |
| struct CoppSliceF64 | x, | ||
| struct CoppVecF64 * | out_a ) |
Extract a second-order COPP profile from a Clarabel primal solution.
Use this helper with an expert SOCP result when the raw primal x vector should be converted back into the accepted a(s) = dot{s}^2 profile. The output has length s_len; missing tail values are filled with zero and all entries are clamped to be non-negative.
The example below converts an expert raw primal vector into a second-order a(s) profile.
| enum CoppStatus copp_clarabel_solution_to_profile_3rd | ( | struct CoppSliceF64 | s, |
| struct CoppSliceF64 | x, | ||
| size_t | num_stationary_start, | ||
| size_t | num_stationary_end, | ||
| struct CoppProfile3rd * | out_profile ) |
Extract a third-order COPP profile from a Clarabel primal solution.
Use this helper with a TOPP3/COPP3 expert SOCP result when the raw primal x vector should be converted back into the accepted (a, b, num_stationary) profile. The station vector s defines the profile length and interval spacing.
The example below converts an expert raw primal vector into a third-order (a, b) profile.