\(\newcommand{\W}[1]{ \; #1 \; }\) \(\newcommand{\R}[1]{ {\rm #1} }\) \(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} }\) \(\newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} }\) \(\newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} }\) \(\newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }\)
lp_box¶
abs_normal: Solve a Linear Program With Box Constraints¶
Prototype¶
template <class Vector>
bool lp_box(
size_t level ,
const Vector& A ,
const Vector& b ,
const Vector& c ,
const Vector& d ,
size_t maxitr ,
Vector& xout )
Source¶
This following is a link to the source code for this example: lp_box.hpp .
Problem¶
We are given \(A \in \B{R}^{m \times n}\), \(b \in \B{R}^m\), \(c \in \B{R}^n\), \(d \in \B{R}^n\), This routine solves the problem
level¶
This value is less that or equal two.
If level == 0 ,
no tracing is printed.
If level >= 1 ,
a trace of the lp_box
operations is printed.
If level >= 2 ,
the objective and primal variables \(x\) are printed
at each simplex_method iteration.
If level == 3 ,
the simplex tableau is printed at each simplex iteration.
d¶
This is the vector \(d\) in the problem. If \(d_j\) is infinity, there is no limit for the size of \(x_j\).