lin_sys.h 1.6 KB

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