|
| 1 | +/*! |
| 2 | +\ingroup PkgSolverInterfaceConcepts |
| 3 | +\cgalConcept |
| 4 | +
|
| 5 | +A concept that describes the set of methods used to define and solve a |
| 6 | +quadratic programming (`qp`) problem of the general form: |
| 7 | +<center> |
| 8 | +\f{eqnarray*}{ |
| 9 | +& \mbox{minimize} & \frac{1}{2}\mathbf{x}^{T}P\mathbf{x} + \mathbf{q}^{T}\mathbf{x} + r \\ |
| 10 | +& \mbox{subject to} & \mathbf{l} \leq A\mathbf{x} \leq \mathbf{u} |
| 11 | +\f} |
| 12 | +</center> |
| 13 | +in \f$ n \f$ real variables \f$ \mathbf{x} = (x_0, \ldots, x_{n-1}) \f$ and \f$ m \f$ constraints. |
| 14 | +
|
| 15 | +Here, |
| 16 | +<UL> |
| 17 | +<LI>\f$ P \f$ is a symmetric positive-semidefinite \f$ n \times n\f$ matrix (the quadratic objective function), |
| 18 | +<LI>\f$ \mathbf{q} \f$ is an \f$ n \f$-dimensional vector (the linear objective function), |
| 19 | +<LI>\f$ r \f$ is a constant, |
| 20 | +<LI>\f$ A \f$ is an \f$ m\times n\f$ matrix (the constraint matrix), |
| 21 | +<LI>\f$ \mathbf{l} \f$ is an \f$ m \f$-dimensional vector of lower constraint bounds, |
| 22 | +where \f$ l_i \in \mathbb{R} \cup \{-\infty\} \f$ for all \f$ i \f$, |
| 23 | +<LI>\f$ \mathbf{u} \f$ is an \f$ m \f$-dimensional vector of upper constraint bounds, |
| 24 | +where \f$ u_i \in \mathbb{R} \cup \{+\infty\} \f$ for all \f$ i \f$. |
| 25 | +</UL> |
| 26 | +
|
| 27 | +\cgalHasModel |
| 28 | +`CGAL::OSQP_quadratic_program_traits<T>` |
| 29 | +*/ |
| 30 | +class QuadraticProgramTraits { |
| 31 | + |
| 32 | +public: |
| 33 | + |
| 34 | + /// \name Memory |
| 35 | + /// @{ |
| 36 | + |
| 37 | + /*! |
| 38 | + Allocates memory for `n` variables and `m` constraints in `qp`. |
| 39 | + */ |
| 40 | + void resize(const std::size_t n, const std::size_t m) { } |
| 41 | + |
| 42 | + /// @} |
| 43 | + |
| 44 | + /// \name Initialization |
| 45 | + /// @{ |
| 46 | + |
| 47 | + /*! |
| 48 | + Sets the entries `Pij` and `Pji` of `qp` to `value`. |
| 49 | + */ |
| 50 | + void set_P(const std::size_t i, const std::size_t j, const FT value) { } |
| 51 | + |
| 52 | + /*! |
| 53 | + Sets the entry `qi` of `qp` to `value`. |
| 54 | + */ |
| 55 | + void set_q(const std::size_t i, const FT value) { } |
| 56 | + |
| 57 | + /*! |
| 58 | + Sets the entry `r` of `qp` to `value`. |
| 59 | + */ |
| 60 | + void set_r(const FT value) { } |
| 61 | + |
| 62 | + /*! |
| 63 | + Sets the entry `Aij` in the row `i` and column `j` of |
| 64 | + the constraint matrix `A` of `qp` to `value`. |
| 65 | + */ |
| 66 | + void set_A(const std::size_t i, const std::size_t j, const FT value) { } |
| 67 | + |
| 68 | + /*! |
| 69 | + Sets the entry `li` of `qp` to `value`. |
| 70 | + */ |
| 71 | + void set_l(const std::size_t i, const FT value) { } |
| 72 | + |
| 73 | + /*! |
| 74 | + Sets the entry `ui` of `qp` to `value`. |
| 75 | + */ |
| 76 | + void set_u(const std::size_t i, const FT value) { } |
| 77 | + |
| 78 | + /// @} |
| 79 | + |
| 80 | + /// \name Solution |
| 81 | + /// @{ |
| 82 | + |
| 83 | + /*! |
| 84 | + \brief solves the quadratic program. |
| 85 | +
|
| 86 | + Number of values in `solution` equals to the number `n` of values in the vector `x`. |
| 87 | +
|
| 88 | + \tparam OutIterator |
| 89 | + a model of `OutputIterator` that accepts values of type `FieldNumberType` |
| 90 | +
|
| 91 | + \param solution |
| 92 | + an output iterator with the solution |
| 93 | +
|
| 94 | + \returns a status of the computation `success == true` |
| 95 | + */ |
| 96 | + template<typename OutIterator> |
| 97 | + bool solve(OutIterator solution) { } |
| 98 | + |
| 99 | + /// @} |
| 100 | +}; |
0 commit comments