CGAL::solve_nonnegative_linear_program

#include <CGAL/QP_functions.h>

This function solves a nonnegative linear program, using some exact Integral Domain ET for its computations. Various options may be provided, see Quadratic_program_options.

template <NonnegativeLinearProgram, ET>
Quadratic_program_solution<ET>
solve_nonnegative_linear_program ( NonnegativeLinearProgram lp,
ET,
Quadratic_program_options options = Quadratic_program_options())
returns the solution of the nonnegative linear program lp, solved with exact number type ET.

Requirements

ET is a model of the concepts IntegralDomain and RealEmbeddable; it must be an exact type, and all entries of qp are convertible to ET.

Here are some recommended combinations of input type (the type of the qp entries) and ET.

input type | ET

double | MP_Float, Gmpzf, or Gmpq
int | MP_Float, or Gmpz
any exact type NT | NT

Note: by default, this function performs a large number of runtime-checks to ensure consistency during the solution process. However, these checks slow down the computations by a considerable factor. For maximum efficiency, it is advisable to define the macros CGAL_QP_NO_ASSERTIONS or NDEBUG.

Example

QP_solver/first_nonnegative_lp.cpp

See Also

The models of NonnegativeLinearProgram:

Quadratic_program<NT>
Quadratic_program_from_mps<NT>
Nonnegative_linear_program_from_iterators<A_it, B_it, R_it, C_it>