CGAL 4.5 - Linear and Quadratic Programming Solver
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
QuadraticProgram Concept Reference

Definition

A model of QuadraticProgram describes a convex quadratic program of the form.

(QP)minimizexTDx+cTx+c0subject toAxb,lxu

in n real variables x=(x0,,xn1).

Here,

  • A is an m×n matrix (the constraint matrix),
  • b is an m-dimensional vector (the right-hand side),
  • is an m-dimensional vector of relations from {,=,},
  • l is an n-dimensional vector of lower bounds for x, where ljR{} for all j
  • u is an n-dimensional vector of upper bounds for x, where ujR{} for all j
  • D is a symmetric positive-semidefinite n×n matrix (the quadratic objective function),
  • c is an n-dimensional vector (the linear objective function), and
  • c0 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.

Has Models:

CGAL::Quadratic_program<NT>

CGAL::Quadratic_program_from_mps<NT>

CGAL::Quadratic_program_from_iterators<A_it, B_it, R_it, FL_it, L_it, FU_it, U_it, D_it, C_it>

Requires:
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.
See Also
NonnegativeQuadraticProgram
LinearProgram
NonnegativeLinearProgram

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 b.
 
typedef unspecified_type R_iterator
 A random access iterator type to go over the relations . More...
 
typedef unspecified_type FL_iterator
 A random access iterator type to go over the existence (finiteness) of the lower bounds lj,j=0,,n1. More...
 
typedef unspecified_type L_iterator
 A random acess iterator type to go over the entries of the lower bound vector l.
 
typedef unspecified_type UL_iterator
 A random access iterator type to go over the existence (finiteness) of the upper bounds uj,j=0,,n1. More...
 
typedef unspecified_type U_iterator
 A random acess iterator type to go over the entries of the upper bound vector u.
 
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 b. More...
 
R_iterator get_r () const
 returns an iterator over the entries of . More...
 
FL_iterator get_fl () const
 returns an iterator over the existence of the lower bounds lj,j=0,,n1. More...
 
L_iterator get_l () const
 returns an iterator over the entries of l. More...
 
FU_iterator get_fu () const
 returns an iterator over the existence of the upper bounds uj,j=0,,n1. More...
 
L_iterator get_u () const
 returns an iterator over the entries of u. 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 c. More...
 
std::iterator_traits
< C_iterator >::value_type 
get_c0 () const
 returns the constant term c0 of the objective function.
 

Member Typedef Documentation

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 existence (finiteness) of the lower bounds lj,j=0,,n1.

The value type of FL_iterator is bool.

A random access iterator type to go over the relations .

The value type of R_iterator is CGAL::Comparison_result.

A random access iterator type to go over the existence (finiteness) of the upper bounds uj,j=0,,n1.

The value type of UL_iterator is bool.

Member Function Documentation

A_iterator QuadraticProgram::get_a ( ) const

returns an iterator over the columns of A.

The corresponding past-the-end iterator is get_a()+get_n(). For j=0,,n1, *(get_a()+j) is a random access iterator for column j.

B_iterator QuadraticProgram::get_b ( ) const

returns an iterator over the entries of b.

The corresponding past-the-end iterator is get_b()+get_m().

C_iterator QuadraticProgram::get_c ( ) const

returns an iterator over the entries of c.

The corresponding past-the-end iterator is get_c()+get_n().

D_iterator QuadraticProgram::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,,n1, *(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.

FL_iterator QuadraticProgram::get_fl ( ) const

returns an iterator over the existence of the lower bounds lj,j=0,,n1.

The corresponding past-the-end iterator is get_fl()+get_n(). If *(get_fl()+j) has value true, the variable xj has a lower bound given by *(get_l()+j), otherwise it has no lower bound.

FU_iterator QuadraticProgram::get_fu ( ) const

returns an iterator over the existence of the upper bounds uj,j=0,,n1.

The corresponding past-the-end iterator is get_fu()+get_n(). If *(get_fu()+j) has value true, the variable xj has an upper bound given by *(get_u()+j), otherwise it has no upper bound.

L_iterator QuadraticProgram::get_l ( ) const

returns an iterator over the entries of l.

The corresponding past-the-end iterator is get_l()+get_n(). If *(get_fl()+j) has value false, the value *(get_l()+j) is not accessed.

Precondition
if both *(get_fl()+j) and *(get_fu()+j) have value true, then *(get_l()+j) <= *(get_u()+j).
R_iterator QuadraticProgram::get_r ( ) const

returns an iterator over the entries of .

The corresponding past-the-end iterator is get_r()+get_m(). The value CGAL::SMALLER stands for , CGAL::EQUAL stands for =, and CGAL::LARGER stands for .

L_iterator QuadraticProgram::get_u ( ) const

returns an iterator over the entries of u.

The corresponding past-the-end iterator is get_u()+get_n(). If *(get_fu()+j) has value false, the value *(get_u()+j) is not accessed.

Precondition
if both *(get_fl()+j) and *(get_fu()+j) have value true, then *(get_l()+j) <= *(get_u()+j).