8 data.n =
static_cast<size_t>(
n);
9 data.m =
static_cast<size_t>(
m);
14 data.q =
const_cast<c_float *
>(
q.data());
26 : work{::
qpalm_setup(data.get_c_data_ptr(), &settings)} {}
33 std::optional<const_ref_vec_t> bmax) {
35 bmax ? bmax->data() :
nullptr);
47 std::optional<const_ref_vec_t> y) {
49 y ? y->data() :
nullptr);
55 assert(work->solution);
56 assert(work->solution->x);
57 assert(work->solution->y);
58 auto en =
static_cast<Eigen::Index
>(work->data->n);
59 auto em =
static_cast<Eigen::Index
>(work->data->m);
61 {work->solution->x, en},
62 {work->solution->y, em},
72 auto em =
static_cast<Eigen::Index
>(work->data->m);
73 return {work->delta_y, em};
77 auto en =
static_cast<Eigen::Index
>(work->data->n);
78 return {work->delta_x, en};
Stores the matrices and vectors that define the problem.
index_t m
Number of constraints (size of bmin and bmax, number of rows of A).
index_t n
Problem dimension (size of x and q, number rows and columns of Q, number of columns of A).
ladel_sparse_matrix_ptr Q
ladel_sparse_matrix_ptr A
const ::QPALMData * get_c_data_ptr() const
Get a pointer to the underlying C data structure.
SolutionView get_solution() const
Get the solution computed by solve().
void update_Q_A(const_ref_vec_t Q_vals, const_ref_vec_t A_vals)
const QPALMInfo & get_info() const
Get the solver information from the last call to solve().
void update_q(const_ref_vec_t q)
Solver(const Data &data, const Settings &settings)
Create a new solver for the problem defined by data and with the parameters defined by settings.
void warm_start(std::optional< const_ref_vec_t > x, std::optional< const_ref_vec_t > y)
void update_bounds(std::optional< const_ref_vec_t > bmin, std::optional< const_ref_vec_t > bmax)
void solve()
Solve the problem.
void update_settings(const Settings &settings)
const_borrowed_vec_t get_dual_inf_certificate() const
Get the certificate of dual infeasibility of the problem.
const_borrowed_vec_t get_prim_inf_certificate() const
Get the certificate of primal infeasibility of the problem.
ladel_double c_float
type for floating point numbers
void qpalm_solve(QPALMWorkspace *work)
Solve the quadratic program.
QPALMWorkspace * qpalm_setup(const QPALMData *data, const QPALMSettings *settings)
Initialize QPALM solver allocating memory.
void qpalm_update_settings(QPALMWorkspace *work, const QPALMSettings *settings)
Update the settings to the new settings.
void qpalm_set_default_settings(QPALMSettings *settings)
Set default settings from constants.h file.
void qpalm_update_bounds(QPALMWorkspace *work, const c_float *bmin, const c_float *bmax)
Update the lower and upper bounds.
void qpalm_update_Q_A(QPALMWorkspace *work, const c_float *Qx, const c_float *Ax)
Update the matrix entries of Q and A.
void qpalm_warm_start(QPALMWorkspace *work, const c_float *x_warm_start, const c_float *y_warm_start)
Warm start workspace variables x, x_0, x_prev, Ax, Qx, y and sigma.
void qpalm_cleanup(QPALMWorkspace *work)
Cleanup the workspace by deallocating memory.
void qpalm_update_q(QPALMWorkspace *work, const c_float *q)
Update the linear part of the cost.
Eigen::Ref< const vec_t > const_ref_vec_t
Read-only reference to a dense vector (vector view).
Eigen::Map< const vec_t > const_borrowed_vec_t
Read-only borrowed dense vector type (vector view).
Solver return information.
Settings and parameters for the QPALM solver.
Settings()
Construct with default settings.
View on the solution returned by the solver.
void operator()(::QPALMWorkspace *) const