mirror of https://github.com/CGAL/cgal
Add clear() and resize() to OSQP traits
This commit is contained in:
parent
f99d0c3480
commit
668bd2d618
|
|
@ -84,8 +84,29 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// \cond SKIP_IN_MANUAL
|
/// Reset the problem, removing all existing entries and setting sizes to `0`.
|
||||||
|
void clear()
|
||||||
|
{
|
||||||
|
n = m = 0;
|
||||||
|
P_vec.clear();
|
||||||
|
A_vec.clear();
|
||||||
|
q_vec.clear();
|
||||||
|
l_vec.clear();
|
||||||
|
u_vec.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Change the number of variables and the number of constraints of the problem.
|
||||||
|
///
|
||||||
|
/// \warning Calling this function also clears all previous entries.
|
||||||
|
void resize(const int new_n,
|
||||||
|
const int new_m = 0)
|
||||||
|
{
|
||||||
|
clear();
|
||||||
|
n = new_n;
|
||||||
|
m = new_m;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// \cond SKIP_IN_MANUAL
|
||||||
void set_P(const std::size_t i, const std::size_t j, const FT value)
|
void set_P(const std::size_t i, const std::size_t j, const FT value)
|
||||||
{
|
{
|
||||||
if(j < i)
|
if(j < i)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue