Austin Schuh | 9049e20 | 2022-02-20 17:34:16 -0800 | [diff] [blame^] | 1 | #ifndef LIN_SYS_H |
| 2 | # define LIN_SYS_H |
| 3 | |
| 4 | /* KKT linear system definition and solution */ |
| 5 | |
| 6 | # ifdef __cplusplus |
| 7 | extern "C" { |
| 8 | # endif // ifdef __cplusplus |
| 9 | |
| 10 | # include "types.h" |
| 11 | |
| 12 | /** |
| 13 | * Load linear system solver shared library |
| 14 | * @param linsys_solver Linear system solver |
| 15 | * @return Zero on success, nonzero on failure. |
| 16 | */ |
| 17 | c_int load_linsys_solver(enum linsys_solver_type linsys_solver); |
| 18 | |
| 19 | |
| 20 | /** |
| 21 | * Unload linear system solver shared library |
| 22 | * @param linsys_solver Linear system solver |
| 23 | * @return Zero on success, nonzero on failure. |
| 24 | */ |
| 25 | c_int unload_linsys_solver(enum linsys_solver_type linsys_solver); |
| 26 | |
| 27 | |
| 28 | // NB: Only the upper triangular part of P is stuffed! |
| 29 | |
| 30 | /** |
| 31 | * Initialize linear system solver structure |
| 32 | * @param s Pointer to linear system solver structure |
| 33 | * @param P Cost function matrix |
| 34 | * @param A Constraint matrix |
| 35 | * @param sigma Algorithm parameter |
| 36 | * @param rho_vec Algorithm parameter |
| 37 | * @param linsys_solver Linear system solver |
| 38 | * @param polish 0/1 depending whether we are allocating for |
| 39 | *polishing or not |
| 40 | * @return Exitflag for error (0 if no errors) |
| 41 | */ |
| 42 | c_int init_linsys_solver(LinSysSolver **s, |
| 43 | const csc *P, |
| 44 | const csc *A, |
| 45 | c_float sigma, |
| 46 | const c_float *rho_vec, |
| 47 | enum linsys_solver_type linsys_solver, |
| 48 | c_int polish); |
| 49 | |
| 50 | # ifdef __cplusplus |
| 51 | } |
| 52 | # endif // ifdef __cplusplus |
| 53 | |
| 54 | #endif // ifndef LIN_SYS_H |