template<Config Conf, class IndexT, class StorageIndexT>
struct alpaqa::LinConstrConverter< Conf, IndexT, StorageIndexT >
Definition at line 15 of file lin-constr-converter.hpp.
|
static bool | is_bound (std::span< const real_t > lbx, std::span< const real_t > ubx, size_t i) |
| Check if the variable with the given index has bound constraints, i.e.
|
static bool | is_bound (const sets::Box< config_t > &C, typename config_t::index_t i) |
static index_t | count_bounds (std::span< const real_t > lbx, std::span< const real_t > ubx) |
static index_t | count_bounds (const sets::Box< config_t > &C) |
static void | add_box_constr_to_constr_matrix (mat< config_t > &A, std::span< const real_t > lbx, std::span< const real_t > ubx) |
static void | add_box_constr_to_constr_matrix (mat< config_t > &A, const sets::Box< config_t > &C) |
static void | add_box_constr_to_constr_matrix_inplace (index_t n_row, rmat< config_t > A, std::span< const real_t > lbx, std::span< const real_t > ubx) |
static void | add_box_constr_to_constr_matrix_inplace (index_t n_row, rmat< config_t > A, const sets::Box< config_t > &C) |
static void | add_box_constr_to_constr_matrix_inplace_vec (index_t n_row, index_t n_col, rvec< config_t > A, std::span< const real_t > lbx, std::span< const real_t > ubx) |
static void | add_box_constr_to_constr_matrix_inplace_vec (index_t n_row, index_t n_col, rvec< config_t > A, const sets::Box< config_t > &C) |
static void | add_box_constr_to_constr_matrix (SparseView &A, std::span< const real_t > lbx, std::span< const real_t > ubx) |
| Update the constraint matrix A, such that for each constraint C(i) with finite bounds, a row is inserted into A with a one in the i-th column.
|
static void | add_box_constr_to_constr_matrix (SparseView &A, const sets::Box< config_t > &C) |
static void | combine_bound_constr (std::span< const real_t > lbx, std::span< const real_t > ubx, std::span< const real_t > lbg, std::span< const real_t > ubg, std::span< real_t > new_lbg, std::span< real_t > new_ubg, std::span< const real_t > g0) |
| For each constraint lbx(i)/ubx(i) with finite bounds, insert these bounds into new_lbg(i)/new_ubg(i), followed by all bounds lbg(i)/ubg(i), shifted by the constant vector -g₀.
|
static void | combine_bound_constr (const sets::Box< config_t > &C, const sets::Box< config_t > &D, sets::Box< config_t > &new_D, typename config_t::crvec g0) |
static void | combine_bound_constr (const sets::Box< config_t > &C, const sets::Box< config_t > &D, std::span< real_t > new_lbg, std::span< real_t > new_ubg, typename config_t::crvec g0) |
template<Config Conf, class IndexT, class StorageIndexT>
bool is_bound |
( |
std::span< const real_t > | lbx, |
|
|
std::span< const real_t > | ubx, |
|
|
size_t | i ) |
|
inlinestatic |
Check if the variable with the given index has bound constraints, i.e.
if not lower == -inf and upper == +inf.
Definition at line 30 of file lin-constr-converter.hpp.
template<Config Conf, class IndexT, class StorageIndexT>
void add_box_constr_to_constr_matrix |
( |
SparseView & | A, |
|
|
std::span< const real_t > | lbx, |
|
|
std::span< const real_t > | ubx ) |
|
static |
Update the constraint matrix A, such that for each constraint C(i) with finite bounds, a row is inserted into A with a one in the i-th column.
The newly added rows are added above the original rows of A. For example, if all constraints have finite bounds, the resulting matrix is \( \begin{pmatrix} I \\\hline A \end{pmatrix} \).
- Precondition
- Assumes that the user preallocated enough space for inserting these nonzero elements into A, and that A is compressed.
Definition at line 177 of file lin-constr-converter.hpp.
template<Config Conf, class IndexT, class StorageIndexT>
void combine_bound_constr |
( |
std::span< const real_t > | lbx, |
|
|
std::span< const real_t > | ubx, |
|
|
std::span< const real_t > | lbg, |
|
|
std::span< const real_t > | ubg, |
|
|
std::span< real_t > | new_lbg, |
|
|
std::span< real_t > | new_ubg, |
|
|
std::span< const real_t > | g0 ) |
|
static |
For each constraint lbx(i)/ubx(i) with finite bounds, insert these bounds into new_lbg(i)/new_ubg(i), followed by all bounds lbg(i)/ubg(i), shifted by the constant vector -g₀.
Definition at line 244 of file lin-constr-converter.hpp.