CGAL 4.10 - Linear and Quadratic Programming Solver
|
A model of NonnegativeQuadraticProgram
describes a convex quadratic program of the form.
\( \newcommand{\qprel}{\gtreqless} \newcommand{\qpx}{\mathbf{x}} \newcommand{\qpl}{\mathbf{l}} \newcommand{\qpu}{\mathbf{u}} \newcommand{\qpc}{\mathbf{c}} \newcommand{\qpb}{\mathbf{b}} \newcommand{\qpy}{\mathbf{y}} \newcommand{\qpw}{\mathbf{w}} \newcommand{\qplambda}{\mathbf{\lambda}} \)
\begin{eqnarray*} \mbox{(QP)}& \mbox{minimize} & \qpx^{T}D\qpx+\qpc^{T}\qpx+c_0 \\ &\mbox{subject to} & A\qpx\qprel \qpb, \\ & & \qpx \geq 0 \end{eqnarray*}
in \( n\) real variables \( \qpx=(x_0,\ldots,x_{n-1})\). Here,
\( \qprel\) is an \( m\)-dimensional vector of relations from \( \{\leq, =, \geq\}\),
\( D\) is a symmetric positive-semidefinite \( n\times n\) matrix (the quadratic objective function),
\( c_0\) is a constant.
The description is given by appropriate random-access iterators over the program data, see below. The program therefore comes in dense representation which includes zero entries.
CGAL::Quadratic_program_from_mps<NT>
CGAL::Nonnegative_quadratic_program_from_iterators<A_it, B_it, R_it, FL_it, L_it, FU_it, U_it, D_it, C_it>
The value types of all iterator types (nested iterator types, respectively, for A_iterator
and D_iterator
) must be convertible to some common IntegralDomain
ET
.
Types | |
typedef unspecified_type | A_iterator |
A random access iterator type to go columnwise over the constraint matrix \( A\). More... | |
typedef unspecified_type | B_iterator |
A random access iterator type to go over the entries of the right-hand side \( \qpb\). | |
typedef unspecified_type | R_iterator |
A random access iterator type to go over the relations \( \qprel\). More... | |
typedef unspecified_type | D_iterator |
A random access iterator type to go rowwise over the matrix \( 2D\). More... | |
typedef unspecified_type | C_iterator |
A random access iterator type to go over the entries of the linear objective function vector \( c\). | |
Operations | |
int | get_n () const |
returns the number \( n\) of variables (number of columns of \( A\)) in qp . | |
int | get_m () const |
returns the number \( m\) of constraints (number of rows of \( A\)) in qp . | |
A_iterator | get_a () const |
returns an iterator over the columns of \( A\). More... | |
B_iterator | get_b () const |
returns an iterator over the entries of \( \qpb\). More... | |
R_iterator | get_r () const |
returns an iterator over the entries of \( \qprel\). More... | |
D_iterator | get_d () const |
returns an iterator over the rows of \( 2D\). More... | |
C_iterator | get_c () const |
returns an iterator over the entries of \( \qpc\). More... | |
std::iterator_traits < C_iterator >::value_type | get_c0 () const |
returns the constant term \( c_0\) of the objective function. | |
A random access iterator type to go columnwise over the constraint matrix \( A\).
The value type is a random access iterator type for an individual column that goes over the entries in that column.
A random access iterator type to go rowwise over the matrix \( 2D\).
The value type is a random access iterator type for an individual row that goes over the entries in that row, up to (and including) the entry on the main diagonal.
A random access iterator type to go over the relations \( \qprel\).
The value type of R_iterator
is CGAL::Comparison_result
.
A_iterator NonnegativeQuadraticProgram::get_a | ( | ) | const |
B_iterator NonnegativeQuadraticProgram::get_b | ( | ) | const |
returns an iterator over the entries of \( \qpb\).
The corresponding past-the-end iterator is get_b()+get_m()
.
C_iterator NonnegativeQuadraticProgram::get_c | ( | ) | const |
returns an iterator over the entries of \( \qpc\).
The corresponding past-the-end iterator is get_c()+get_n()
.
D_iterator NonnegativeQuadraticProgram::get_d | ( | ) | const |
returns an iterator over the rows of \( 2D\).
The corresponding past-the-end iterator is get_d()+get_n()
. For \( i=0,\ldots,n-1\), *(get_d()+i)
is a random access iterator for the entries in row \( i\) below or on the diagonal. The valid range of this iterator is guaranteed to have length \( i+1\) but not more. Values to the right of the diagonal are deduced from the symmetry requirement on \( D\).
R_iterator NonnegativeQuadraticProgram::get_r | ( | ) | const |
returns an iterator over the entries of \( \qprel\).
The corresponding past-the-end iterator is get_r()+get_m()
. The value CGAL::SMALLER
stands for \( \leq\), CGAL::EQUAL
stands for \( =\), and CGAL::LARGER
stands for \( \geq\).