|
Dense vector.Class VectorBase provides dense linear algebra vectors. It does not provide memory management for the array of values. Instead, the constructor requires a pointer to a memory block large enough to fit the desired dimension of Real or Rational values.
More...
#include <dsvectorbase.h>
|
template<> |
VectorBase< Rational > & | multAdd (const Rational &x, const SVectorBase< Rational > &vec) |
| Addition of scaled vector, specialization for rationals. More...
|
|
template<> |
VectorBase< Rational > & | multSub (const Rational &x, const SVectorBase< Rational > &vec) |
| Subtraction of scaled vector, specialization for rationals. More...
|
|
template<> |
VectorBase< Real > & | operator= (const VectorBase< Real > &vec) |
| Assignment operator (specialization for Real). More...
|
|
template<> |
VectorBase< Real > & | operator= (const VectorBase< Rational > &vec) |
| Assignment operator (specialization for Real). More...
|
|
template<> |
void | clear () |
| Set vector to 0 (specialization for Real). More...
|
|
template<> |
Rational | operator* (const VectorBase< Rational > &vec) const |
| Inner product. More...
|
|
|
| VectorBase (int p_dimen, R *p_val) |
| Constructor. More...
|
|
template<class S > |
VectorBase< R > & | operator= (const VectorBase< S > &vec) |
| Assignment operator. More...
|
|
VectorBase< R > & | operator= (const VectorBase< R > &vec) |
| Assignment operator. More...
|
|
template<class S > |
VectorBase< R > & | operator= (const SVectorBase< S > &vec) |
| Assignment operator. More...
|
|
template<class S > |
VectorBase< R > & | operator= (const SSVectorBase< S > &vec) |
| Assignment operator. More...
|
|
template<class S > |
VectorBase< R > & | assign (const SVectorBase< S > &vec) |
| Assign values of vec . More...
|
|
template<class S > |
VectorBase< R > & | assign (const SSVectorBase< S > &vec) |
| Assign values of vec . More...
|
|
|
void | clear () |
| Set vector to 0. More...
|
|
template<class S > |
VectorBase< R > & | operator+= (const VectorBase< S > &vec) |
| Addition. More...
|
|
template<class S > |
VectorBase< R > & | operator+= (const SVectorBase< S > &vec) |
| Addition. More...
|
|
template<class S > |
VectorBase< R > & | operator+= (const SSVectorBase< S > &vec) |
| Addition. More...
|
|
template<class S > |
VectorBase< R > & | operator-= (const VectorBase< S > &vec) |
| Subtraction. More...
|
|
template<class S > |
VectorBase< R > & | operator-= (const SVectorBase< S > &vec) |
| Subtraction. More...
|
|
template<class S > |
VectorBase< R > & | operator-= (const SSVectorBase< S > &vec) |
| Subtraction. More...
|
|
template<class S > |
VectorBase< R > & | operator*= (const S &x) |
| Scaling. More...
|
|
template<class S > |
VectorBase< R > & | operator/= (const S &x) |
| Division. More...
|
|
R | operator* (const VectorBase< R > &vec) const |
| Inner product. More...
|
|
R | operator* (const SVectorBase< R > &vec) const |
| Inner product. More...
|
|
R | operator* (const SSVectorBase< R > &vec) const |
| Inner product. More...
|
|
R | maxAbs () const |
| Maximum absolute value, i.e., infinity norm. More...
|
|
R | minAbs () const |
| Minimum absolute value. More...
|
|
Real | length () const |
| Floating point approximation of euclidian norm (without any approximation guarantee). More...
|
|
R | length2 () const |
| Squared norm. More...
|
|
template<class S , class T > |
VectorBase< R > & | multAdd (const S &x, const VectorBase< T > &vec) |
| Addition of scaled vector. More...
|
|
template<class S , class T > |
VectorBase< R > & | multAdd (const S &x, const SVectorBase< T > &vec) |
| Addition of scaled vector. More...
|
|
template<class S , class T > |
VectorBase< R > & | multSub (const S &x, const SVectorBase< T > &vec) |
| Subtraction of scaled vector. More...
|
|
template<class S , class T > |
VectorBase< R > & | multAdd (const S &x, const SSVectorBase< T > &vec) |
| Addition of scaled vector. More...
|
|
|
R * | get_ptr () |
| Conversion to C-style pointer. More...
|
|
const R * | get_const_ptr () const |
| Conversion to C-style pointer. More...
|
|
bool | isConsistent () const |
| Consistency check. More...
|
|
template<class R>
class soplex::VectorBase< R >
Dense vector.
Class VectorBase provides dense linear algebra vectors. It does not provide memory management for the array of values. Instead, the constructor requires a pointer to a memory block large enough to fit the desired dimension of Real or Rational values.
After construction, the values of a VectorBase can be accessed with the subscript operator[](). Safety is provided by qchecking of array bound when accessing elements with the subscript operator[]() (only when compiled without -DNDEBUG ).
A VectorBase is distinguished from a simple array of Reals or Rationals by providing a set of mathematical operations. Since VectorBase does not provide any memory management features, no operations are available that would require allocation of temporary memory space.
The following mathematical operations are provided by class VectorBase (VectorBase a , b ; R x ):
When using any of these operations, the vectors involved must be of the same dimension. Also an SVectorBase b is allowed if it does not contain nonzeros with index greater than the dimension of a.q
Definition at line 28 of file dsvectorbase.h.
Constructor.
There is no default constructor since the storage for a VectorBase must be provided externally. Storage must be passed as a memory block val at construction. It must be large enough to fit at least dimen values.
Definition at line 101 of file vectorbase.h.
Set vector to 0.
Definition at line 219 of file vectorbase.h.
Referenced by SLUFactor::clear(), SLUFactorRational::clear(), SPxSolver::clear(), SSVectorBase< Real >::clear(), SPxLPBase< Real >::computeDualActivity(), SPxSolver::computeFrhs(), SPxLPBase< Real >::computePrimalActivity(), SPxSolver::getDualfarkas(), SPxSolver::getPrimalray(), SPxSolver::getRedCost(), main(), SPxBasis::multBaseWith(), SLUFactor::operator=(), SLUFactorRational::operator=(), SPxSumST::setupWeights(), SLUFactor::solve2right4update(), SLUFactorRational::solve2right4update(), SLUFactor::solve3right4update(), SLUFactorRational::solve3right4update(), SLUFactor::solveLeft(), SLUFactorRational::solveLeft(), SSVectorBase< Real >::SSVectorBase(), and SPxSolver::testVecs().
Dimension of vector.
Definition at line 174 of file vectorbase.h.
Referenced by SoPlex::_solveRealForRational(), LPColSetBase< Real >::add(), LPRowSetBase< Real >::add(), SPxLPBase< Real >::addDualActivity(), SPxDevexPR::addedCoVecs(), SPxWeightPR::addedCoVecs(), SPxSteepPR::addedCoVecs(), SPxDevexPR::addedVecs(), SPxWeightPR::addedVecs(), SPxSteepPR::addedVecs(), SPxLPBase< Real >::addPrimalActivity(), SLUFactorRational::assign(), SPxLPBase< Real >::changeLhs(), SPxSolver::changeLower(), SPxLPBase< Real >::changeLower(), SPxLPBase< Real >::changeMaxObj(), SPxLPBase< Real >::changeObj(), SPxLPBase< Real >::changeRhs(), SPxLPBase< Real >::changeRowObj(), SPxSolver::changeUpper(), SPxLPBase< Real >::changeUpper(), SLUFactorRational::clear(), SPxLPBase< Real >::computeDualActivity(), SPxLPBase< Real >::computePrimalActivity(), LPColSetBase< Real >::create(), LPRowSetBase< Real >::create(), DSVectorBase< R >::DSVectorBase(), DVectorBase< Real >::DVectorBase(), DVectorBase< R >::DVectorBase(), SPxWeightST::generate(), SoPlex::getBoundViolationRational(), SoPlex::getBoundViolationReal(), SoPlex::getDualFarkasRational(), SoPlex::getDualFarkasReal(), SPxPricer::getDualNorms(), SoPlex::getDualRational(), SoPlex::getDualReal(), SoPlex::getDualViolationRational(), SoPlex::getDualViolationReal(), SPxPricer::getNdualNorms(), SoPlex::getPrimalRational(), SoPlex::getPrimalRayRational(), SoPlex::getPrimalRayReal(), SoPlex::getPrimalReal(), SoPlex::getRedCostRational(), SoPlex::getRedCostReal(), SoPlex::getRedCostViolationRational(), SoPlex::getRedCostViolationReal(), SoPlex::getRowViolationRational(), SoPlex::getRowViolationReal(), SoPlex::getSlacksRational(), SoPlex::getSlacksReal(), SPxDevexPR::init(), SPxDevexPR::isConsistent(), SPxWeightPR::isConsistent(), VectorBase< Real >::isConsistent(), LPColSetBase< Real >::isConsistent(), LPRowSetBase< Real >::isConsistent(), SPxSolver::isConsistent(), soplex::LPFwriteObjective(), CLUFactorRational::makeLvec(), VectorBase< Real >::maxAbs(), SPxFastRT::maxDelta(), VectorBase< Real >::minAbs(), SPxFastRT::minDelta(), CLUFactorRational::minLMem(), CLUFactorRational::minRowMem(), SPxBasis::multBaseWith(), SPxBasis::multWithBase(), VectorBase< R >::operator*(), soplex::operator*(), VectorBase< Real >::operator*=(), soplex::operator+(), VectorBase< Real >::operator+=(), soplex::operator-(), VectorBase< Real >::operator-=(), VectorBase< Real >::operator/=(), VectorBase< Real >::operator=(), DVectorBase< Real >::operator=(), DSVectorBase< R >::operator=(), VectorBase< R >::operator=(), SVectorBase< R >::operator=(), soplex::operator>>(), SPxSolver::perturbMax(), SPxSolver::perturbMin(), soplex::reconstructVector(), CLUFactorRational::remaxRow(), SPxWeightPR::removedCoVec(), SPxSteepPR::removedCoVec(), SPxWeightPR::removedCoVecs(), SPxSteepPR::removedCoVecs(), SPxWeightPR::removedVec(), SPxSteepPR::removedVec(), SPxWeightPR::removedVecs(), SPxSteepPR::removedVecs(), DVectorBase< R >::reSize(), SPxDevexPR::selectEnterDenseCoDim(), SPxDevexPR::selectEnterDenseDim(), SPxDevexPR::selectEnterSparseCoDim(), SPxDevexPR::selectEnterSparseDim(), SPxDevexPR::selectLeaveX(), SPxPricer::setDualNorms(), SPxSolver::setupPupdate(), SPxSteepPR::setupWeights(), SPxVectorST::setupWeights(), SLUFactorRational::SLUFactorRational(), CLUFactorRational::solveLleftForest(), CLUFactorRational::solveLleftForestNoNZ(), CLUFactorRational::solveLleftNoNZ(), CLUFactorRational::solveUleft(), CLUFactorRational::solveUleftNoNZ(), CLUFactorRational::solveUpdateLeft(), SPxLPBase< Real >::subDualActivity(), SPxScaler::unscaleDual(), SPxScaler::unscalePrimal(), SPxScaler::unscaleRedCost(), SPxScaler::unscaleSlacks(), SPxMainSM::unsimplify(), CLUFactorRational::vSolveUpdateRight(), and CLUFactorRational::vSolveUpdateRightNoNZ().
const R* get_const_ptr |
( |
| ) |
const |
Conversion to C-style pointer.
This function serves for using a VectorBase in an C-style function. It returns a pointer to the first value of the array.
Definition at line 412 of file vectorbase.h.
Referenced by SPxDevexPR::buildBestPriceVectorEnterCoDim(), SPxSteepPR::buildBestPriceVectorEnterCoDim(), SPxDevexPR::buildBestPriceVectorEnterDim(), SPxSteepPR::buildBestPriceVectorEnterDim(), SPxDevexPR::buildBestPriceVectorLeave(), SPxSteepPR::buildBestPriceVectorLeave(), SPxSteepPR::entered4(), SPxSteepPR::left4(), SPxFastRT::maxDelta(), SPxFastRT::maxSelect(), SPxFastRT::minDelta(), SPxFastRT::minSelect(), SPxWeightPR::operator=(), SPxSolver::perturbMax(), SPxSolver::perturbMin(), SPxDefaultRT::selectEnter(), SPxHarrisRT::selectEnter(), SPxBoundFlippingRT::selectEnter(), SPxDevexPR::selectEnterDenseCoDim(), SPxSteepPR::selectEnterDenseCoDim(), SPxDevexPR::selectEnterDenseDim(), SPxSteepPR::selectEnterDenseDim(), SPxDevexPR::selectEnterHyperCoDim(), SPxSteepPR::selectEnterHyperCoDim(), SPxDevexPR::selectEnterHyperDim(), SPxSteepPR::selectEnterHyperDim(), SPxDevexPR::selectEnterSparseCoDim(), SPxSteepPR::selectEnterSparseCoDim(), SPxDevexPR::selectEnterSparseDim(), SPxSteepPR::selectEnterSparseDim(), SPxDefaultRT::selectLeave(), SPxHarrisRT::selectLeave(), SPxWeightPR::selectLeave(), SPxBoundFlippingRT::selectLeave(), SPxDevexPR::selectLeaveHyper(), SPxSteepPR::selectLeaveHyper(), SPxDevexPR::selectLeaveSparse(), SPxSteepPR::selectLeaveSparse(), SPxDevexPR::selectLeaveX(), SPxSteepPR::selectLeaveX(), SPxWeightPR::setRep(), SPxSumST::setupWeights(), and SPxWeightPR::SPxWeightPR().
Conversion to C-style pointer.
This function serves for using a VectorBase in an C-style function. It returns a pointer to the first value of the array.
- Todo:
- check whether this non-const c-style access should indeed be public
Definition at line 403 of file vectorbase.h.
Referenced by SLUFactor::assign(), SLUFactorRational::assign(), SLUFactorRational::change(), SLUFactor::change(), SPxSteepPR::entered4(), SSVectorBase< Real >::get_ptr(), SPxSteepPR::left4(), SLUFactor::load(), SLUFactorRational::load(), SPxSumST::setupWeights(), SLUFactor::SLUFactor(), SLUFactorRational::SLUFactorRational(), SLUFactor::solve2right4update(), SLUFactorRational::solve2right4update(), SLUFactor::solve3right4update(), SLUFactorRational::solve3right4update(), SLUFactor::solveLeft(), SLUFactorRational::solveLeft(), SLUFactor::solveRight(), and SLUFactorRational::solveRight().
bool isConsistent |
( |
| ) |
const |
Addition of scaled vector.
Definition at line 369 of file vectorbase.h.
Referenced by SoPlex::_factorizeColumnRational(), SoPlex::_untransformFeasibility(), SPxLPBase< Real >::addDualActivity(), SPxSolver::addedRows(), SPxLPBase< Real >::addPrimalActivity(), SPxLPBase< Real >::computeDualActivity(), SPxSolver::computeFrhs(), SPxSolver::computeFrhs1(), SPxSolver::computeFrhsXtra(), SPxLPBase< Real >::computePrimalActivity(), SPxSolver::enter(), SPxSolver::leave(), SSVectorBase< Real >::multAdd(), SPxBasis::multBaseWith(), SPxSumST::setupWeights(), and SPxSolver::ungetEnterVal().
Return n 'th value by reference.
Definition at line 180 of file vectorbase.h.
const R& operator[] |
( |
int |
n | ) |
const |
Dimension of vector.
Definition at line 83 of file vectorbase.h.
Referenced by VectorBase< Real >::clear(), VectorBase< R >::clear(), VectorBase< Real >::dim(), DVectorBase< R >::DVectorBase(), VectorBase< Real >::maxAbs(), VectorBase< Real >::minAbs(), VectorBase< Real >::multAdd(), VectorBase< Real >::operator*(), VectorBase< R >::operator*(), VectorBase< Real >::operator*=(), VectorBase< Real >::operator+=(), VectorBase< Real >::operator-=(), VectorBase< Real >::operator=(), and VectorBase< R >::operator=().
Values of vector.
The memory block pointed to by val must at least have size dimen * sizeof(R).
Definition at line 87 of file vectorbase.h.
Referenced by VectorBase< R >::assign(), SSVectorBase< R >::assign2product1(), SSVectorBase< R >::assign2productAndSetup(), SSVectorBase< R >::assign2productFull(), SSVectorBase< R >::assign2productShort(), VectorBase< R >::clear(), DVectorBase< R >::DVectorBase(), VectorBase< Real >::get_const_ptr(), VectorBase< Real >::get_ptr(), VectorBase< R >::multAdd(), VectorBase< R >::operator*(), SSVectorBase< Real >::operator*(), VectorBase< R >::operator=(), SSVectorBase< Real >::operator=(), DVectorBase< R >::reSize(), and SSVectorBase< Real >::setup_and_assign().
|