Scippy

SoPlex

Sequential object-oriented simPlex

SPxWeightPR Class Reference

Weighted pricing.Class SPxWeightPR is an implemantation class of SPxPricer that uses weights for columns and rows for selecting the Simplex pivots. The weights are computed by methods computeCP() and computeRP() which may be overridden by derived classes. More...

#include <spxweightpr.h>

Inheritance diagram for SPxWeightPR:

Public Member Functions

Construction / destruction
 SPxWeightPR ()
 default constructor More...
 
 SPxWeightPR (const SPxWeightPR &old)
 copy constructor More...
 
SPxWeightPRoperator= (const SPxWeightPR &rhs)
 assignment operator More...
 
virtual ~SPxWeightPR ()
 destructor More...
 
virtual SPxPricerclone () const
 clone function for polymorphism More...
 
Access / modification
virtual void load (SPxSolver *base)
 sets the solver More...
 
void setType (SPxSolver::Type tp)
 set entering/leaving algorithm More...
 
void setRep (SPxSolver::Representation rep)
 set row/column representation More...
 
virtual int selectLeave ()
 
virtual SPxId selectEnter ()
 
virtual void addedVecs (int n)
 n vectors have been added to the loaded LP. More...
 
virtual void addedCoVecs (int n)
 n covectors have been added to the loaded LP. More...
 
virtual void removedVec (int i)
 the i'th vector has been removed from the loaded LP. More...
 
virtual void removedCoVec (int i)
 the i'th covector has been removed from the loaded LP. More...
 
virtual void removedVecs (const int perm[])
 n vectors have been removed from the loaded LP. More...
 
virtual void removedCoVecs (const int perm[])
 n covectors have been removed from the loaded LP. More...
 
Consistency check
virtual bool isConsistent () const
 checks for consistency More...
 
- Public Member Functions inherited from SPxPricer
virtual const char * getName () const
 get name of pricer. More...
 
virtual void clear ()
 unloads LP. More...
 
virtual SPxSolversolver () const
 returns loaded SPxSolver object. More...
 
virtual Real epsilon () const
 returns violation bound theeps. More...
 
virtual void setEpsilon (Real eps)
 sets violation bound. More...
 
virtual void left4 (int, SPxId)
 performs leaving pivot. More...
 
virtual void entered4 (SPxId, int)
 performs entering pivot. More...
 
virtual void removedVecs (const int *)
 vectors given by perm have been removed from loaded LP. More...
 
virtual void removedCoVecs (const int *)
 covectors given by perm have been removed from loaded LP. More...
 
virtual void getNdualNorms (int &nrows, int &ncols) const
 get number of available norms More...
 
virtual bool getDualNorms (int &nrows, int &ncols, Real *norms) const
 export norms from pricer More...
 
virtual bool setDualNorms (int nrows, int ncols, Real *norms)
 import norms into pricer More...
 
 SPxPricer (const char *p_name)
 constructor More...
 
 SPxPricer (const SPxPricer &old)
 copy constructor More...
 
SPxPriceroperator= (const SPxPricer &rhs)
 assignment operator More...
 
virtual ~SPxPricer ()
 destructor. More...
 

Private Member Functions

Private helpers
void computeLeavePenalty (int start, int end)
 compute leave penalties. More...
 
void computeCP (int start, int end)
 compute weights for columns. More...
 
void computeRP (int start, int end)
 compute weights for rows. More...
 

Private Attributes

Data
DVector cPenalty
 column penalties More...
 
DVector rPenalty
 row penalties More...
 
DVector leavePenalty
 penalties for leaving alg More...
 
const Realpenalty
 
const RealcoPenalty
 
Real objlength
 length of objective vector. More...
 

Additional Inherited Members

- Public Types inherited from SPxPricer
enum  ViolationType { NOT_VIOLATED = 0, VIOLATED = 1, VIOLATED_AND_CHECKED = 2 }
 
- Protected Attributes inherited from SPxPricer
IdxCompare compare
 
const char * m_name
 name of the pricer More...
 
SPxSolverthesolver
 the solver More...
 
Real theeps
 violation bound More...
 
DVector weights
 vector to store pricing weights or norms More...
 
DVector coWeights
 
bool weightsAreSetup
 are the weights already set up? More...
 

Detailed Description

Weighted pricing.

Class SPxWeightPR is an implemantation class of SPxPricer that uses weights for columns and rows for selecting the Simplex pivots. The weights are computed by methods computeCP() and computeRP() which may be overridden by derived classes.

