19 #include "Eigen/SparseCore"
24 using namespace Eigen;
104 drwnLPSolver(
const VectorXd& c,
const MatrixXd& A,
const VectorXd& b);
106 drwnLPSolver(
const VectorXd& c,
const MatrixXd& A,
const VectorXd& b,
107 const VectorXd& lb,
const VectorXd& ub);
112 void initialize(
const VectorXd& x);
118 inline const VectorXd&
solution()
const {
return _x; }
122 inline int size()
const {
return _c.rows(); }
128 bool isUnbounded(
unsigned i)
const {
return ((_lb[i] == -DRWN_DBL_MAX) && (_ub[i] == DRWN_DBL_MAX)); }
130 bool isWithinBounds(
const VectorXd& x)
const {
return (x.array() > _lb.array()).all() && (x.array() < _ub.array()).all(); }
133 double barrierFunction(
const VectorXd& x)
const;
152 const SparseMatrix<double>&
_A;
162 drwnSparseLPSolver(
const VectorXd& c,
const SparseMatrix<double>& A,
const VectorXd& b);
164 drwnSparseLPSolver(
const VectorXd& c,
const SparseMatrix<double>& A,
const VectorXd& b,
165 const VectorXd& lb,
const VectorXd& ub);
170 void initialize(
const VectorXd& x);
176 inline const VectorXd&
solution()
const {
return _x; }
180 inline int size()
const {
return _c.rows(); }
186 bool isUnbounded(
unsigned i)
const {
return ((_lb[i] == -DRWN_DBL_MAX) && (_ub[i] == DRWN_DBL_MAX)); }
188 bool isWithinBounds(
const VectorXd& x)
const {
return (x.array() > _lb.array()).all() && (x.array() < _ub.array()).all(); }
191 double barrierFunction(
const VectorXd& x)
const;
static double eps
stopping tolerance
Definition: drwnLPSolver.h:83
MatrixXd _A
linear equality constraint matrix
Definition: drwnLPSolver.h:94
const VectorXd & solution() const
return the current estimate of the solution
Definition: drwnLPSolver.h:118
const SparseMatrix< double > & _A
linear equality constraint matrix
Definition: drwnLPSolver.h:152
int size() const
return the number of dimensions of the state space
Definition: drwnLPSolver.h:122
VectorXd _b
linear equality constraint vector
Definition: drwnLPSolver.h:153
int size() const
return the number of dimensions of the state space
Definition: drwnLPSolver.h:180
VectorXd _x
current estimate of solution
Definition: drwnLPSolver.h:100
static double t0
initial barrier function multiplier
Definition: drwnLPSolver.h:81
VectorXd _ub
upped bound for each variable (DRWN_DBL_MAX for unbounded above)
Definition: drwnLPSolver.h:156
~drwnSparseLPSolver()
destructor
Definition: drwnLPSolver.h:167
const VectorXd & solution() const
return the current estimate of the solution
Definition: drwnLPSolver.h:176
VectorXd _c
linear term in the objective function
Definition: drwnLPSolver.h:149
~drwnLPSolver()
destructor
Definition: drwnLPSolver.h:109
static double alpha
line search stopping criterion in (0, 1/2)
Definition: drwnLPSolver.h:86
VectorXd _ub
upped bound for each variable (DRWN_DBL_MAX for unbounded above)
Definition: drwnLPSolver.h:98
bool isUnbounded(unsigned i) const
returns true if the i-th variable is unbounded
Definition: drwnLPSolver.h:186
bool isWithinBounds(const VectorXd &x) const
returns true if a point is strictly within the lower and upper bounds
Definition: drwnLPSolver.h:188
static double beta
line search backtracking parameter in (0, 1)
Definition: drwnLPSolver.h:87
VectorXd _lb
lower bound for each variable (-DRWN_DBL_MAX for unbounded below)
Definition: drwnLPSolver.h:155
bool isWithinBounds(const VectorXd &x) const
returns true if a point is strictly within the lower and upper bounds
Definition: drwnLPSolver.h:130
double operator[](unsigned i) const
access the i-th dimension of the current solution
Definition: drwnLPSolver.h:182
double operator[](unsigned i) const
access the i-th dimension of the current solution
Definition: drwnLPSolver.h:124
static double mu
barrier function multiplier update
Definition: drwnLPSolver.h:82
Solves equality constrained linear programs with positivity constraints via the log-barrier method...
Definition: drwnLPSolver.h:78
VectorXd _c
linear term in the objective function
Definition: drwnLPSolver.h:91
static unsigned maxiters
maximum number of newton steps per iteration
Definition: drwnLPSolver.h:84
VectorXd _b
linear equality constraint vector
Definition: drwnLPSolver.h:95
bool isUnbounded(unsigned i) const
returns true if the i-th variable is unbounded
Definition: drwnLPSolver.h:128
VectorXd _x
current estimate of solution
Definition: drwnLPSolver.h:158
VectorXd _lb
lower bound for each variable (-DRWN_DBL_MAX for unbounded below)
Definition: drwnLPSolver.h:97
Solves linear programs with sparse equality constraints.
Definition: drwnLPSolver.h:146