
Definition at line 732 of file lpsimplex.cxx.
| scsolver::numeric::lp::BoundedRevisedSimplexImpl::BoundedRevisedSimplexImpl | ( | BoundedRevisedSimplex * | p | ) |
Definition at line 798 of file lpsimplex.cxx.
| scsolver::numeric::lp::BoundedRevisedSimplexImpl::~BoundedRevisedSimplexImpl | ( | ) |
Definition at line 804 of file lpsimplex.cxx.
| void scsolver::numeric::lp::BoundedRevisedSimplexImpl::solve | ( | ) |
Definition at line 808 of file lpsimplex.cxx.
References scsolver::Debug(), findInitialSolution(), initialize(), isSolutionFeasible(), iterate(), m_aBasicVarId, m_aSkipBasicVarId, m_mxBasicInv, m_mxC, m_mxPriceVector, m_mxX, m_nIter, m_pModel, m_pSelf, scsolver::numeric::Matrix::print(), scsolver::numeric::lp::BaseAlgorithm::setCanonicalSolution(), solvePriceVector(), and scsolver::numeric::Matrix::trans().
| Model* scsolver::numeric::lp::BoundedRevisedSimplexImpl::getModel | ( | ) | const [inline, private] |
Definition at line 778 of file lpsimplex.cxx.
Referenced by calculateNewX(), iterate(), printIterateHeader(), and queryEnteringNBVar().
| bool scsolver::numeric::lp::BoundedRevisedSimplexImpl::findInitialSolution | ( | ) | [private] |
The goal of this method is to find a good feasible point to start from. Such feasible point must satisfy all variable boundaries and constraints.
Definition at line 1299 of file lpsimplex.cxx.
References scsolver::numeric::Matrix::cols(), iterateVarBoundary(), m_mxA, m_mxB, m_pModel, scsolver::repeatString(), and scsolver::numeric::Matrix::rows().
Referenced by solve().
| bool scsolver::numeric::lp::BoundedRevisedSimplexImpl::buildInitialVars | ( | vector< VarBoundary > & | cnNonBasic | ) | [private] |
Go through all individual elements in a given array containing initial non-basic (NB) variables with boundary values. It is a precondition that by the time this method gets called the array already contains the exact number of bounded non-basic variables needed to start iteration.
As I go through the elements, I need to keep track of the sum of (constraint coefficient) x (NB variable value) for each constraint row as a vector (i.e. one-dimentional matrix), and subtract it from the RHS vector in the end in order to solve for a set of initial basic variables.
It may be necessary to check for its feasiblity after the values of the basic variables are computed if one or more of these basic variables happen to be bounded, otherwise no feasiblity check is necessary.
| aArray | array containing all initial non-basic variables and their attributes. |
Definition at line 1335 of file lpsimplex.cxx.
References scsolver::numeric::BOUND_LOWER, scsolver::numeric::BOUND_UPPER, scsolver::numeric::Matrix::cols(), scsolver::Debug(), scsolver::numeric::Matrix::deleteColumns(), scsolver::numeric::Matrix::inverse(), m_aBasicVarId, m_aNonBasicVarBoundType, m_aNonBasicVarId, m_mxA, m_mxB, m_mxBasicInv, m_mxC, m_mxX, m_pModel, scsolver::numeric::Matrix::print(), printElements(), scsolver::numeric::Matrix::rows(), scsolver::numeric::Matrix::swap(), and scsolver::numeric::Matrix::trans().
Referenced by iterateVarBoundary().
| void scsolver::numeric::lp::BoundedRevisedSimplexImpl::initialize | ( | ) | [private] |
Definition at line 849 of file lpsimplex.cxx.
References scsolver::numeric::BOUND_LOWER, scsolver::numeric::Matrix::clear(), scsolver::numeric::Matrix::cols(), scsolver::numeric::EQUAL, scsolver::numeric::lp::BaseAlgorithm::getCanonicalModel(), scsolver::numeric::GREATER_EQUAL, scsolver::numeric::LESS_EQUAL, m_mxA, m_mxB, m_mxBasicInv, m_mxC, m_mxUpdateMatrix, m_pModel, m_pSelf, scsolver::numeric::Matrix::print(), scsolver::numeric::Matrix::resize(), and scsolver::numeric::Matrix::rows().
Referenced by solve().
| bool scsolver::numeric::lp::BoundedRevisedSimplexImpl::iterateVarBoundary | ( | size_t | nIdx, | |
| size_t | nUpper, | |||
| vector< VarBoundary > & | aArray | |||
| ) | [private] |
Iterate through all decision variables and pick up boundary values to use as initial values, then check if the values are feasible.
| nIdx | ||
| nUpper | ||
| aArray |
Definition at line 1457 of file lpsimplex.cxx.
References scsolver::numeric::BOUND_LOWER, scsolver::numeric::BOUND_UPPER, scsolver::numeric::lp::BoundedRevisedSimplexImpl::VarBoundary::BoundData, buildInitialVars(), scsolver::numeric::Matrix::cols(), scsolver::numeric::lp::BoundedRevisedSimplexImpl::VarBoundary::Id, m_mxC, m_pModel, and scsolver::numeric::lp::BoundedRevisedSimplexImpl::VarBoundary::Value.
Referenced by findInitialSolution().
| bool scsolver::numeric::lp::BoundedRevisedSimplexImpl::isSolutionFeasible | ( | const Matrix & | mxX | ) | const [private] |
Definition at line 1510 of file lpsimplex.cxx.
References scsolver::numeric::BOUND_LOWER, scsolver::numeric::BOUND_UPPER, scsolver::numeric::Matrix::cols(), m_mxA, m_mxB, m_mxC, m_pModel, and scsolver::numeric::Matrix::rows().
Referenced by solve().
| const Matrix scsolver::numeric::lp::BoundedRevisedSimplexImpl::solvePriceVector | ( | const SizeTypeContainer & | aBasicVarId, | |
| const Matrix & | mxAInv, | |||
| const Matrix & | mxC | |||
| ) | const [private] |
Definition at line 1530 of file lpsimplex.cxx.
Referenced by solve(), and updateInverseBasicMatrix().
| bool scsolver::numeric::lp::BoundedRevisedSimplexImpl::iterate | ( | ) | [private] |
Definition at line 1042 of file lpsimplex.cxx.
References calculateNewX(), getModel(), m_nIter, printIterateHeader(), queryEnteringNBVar(), updateInverseBasicMatrix(), and updateNBVars().
Referenced by solve().
| bool scsolver::numeric::lp::BoundedRevisedSimplexImpl::queryEnteringNBVar | ( | EnterBasicVar & | rEnterVar | ) | [private] |
This method determines an entering non-basic (NB) variable if any. If there is no entering non-basic, then that means an optimum solution is found, and it returns true. Otherwise it returns false.
Definition at line 1066 of file lpsimplex.cxx.
References scsolver::numeric::BOUND_LOWER, scsolver::numeric::BOUND_UPPER, scsolver::numeric::lp::BoundedRevisedSimplexImpl::EnterBasicVar::BoundData, scsolver::Debug(), scsolver::numeric::Matrix::getColumn(), getModel(), scsolver::numeric::lp::Model::getVerbose(), scsolver::numeric::lp::BoundedRevisedSimplexImpl::EnterBasicVar::Id, isPriceBoundEligible(), m_aNonBasicVarBoundType, m_aNonBasicVarId, m_mxA, m_mxC, m_mxPriceVector, m_pModel, and scsolver::numeric::lp::BoundedRevisedSimplexImpl::EnterBasicVar::Price.
Referenced by iterate().
| void scsolver::numeric::lp::BoundedRevisedSimplexImpl::calculateNewX | ( | const EnterBasicVar & | aEnterVar, | |
| size_t & | nLeaveVarId, | |||
| Matrix & | mxDX | |||
| ) | [private] |
This methods calculates, given an entering non-basic variable, a dX, lambda, and leaving non-basic variable. It then calculates a new X from them.
Definition at line 1144 of file lpsimplex.cxx.
References scsolver::numeric::BOUND_LOWER, scsolver::numeric::BOUND_UPPER, scsolver::numeric::lp::BoundedRevisedSimplexImpl::EnterBasicVar::BoundData, scsolver::numeric::Matrix::getColumn(), getLambda(), getModel(), scsolver::numeric::lp::BoundedRevisedSimplexImpl::EnterBasicVar::Id, m_aBasicVarId, m_aNonBasicVarId, m_mxA, m_mxBasicInv, m_mxX, m_pModel, scsolver::numeric::Matrix::print(), and scsolver::numeric::Matrix::trans().
Referenced by iterate().
| void scsolver::numeric::lp::BoundedRevisedSimplexImpl::updateNBVars | ( | const EnterBasicVar & | aEnterVar, | |
| size_t | nLeaveVarId | |||
| ) | [private] |
Given entering and leaving basic variables, update corresponding member containers to reflect the change.
Definition at line 1209 of file lpsimplex.cxx.
References scsolver::numeric::BOUND_LOWER, scsolver::numeric::BOUND_UPPER, scsolver::numeric::lp::BoundedRevisedSimplexImpl::EnterBasicVar::BoundData, scsolver::numeric::lp::BoundedRevisedSimplexImpl::EnterBasicVar::Id, m_aNonBasicVarBoundType, m_aNonBasicVarId, m_mxX, and m_pModel.
Referenced by iterate().
| void scsolver::numeric::lp::BoundedRevisedSimplexImpl::updateInverseBasicMatrix | ( | const EnterBasicVar & | aEnterVar, | |
| size_t | nLeaveVarId, | |||
| const Matrix & | mxDX | |||
| ) | [private] |
Definition at line 1252 of file lpsimplex.cxx.
References scsolver::numeric::BOUND_LOWER, scsolver::numeric::lp::BoundedRevisedSimplexImpl::EnterBasicVar::BoundData, scsolver::numeric::Matrix::cols(), scsolver::numeric::lp::BoundedRevisedSimplexImpl::EnterBasicVar::Id, scsolver::numeric::Matrix::isSquare(), m_aBasicVarId, m_mxBasicInv, m_mxC, m_mxPriceVector, m_pModel, scsolver::numeric::Matrix::rows(), and solvePriceVector().
Referenced by iterate().
| void scsolver::numeric::lp::BoundedRevisedSimplexImpl::printIterateHeader | ( | ) | const [private] |
Definition at line 914 of file lpsimplex.cxx.
References scsolver::numeric::BOUND_LOWER, scsolver::numeric::BOUND_UPPER, getModel(), m_aBasicVarId, m_aNonBasicVarBoundType, m_aNonBasicVarId, m_mxBasicInv, m_mxC, m_mxPriceVector, m_mxX, m_nIter, scsolver::numeric::Matrix::print(), printElements(), scsolver::repeatString(), and scsolver::numeric::Matrix::trans().
Referenced by iterate().
| bool scsolver::numeric::lp::BoundedRevisedSimplexImpl::isPriceBoundEligible | ( | const EnterBasicVar & | aVar | ) | const [private] |
Definition at line 960 of file lpsimplex.cxx.
References scsolver::numeric::BOUND_LOWER, scsolver::numeric::BOUND_UPPER, scsolver::numeric::lp::BoundedRevisedSimplexImpl::EnterBasicVar::BoundData, scsolver::numeric::GOAL_MAXIMIZE, scsolver::numeric::GOAL_MINIMIZE, m_pModel, and scsolver::numeric::lp::BoundedRevisedSimplexImpl::EnterBasicVar::Price.
Referenced by queryEnteringNBVar().
| void scsolver::numeric::lp::BoundedRevisedSimplexImpl::getLambda | ( | const Matrix & | X, | |
| const Matrix & | dX, | |||
| double & | rLambda, | |||
| size_t & | rLeaveVarId | |||
| ) | const [private] |
Definition at line 988 of file lpsimplex.cxx.
References scsolver::numeric::BOUND_LOWER, scsolver::numeric::BOUND_UPPER, m_pModel, and scsolver::numeric::Matrix::rows().
Referenced by calculateNewX().
Definition at line 763 of file lpsimplex.cxx.
Referenced by buildInitialVars(), calculateNewX(), initialize(), printIterateHeader(), solve(), and updateInverseBasicMatrix().
Definition at line 765 of file lpsimplex.cxx.
Referenced by printIterateHeader(), queryEnteringNBVar(), solve(), and updateInverseBasicMatrix().
Definition at line 766 of file lpsimplex.cxx.
Referenced by buildInitialVars(), calculateNewX(), printIterateHeader(), solve(), and updateNBVars().
size_t scsolver::numeric::lp::BoundedRevisedSimplexImpl::m_nIter [private] |
Definition at line 767 of file lpsimplex.cxx.
Referenced by iterate(), printIterateHeader(), and solve().
Definition at line 769 of file lpsimplex.cxx.
Referenced by buildInitialVars(), calculateNewX(), findInitialSolution(), initialize(), isSolutionFeasible(), and queryEnteringNBVar().
Definition at line 769 of file lpsimplex.cxx.
Referenced by buildInitialVars(), findInitialSolution(), initialize(), and isSolutionFeasible().
Definition at line 769 of file lpsimplex.cxx.
Referenced by buildInitialVars(), initialize(), isSolutionFeasible(), iterateVarBoundary(), printIterateHeader(), queryEnteringNBVar(), solve(), and updateInverseBasicMatrix().
std::vector<bool> scsolver::numeric::lp::BoundedRevisedSimplexImpl::m_aBasicVar [private] |
Definition at line 770 of file lpsimplex.cxx.
Definition at line 771 of file lpsimplex.cxx.
Referenced by buildInitialVars(), calculateNewX(), printIterateHeader(), solve(), and updateInverseBasicMatrix().
Definition at line 772 of file lpsimplex.cxx.
Referenced by buildInitialVars(), calculateNewX(), printIterateHeader(), queryEnteringNBVar(), and updateNBVars().
std::vector<size_t> scsolver::numeric::lp::BoundedRevisedSimplexImpl::m_aSkipBasicVarId [private] |
std::vector<BoundType> scsolver::numeric::lp::BoundedRevisedSimplexImpl::m_aNonBasicVarBoundType [private] |
Definition at line 774 of file lpsimplex.cxx.
Referenced by buildInitialVars(), printIterateHeader(), queryEnteringNBVar(), and updateNBVars().
std::auto_ptr<Model> scsolver::numeric::lp::BoundedRevisedSimplexImpl::m_pModel [private] |
Definition at line 776 of file lpsimplex.cxx.
Referenced by buildInitialVars(), calculateNewX(), findInitialSolution(), getLambda(), initialize(), isPriceBoundEligible(), isSolutionFeasible(), iterateVarBoundary(), queryEnteringNBVar(), solve(), updateInverseBasicMatrix(), and updateNBVars().
1.5.3