The weights are interpreted as follows: The higher a value is, the more likely the corresponding row or column is set on one of its bounds.

See SPxPricer for a class documentation.

Definition at line 41 of file spxweightpr.h.

Constructor & Destructor Documentation

default constructor

Definition at line 79 of file spxweightpr.h.

Referenced by SPxWeightPR::clone().

SPxWeightPR ( const SPxWeightPR old)
virtual ~SPxWeightPR ( )
virtual

destructor

Definition at line 131 of file spxweightpr.h.

Member Function Documentation

void computeCP ( int  start,
int  end 
)
private
void computeRP ( int  start,
int  end 
)
private

compute weights for rows.

Todo:
TK04NOV98 here is a bug. solver()->rowVector(i).length() could be zero, so solver()->rowVector(i).length2() is also zero and we get an arithmetic exception.

Definition at line 62 of file spxweightpr.cpp.

References ASSERT_WARN, SPxPricer::epsilon(), SVectorBase< R >::length2(), SPxLPBase< R >::maxObj(), SPxWeightPR::objlength, SPxLPBase< R >::rowVector(), SPxWeightPR::rPenalty, and SPxPricer::solver().

Referenced by SPxWeightPR::addedCoVecs(), SPxWeightPR::addedVecs(), and SPxWeightPR::load().

bool isConsistent ( ) const
virtual
void removedCoVec ( int  i)
virtual

the i'th covector has been removed from the loaded LP.

Reimplemented from SPxPricer.

Definition at line 333 of file spxweightpr.cpp.

References SPxSolver::COLUMN, SPxWeightPR::cPenalty, VectorBase< R >::dim(), DVectorBase< R >::reDim(), SPxWeightPR::rPenalty, and SPxPricer::solver().

Referenced by SPxWeightPR::clone().

void removedCoVecs ( const int  perm[])
virtual

n covectors have been removed from the loaded LP.

Definition at line 349 of file spxweightpr.cpp.

References SPxSolver::COLUMN, SPxWeightPR::cPenalty, VectorBase< R >::dim(), DVectorBase< R >::reDim(), SPxWeightPR::rPenalty, and SPxPricer::solver().

Referenced by SPxWeightPR::clone().

void removedVec ( int  i)
virtual

the i'th vector has been removed from the loaded LP.

Reimplemented from SPxPricer.

Definition at line 291 of file spxweightpr.cpp.

References SPxWeightPR::cPenalty, VectorBase< R >::dim(), DVectorBase< R >::reDim(), SPxSolver::ROW, SPxWeightPR::rPenalty, and SPxPricer::solver().

Referenced by SPxWeightPR::clone().

void removedVecs ( const int  perm[])
virtual

n vectors have been removed from the loaded LP.

Definition at line 307 of file spxweightpr.cpp.

References SPxWeightPR::cPenalty, VectorBase< R >::dim(), DVectorBase< R >::reDim(), SPxSolver::ROW, SPxWeightPR::rPenalty, and SPxPricer::solver().

Referenced by SPxWeightPR::clone().

void setRep ( SPxSolver::Representation  rep)
virtual

set row/column representation

Reimplemented from SPxPricer.

Definition at line 25 of file spxweightpr.cpp.

References SPxWeightPR::coPenalty, SPxWeightPR::cPenalty, VectorBase< R >::get_const_ptr(), SPxWeightPR::penalty, SPxSolver::ROW, and SPxWeightPR::rPenalty.

Referenced by SPxWeightPR::clone().

void setType ( SPxSolver::Type  tp)
virtual

set entering/leaving algorithm

Reimplemented from SPxPricer.

Definition at line 39 of file spxweightpr.cpp.

References SPxWeightPR::computeLeavePenalty(), SPxSolver::dim(), SPxSolver::LEAVE, SPxWeightPR::leavePenalty, DVectorBase< R >::reDim(), and SPxPricer::thesolver.

Referenced by SPxWeightPR::clone().

Member Data Documentation

const Real* coPenalty
private

Definition at line 57 of file spxweightpr.h.

Referenced by SPxWeightPR::setRep().

Real objlength
private

length of objective vector.

Definition at line 59 of file spxweightpr.h.

Referenced by SPxWeightPR::computeCP(), SPxWeightPR::computeRP(), SPxWeightPR::load(), and SPxWeightPR::operator=().

const Real* penalty
private