#include <CGAL/QP_solution.h>
in
If
If the objective function value becomes arbitrarily small over the feasible region (the set of feasible solutions), the program is called unbounded, and bounded otherwise.
Any program that is both feasible and bounded has at least one
feasible solution
Every convex quadratic program (even if it is infeasible or unbounded) has a 'solution' in form of an object of the class Quadratic_program_solution<ET>.
| |
The exact number type that was used to solve the
program.
| |
| |
An iterator type with value type
Quotient<ET> to go over the values of the variables in the solution.
| |
| |
An iterator type with value type
ET to go over the numerators of the variable values
with respect to a common denominator.
| |
| |
An iterator type with value type int
to go over the indices of the basic variables and the basic constraints.
| |
| |
An iterator type with
value type Quotient<ET> to go over an
| |
| |
An iterator type
with value type ET to go over the numerators of the vector
| |
| |
An iterator type with
value type ET to go over an
| |
| |
An iterator type with
value type ET to go over an
|
| |
constructs a void instance of Quadratic_program_solution<ET> that is associated to
no program.
|
Objects of type Quadratic_program_solution<ET> can be copied and assigned.
Objects of type Quadratic_program_solution<ET> that are associated to an actual program are returned by any of the four functions solve_quadratic_program, solve_linear_program, solve_nonnegative_quadratic_program, and solve_nonnegative_linear_program.
|
| returns true iff sol is not associated to a program. The condition !sol.is_void() is a precondition for all access methods below. |
|
| returns true iff sol is an optimal solution of the associated program. |
|
| returns true iff the associated program is infeasible. |
|
| returns true iff the associated program is unbounded. |
|
| returns the status of the solution; this is one of the values QP_OPTIMAL, QP_INFEASIBLE, and QP_UNBOUNDED, depending on whether the program asociated to sol has an optimal solution, is infeasible, or is unbounded. |
|
| returns the number of iterations that it took to solve the program asociated to sol. |
|
| returns the objective function value of sol. |
|
| returns the numerator of the objective function value of sol. |
|
| |
returns the denominator of the objective function value of sol. | ||
|
|
returns
a random-access iterator over the values of the
variables in sol. The value type is Quotient<ET>, and the valid
iterator range has length |
|
| returns the corresponding past-the-end iterator. |
|
|
returns a random-access iterator it over the values
of the variables in sol, with respect to a common
denominator of all variables. The value type is ET, and the valid
iterator range has length |
|
| returns the corresponding past-the-end iterator. |
|
| |
returns the common denominator of the variable values as referred to by the previous two methods. |
|
| |
returns a random access iterator over the indices of the basic
variables. The value type is int. It is guaranteed that any
variable that is not basic in sol attains one of its bounds.
In particular, if the bounds are of type | ||
|
| returns the corresponding past-the-end iterator. |
|
| returns the number of basic variables, equivalently the length of the range determined by the previous two iterators. |
|
| |
returns a random access iterator over the indices of the basic
constraints in the system | ||
|
| |
returns the corresponding past-the-end iterator. | ||
|
| |
returns the number of basic constraint, equivalently the length of the range determined by the previous two iterators. |
| ||
|
| writes the status of sol to the stream out. In case the status is QP_OPTIMAL, the optimal objective value and the values of the variables at the optimal solution are output as well. For more detailed information about the solution (like basic variables/constraints) please use the dedicated methods of Quadratic_program_solution<ET>. |
By passing a suitable option to the solution function, you can make sure that this check is done automatically after the solution of the program, see Quadratic_program_options. If the check fails, a logfile is generated that contains the details, and an error message is written to std::cerr (see QP_solver/cycling.cpp for an example that uses this option).
| ||
|
| |
returns true iff sol solves the quadratic program qp. If the result is false, you can get a message that describes the problem, through the method get_error(). |
| ||
|
| |
returns true iff sol solves the linear program lp. If the result is false, you can get a message that describes the problem, through the method get_error(). |
| ||
|
| |
returns true iff sol solves the nonnegative quadratic program qp. If the result is false, you can get a message that describes the problem, through the method get_error(). |
QP_solver/first_nonnegative_qp.cpp
| ||
|
| |
returns true iff sol solves the nonnegative linear program lp. If the result is false, you can get a message that describes the problem, through the method get_error(). |
QP_solver/first_nonnegative_lp.cpp
advanced |
A certificate is a vector that admits a simple proof for the correctness of the solution. Any non-void object of Quadratic_program_solution<ET> comes with such a certificate.
Lemma 1 (optimality certificate): A feasible
0,
if
(cT + T A + 2x*TD)j
= 0,
if
0,
if
Proof: Let
For this, we argue as follows.
cTx+ 2x*TDx
cTx+ 2x*TDx+ T(Ax-b)
(by
=
(cT + T A + 2x*TD)x- Tb
(cT + T A + 2x*TD)x* - Tb
(by
=
cTx* + 2x*TDx*
(by 2.)
After adding
and since
|
| |||
returns a random access iterator over the optimality certificate
| ||||
|
| returns the corresponding past-the-end iterator. | ||
| ||||
| ||||
returns a random access iterator over the numerator values
of the optimality certificate | ||||
| ||||
| ||||
returns the corresponding past-the-end iterator. |
Lemma 2 (infeasibility certificate): The program (QP) is
infeasible if an
0
if
T Aj
0
if
Proof: Let us assume for the purpose of obtaining a contradiction
that there is a feasible solution
0
T(Ax-b)
(by
=
j: TAj <0 TAj xj
+ j: TAj >0 TAj xj - T b
j: TAj <0 TAj uj
+ j: TAj >0 TAj lj - T b
(by
>
0
(by 3.)
and this is the desired contradiction
Lemma 3 (unboundedness certificate:) Let
0
if
wj
0
if
The vector
Proof: For a real number
cT x(t) + x(t)TD x(t)
=
cTx* + tcTw+ x*TDx* + 2tx*TDw+ t2 wTDw
=
cTx* + x*TDx* + t(cT + 2x*TD)w+ t2wTDw.
By condition 3., this tends to
| ||||
| ||||
returns a random acess iterator over the unbounded direction
| ||||
| ||||
| ||||
returns the corresponding past-the-end iterator. |
advanced |
The program concepts
QuadraticProgram
LinearProgram
NonnegativeQuadraticProgram
NonnegativeLinearProgram
and the functions that compute objects of class Quadratic_program_solution<ET> from models of these concepts:
solve_quadratic_program
solve_linear_program
solve_nonnegative_quadratic_program
solve_nonnegative_linear_program