CGAL::Linear_program_from_iterators<A_it, B_it, R_it, FL_it, L_it, FU_it, U_it, C_it>
#include <CGAL/QP_models.h>
Definition
An object of class Linear_program_from_iterators<A_it, B_it, R_it, FL_it, L_it, FU_it, U_it, C_it> describes a linear program of the form
in n real variables x=(x0,...,xn-1).
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 lj {- } for all j
- u is an n-dimensional vector of upper bounds for
x, where uj { } for all j
- c is an n-dimensional vector (the linear objective
function), and
- c0 is a constant.
This class is simply a wrapper for existing iterators, and it does not
copy the program data.
It frequently happens that all values in one of the vectors from
above are the same, for example if the system Ax ~ b is
actually a system of equations Ax=b. To get an iterator over such a
vector, it is not necessary to store multiple copies of the value in
some container; an instance of the class Const_oneset_iterator<T>,
constructed from the value in question, does the job more efficiently.
Is Model for the Concepts
QuadraticProgram
LinearProgram
Creation
Linear_program_from_iterators<A_it, B_it, R_it, FL_it, L_it, FU_it, U_it, C_it> lp ( |
int n,
int m,
A_it a,
B_it b,
R_it r,
FL_it fl,
L_it l,
FU_it fu,
U_it u,
C_it c,
std::iterator_traits<C_it>value_type c0 = 0); |
|
|
constructs lp from given random-access iterators and the constant c0. The passed iterators are merely stored, no copying of the program data takes place. How these iterators are supposed to encode the linear program is
described in LinearProgram.
|
Example
QP_solver/first_lp_from_iterators.cpp
The following example for the simpler model
Nonnegative_linear_program_from_iterators<A_it, B_it, R_it, C_it>
should give you a flavor of the use of this
model in practice.
QP_solver/solve_convex_hull_containment_lp.h
QP_solver/convex_hull_containment.cpp
See Also
LinearProgram
Quadratic_program<NT>
Quadratic_program_from_mps<NT>