66 assert(
Q.rows() ==
n);
67 assert(
Q.cols() ==
n);
72 assert(
A.rows() ==
m);
73 assert(
A.cols() ==
n);
82 return {
static_cast<index_t>(
Q->nrow),
92 return {
static_cast<index_t>(
A->nrow),
103 mutable ::QPALMData data{};
144 QPALM_CXX_EXPORT
Solver(const ::QPALMData *data,
const Settings &settings);
148 :
Solver{data.get_c_data_ptr(), settings} {}
153 QPALM_CXX_EXPORT
void update_bounds(std::optional<const_ref_vec_t> bmin,
154 std::optional<const_ref_vec_t> bmax);
164 QPALM_CXX_EXPORT
void warm_start(std::optional<const_ref_vec_t> x,
165 std::optional<const_ref_vec_t> y);
171 QPALM_CXX_EXPORT
void solve();
202 using workspace_ptr =
203 std::unique_ptr<::QPALMWorkspace, alloc::qpalm_workspace_cleaner>;
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).
Data(index_t n, index_t m)
Construct a problem of dimension n with m constraints.
index_t n
Problem dimension (size of x and q, number rows and columns of Q, number of columns of A).
void set_A(const sparse_mat_ref_t &A)
Set the sparse A matrix. Creates a copy.
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.
sparse_mat_view_t get_Q() const
Get a view on the Q matrix of the problem.
void set_Q(const sparse_mat_ref_t &Q)
Set the sparse Q matrix. Creates a copy.
sparse_mat_view_t get_A() const
Get a view on the A matrix of the problem.
Data(index_t n, index_t m, index_t nnz_Q, index_t nnz_A)
Construct a problem of dimension n with m constraints, allocating an uninitialized upper-triangular Q...
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().
const ::QPALMWorkspace * get_c_work_ptr() const
Get a pointer to the underlying C workspace data structure.
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)
index_t get_m() const
Get the number of constraints .
const_borrowed_vec_t get_dual_inf_certificate() const
Get the certificate of dual infeasibility of the problem.
index_t get_n() const
Get the problem dimension (size of ).
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
::QPALMInfo Info
Information returned by the solver.
Eigen::Matrix< c_float, Eigen::Dynamic, 1 > vec_t
Owning dense vector type.
Eigen::Ref< const vec_t > const_ref_vec_t
Read-only reference to a dense vector (vector view).
Eigen::Map< const sparse_mat_t > sparse_mat_view_t
Read-only view on a sparse matrix.
ladel_sparse_matrix_ptr eigen_to_ladel_copy(const sparse_mat_ref_t &mat, ladel_int symmetry=UNSYMMETRIC)
Similar to eigen_to_ladel, but creates a copy of all data, in such a way that the returned matrix is ...
Eigen::Ref< const sparse_mat_t > sparse_mat_ref_t
Read-only reference to a sparse matrix.
ladel_sparse_matrix_ptr ladel_sparse_create(index_t rows, index_t cols, index_t nnz, ladel_int symmetry, bool values=true, bool nonzeros=false)
Create an LADEL sparse matrix of the given dimensions.
std::unique_ptr< ladel_sparse_matrix, alloc::ladel_sparse_matrix_deleter > ladel_sparse_matrix_ptr
Smart pointer that automatically cleans up an owning ladel_sparse_matrix object.
Eigen::Index index_t
Index types for vectors and matrices.
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.
Callable that cleans up the given workspace.
void operator()(::QPALMWorkspace *) const
Internal data structures used in QPALM.