mirror of https://github.com/CGAL/cgal
updated docs and fixed concepts
This commit is contained in:
parent
ff0734d8cc
commit
f865eaaf35
|
|
@ -3,7 +3,7 @@
|
||||||
\cgalConcept
|
\cgalConcept
|
||||||
|
|
||||||
A concept that describes the set of methods used to define and solve a
|
A concept that describes the set of methods used to define and solve a
|
||||||
linear programming (LP) problem of the general form:
|
linear programming (`lp`) problem of the general form:
|
||||||
<center>
|
<center>
|
||||||
\f{eqnarray*}{
|
\f{eqnarray*}{
|
||||||
& \mbox{minimize} & \mathbf{q}^{T}\mathbf{x} + r \\
|
& \mbox{minimize} & \mathbf{q}^{T}\mathbf{x} + r \\
|
||||||
|
|
@ -31,24 +31,9 @@ public:
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Allocates memory for `n` values in the vector `q`.
|
Allocates memory for `n` variables and `m` constraints in `lp`.
|
||||||
*/
|
*/
|
||||||
void reserve_q(const std::size_t n) { }
|
void resize(const std::size_t n, const std::size_t m) { }
|
||||||
|
|
||||||
/*!
|
|
||||||
Allocates memory for `k` non-zero values in the matrix `A`.
|
|
||||||
*/
|
|
||||||
void reserve_A(const std::size_t k) { }
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Allocates memory for `m` values in the vector `l`.
|
|
||||||
*/
|
|
||||||
void reserve_l(const std::size_t m) { }
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Allocates memory for `m` values in the vector `u`.
|
|
||||||
*/
|
|
||||||
void reserve_u(const std::size_t m) { }
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
@ -56,35 +41,30 @@ public:
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets the entry `qj` of `lp` to `value`.
|
Sets the entry `qi` of `lp` to `value`.
|
||||||
*/
|
*/
|
||||||
void set_q(const std::size_t j, const FT value)
|
void set_q(const std::size_t i, const FT value) { }
|
||||||
{ }
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets the entry `r` of `lp` to `value`.
|
Sets the entry `r` of `lp` to `value`.
|
||||||
*/
|
*/
|
||||||
void set_r(const FT value)
|
void set_r(const FT value) { }
|
||||||
{ }
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets the entry `Aij` in the row `i` and column `j` of
|
Sets the entry `Aij` in the row `i` and column `j` of
|
||||||
the constraint matrix `A` of `lp` to `value`.
|
the constraint matrix `A` of `lp` to `value`.
|
||||||
*/
|
*/
|
||||||
void set_A(const std::size_t i, const std::size_t j, const FT value)
|
void set_A(const std::size_t i, const std::size_t j, const FT value) { }
|
||||||
{ }
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets the entry `li` of `lp` to `value`.
|
Sets the entry `li` of `lp` to `value`.
|
||||||
*/
|
*/
|
||||||
void set_l(const std::size_t i, const FT value)
|
void set_l(const std::size_t i, const FT value) { }
|
||||||
{ }
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets the entry `ui` of `lp` to `value`.
|
Sets the entry `ui` of `lp` to `value`.
|
||||||
*/
|
*/
|
||||||
void set_u(const std::size_t i, const FT value)
|
void set_u(const std::size_t i, const FT value) { }
|
||||||
{ }
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
@ -97,7 +77,7 @@ public:
|
||||||
Number of values in `solution` equals to the number `n` of values in the vector `x`.
|
Number of values in `solution` equals to the number `n` of values in the vector `x`.
|
||||||
|
|
||||||
\tparam OutIterator
|
\tparam OutIterator
|
||||||
a model of `OutputIterator` that accepts values of type `FT`
|
a model of `OutputIterator` that accepts values of type `FieldNumberType`
|
||||||
|
|
||||||
\param solution
|
\param solution
|
||||||
an output iterator with the solution
|
an output iterator with the solution
|
||||||
|
|
@ -105,8 +85,7 @@ public:
|
||||||
\returns a status of the computation `success == true`
|
\returns a status of the computation `success == true`
|
||||||
*/
|
*/
|
||||||
template<typename OutIterator>
|
template<typename OutIterator>
|
||||||
bool solve(OutIterator solution)
|
bool solve(OutIterator solution) { }
|
||||||
{ }
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
\cgalConcept
|
\cgalConcept
|
||||||
|
|
||||||
A concept that describes the set of methods used to define and solve a
|
A concept that describes the set of methods used to define and solve a
|
||||||
quadratic programming (QP) problem of the general form:
|
quadratic programming (`qp`) problem of the general form:
|
||||||
<center>
|
<center>
|
||||||
\f{eqnarray*}{
|
\f{eqnarray*}{
|
||||||
& \mbox{minimize} & \frac{1}{2}\mathbf{x}^{T}P\mathbf{x} + \mathbf{q}^{T}\mathbf{x} + r \\
|
& \mbox{minimize} & \frac{1}{2}\mathbf{x}^{T}P\mathbf{x} + \mathbf{q}^{T}\mathbf{x} + r \\
|
||||||
|
|
@ -35,29 +35,9 @@ public:
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Allocates memory for `k` non-zero values in the matrix `P`.
|
Allocates memory for `n` variables and `m` constraints in `qp`.
|
||||||
*/
|
*/
|
||||||
void reserve_P(const std::size_t k) { }
|
void resize(const std::size_t n, const std::size_t m) { }
|
||||||
|
|
||||||
/*!
|
|
||||||
Allocates memory for `n` values in the vector `q`.
|
|
||||||
*/
|
|
||||||
void reserve_q(const std::size_t n) { }
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Allocates memory for `k` non-zero values in the matrix `A`.
|
|
||||||
*/
|
|
||||||
void reserve_A(const std::size_t k) { }
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Allocates memory for `m` values in the vector `l`.
|
|
||||||
*/
|
|
||||||
void reserve_l(const std::size_t m) { }
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Allocates memory for `m` values in the vector `u`.
|
|
||||||
*/
|
|
||||||
void reserve_u(const std::size_t m) { }
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
@ -69,39 +49,33 @@ public:
|
||||||
|
|
||||||
Note that you should define only the upper triangular part of the matrix!
|
Note that you should define only the upper triangular part of the matrix!
|
||||||
*/
|
*/
|
||||||
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) { }
|
||||||
{ }
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets the entry `qj` of `qp` to `value`.
|
Sets the entry `qi` of `qp` to `value`.
|
||||||
*/
|
*/
|
||||||
void set_q(const std::size_t j, const FT value)
|
void set_q(const std::size_t i, const FT value) { }
|
||||||
{ }
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets the entry `r` of `qp` to `value`.
|
Sets the entry `r` of `qp` to `value`.
|
||||||
*/
|
*/
|
||||||
void set_r(const FT value)
|
void set_r(const FT value) { }
|
||||||
{ }
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets the entry `Aij` in the row `i` and column `j` of
|
Sets the entry `Aij` in the row `i` and column `j` of
|
||||||
the constraint matrix `A` of `qp` to `value`.
|
the constraint matrix `A` of `qp` to `value`.
|
||||||
*/
|
*/
|
||||||
void set_A(const std::size_t i, const std::size_t j, const FT value)
|
void set_A(const std::size_t i, const std::size_t j, const FT value) { }
|
||||||
{ }
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets the entry `li` of `qp` to `value`.
|
Sets the entry `li` of `qp` to `value`.
|
||||||
*/
|
*/
|
||||||
void set_l(const std::size_t i, const FT value)
|
void set_l(const std::size_t i, const FT value) { }
|
||||||
{ }
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets the entry `ui` of `qp` to `value`.
|
Sets the entry `ui` of `qp` to `value`.
|
||||||
*/
|
*/
|
||||||
void set_u(const std::size_t i, const FT value)
|
void set_u(const std::size_t i, const FT value) { }
|
||||||
{ }
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
|
@ -114,7 +88,7 @@ public:
|
||||||
Number of values in `solution` equals to the number `n` of values in the vector `x`.
|
Number of values in `solution` equals to the number `n` of values in the vector `x`.
|
||||||
|
|
||||||
\tparam OutIterator
|
\tparam OutIterator
|
||||||
a model of `OutputIterator` that accepts values of type `FT`
|
a model of `OutputIterator` that accepts values of type `FieldNumberType`
|
||||||
|
|
||||||
\param solution
|
\param solution
|
||||||
an output iterator with the solution
|
an output iterator with the solution
|
||||||
|
|
@ -122,8 +96,7 @@ public:
|
||||||
\returns a status of the computation `success == true`
|
\returns a status of the computation `success == true`
|
||||||
*/
|
*/
|
||||||
template<typename OutIterator>
|
template<typename OutIterator>
|
||||||
bool solve(OutIterator solution)
|
bool solve(OutIterator solution) { }
|
||||||
{ }
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ extended the existing concepts. Liangliang Nan introduced the concept
|
||||||
`MixedIntegerProgramTraits` and two models for solving mixed integer
|
`MixedIntegerProgramTraits` and two models for solving mixed integer
|
||||||
programs when implementing the \ref PkgPolygonalSurfaceReconstruction
|
programs when implementing the \ref PkgPolygonalSurfaceReconstruction
|
||||||
package. The concepts and models for solving linear and quadratic programs
|
package. The concepts and models for solving linear and quadratic programs
|
||||||
were later introduced by Dmitry Anisimov.
|
were later introduced by Dmitry Anisimov and Mael Rouxel-Labbé.
|
||||||
|
|
||||||
Simon Giraudot was responsible for gathering all concepts and classes,
|
Simon Giraudot was responsible for gathering all concepts and classes,
|
||||||
and also wrote this user manual with the help of Andreas Fabri.
|
and also wrote this user manual with the help of Andreas Fabri.
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ private:
|
||||||
std::vector<FT> q_vec, l_vec, u_vec;
|
std::vector<FT> q_vec, l_vec, u_vec;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Default constructor
|
/// %Default constructor
|
||||||
OSQP_quadratic_program_traits() : n(0), m(0) { }
|
OSQP_quadratic_program_traits() : n(0), m(0) { }
|
||||||
|
|
||||||
/// Constructor
|
/// Constructor
|
||||||
|
|
@ -85,7 +85,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Reset the problem, removing all existing entries and setting sizes to `0`.
|
/// Resets the problem, removing all existing entries and setting sizes to `0`.
|
||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
n = m = 0;
|
n = m = 0;
|
||||||
|
|
@ -96,7 +96,7 @@ public:
|
||||||
u_vec.clear();
|
u_vec.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Change the number of variables and the number of constraints of the problem.
|
/// Changes the number of variables and the number of constraints of the problem.
|
||||||
///
|
///
|
||||||
/// \warning Calling this function also clears all previous entries.
|
/// \warning Calling this function also clears all previous entries.
|
||||||
void resize(const int new_n,
|
void resize(const int new_n,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue