20 #ifndef NUMERICS_LEMKE_ALGORITHM_H_
21 #define NUMERICS_LEMKE_ALGORITHM_H_
32 LemkeAlgorithm(
const fmatvec::SqrMat & M_,
const fmatvec::Vec & q_,
const bool & DEBUGLEVEL_ = 0) :
34 assert(M_.rows() == q.size());
35 assert(M_.cols() == q.size());
38 LemkeAlgorithm(
const fmatvec::SymMat & M_,
const fmatvec::Vec & q_,
const bool & DEBUGLEVEL_ = 0) :
61 void setSystem(
const fmatvec::SqrMat & M_,
const fmatvec::Vec & q_) {
62 assert(M_.rows() == q_.size());
63 assert(M_.cols() == q_.size());
71 void setSystem(
const fmatvec::SymMat & M_,
const fmatvec::Vec & q_) {
72 M = fmatvec::SqrMat(M_.size(), M_.size(), fmatvec::NONINIT);
73 for(
int i = 0; i < M.size(); i++)
74 for(
int j = 0; j < M.size(); j++)
83 fmatvec::Vec
solve(
unsigned int maxloops = 0);
89 int findLexicographicMinimum(
const fmatvec::Mat &A,
const int & pivotColIndex);
90 bool LexicographicPositive(
const fmatvec::Vec & v);
91 void GaussJordanEliminationStep(fmatvec::Mat &A,
int pivotRowIndex,
int pivotColumnIndex,
const std::vector<size_t> & basis);
92 bool greaterZero(
const fmatvec::Vec & vector);
93 bool validBasis(
const std::vector<size_t> & basis);