SoPlex
Loading...
Searching...
No Matches
SPxWeightPR< R > Class Template Reference

Weighted pricing. More...

#include <spxweightpr.h>

Inheritance diagram for SPxWeightPR< R >:
SPxPricer< R >

Public Member Functions

Construction / destruction
 SPxWeightPR ()
 default constructor
 SPxWeightPR (const SPxWeightPR &old)
 copy constructor
SPxWeightPRoperator= (const SPxWeightPR &rhs)
 assignment operator
virtual ~SPxWeightPR ()
 destructor
virtual SPxPricer< R > * clone () const
 clone function for polymorphism
Access / modification
virtual void load (SPxSolverBase< R > *base)
 sets the solver
void setType (typename SPxSolverBase< R >::Type tp)
 set entering/leaving algorithm
void setRep (typename SPxSolverBase< R >::Representation rep)
 set row/column representation
virtual int selectLeave ()
virtual SPxId selectEnter ()
virtual void addedVecs (int n)
 n vectors have been added to the loaded LP.
virtual void addedCoVecs (int n)
 n covectors have been added to the loaded LP.
virtual void removedVec (int i)
 the i'th vector has been removed from the loaded LP.
virtual void removedCoVec (int i)
 the i'th covector has been removed from the loaded LP.
virtual void removedVecs (const int perm[])
 n vectors have been removed from the loaded LP.
virtual void removedCoVecs (const int perm[])
 n covectors have been removed from the loaded LP.
Consistency check
virtual bool isConsistent () const
 checks for consistency
Public Member Functions inherited from SPxPricer< R >
virtual const char * getName () const
 get name of pricer.
virtual void clear ()
 unloads LP.
virtual SPxSolverBase< R > * solver () const
 returns loaded SPxSolverBase object.
virtual void setPricingTolerance (R tol)
 sets pricing tolerance.
virtual R pricingTolerance () const
 returns the pricing tolerance
virtual void setTolerances (std::shared_ptr< Tolerances > newTolerances)
 set the _tolerances member variable
virtual void left4 (int, SPxId)
 performs leaving pivot.
virtual void entered4 (SPxId, int)
 performs entering pivot.
virtual void removedVecs (const int *)
 vectors given by perm have been removed from loaded LP.
virtual void removedCoVecs (const int *)
 covectors given by perm have been removed from loaded LP.
 SPxPricer (const char *p_name)
 constructor
 SPxPricer (const SPxPricer &old)
 copy constructor
SPxPriceroperator= (const SPxPricer &rhs)
 assignment operator
virtual ~SPxPricer ()
 destructor.

Private Member Functions

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

Private Attributes

Data
VectorBase< R > cPenalty
 column penalties
VectorBase< R > rPenalty
 row penalties
VectorBase< R > leavePenalty
 penalties for leaving alg
const R * penalty
const R * coPenalty
objlength
 length of objective vector.

Additional Inherited Members

Public Types inherited from SPxPricer< R >
enum  ViolationType { NOT_VIOLATED = 0 , VIOLATED = 1 , VIOLATED_AND_CHECKED = 2 }
Protected Attributes inherited from SPxPricer< R >
IdxCompare compare
const char * m_name
 name of the pricer
SPxSolverBase< R > * thesolver
 the solver
thetolerance
 violation bound
std::shared_ptr< Tolerances_tolerances
 tolerances used by the solver

Detailed Description

template<class R>
class soplex::SPxWeightPR< R >

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 51 of file spxweightpr.h.

Constructor & Destructor Documentation

◆ SPxWeightPR() [1/2]

template<class R>
SPxWeightPR ( )

default constructor

Definition at line 89 of file spxweightpr.h.

References coPenalty, objlength, penalty, and SPxPricer< R >::SPxPricer().

Referenced by clone(), operator=(), and SPxWeightPR().

◆ SPxWeightPR() [2/2]

template<class R>
SPxWeightPR ( const SPxWeightPR< R > & old)

copy constructor

Definition at line 96 of file spxweightpr.h.

References coPenalty, cPenalty, leavePenalty, objlength, penalty, rPenalty, SPxPricer< R >::SPxPricer(), and SPxWeightPR().

◆ ~SPxWeightPR()

template<class R>
virtual ~SPxWeightPR ( )
virtual

destructor

Definition at line 146 of file spxweightpr.h.

Member Function Documentation

◆ addedCoVecs()

template<class R>
virtual void addedCoVecs ( int n)
virtual

n covectors have been added to the loaded LP.

Reimplemented from SPxPricer< R >.

◆ addedVecs()

template<class R>
virtual void addedVecs ( int n)
virtual

n vectors have been added to the loaded LP.

Reimplemented from SPxPricer< R >.

◆ clone()

template<class R>
virtual SPxPricer< R > * clone ( ) const
virtual

clone function for polymorphism

Implements SPxPricer< R >.

Definition at line 149 of file spxweightpr.h.

References SPxPricer< R >::SPxPricer(), and SPxWeightPR().

◆ computeCP()

template<class R>
void computeCP ( int start,
int end )
private

compute weights for columns.

◆ computeLeavePenalty()

template<class R>
void computeLeavePenalty ( int start,
int end )
private

compute leave penalties.

◆ computeRP()

template<class R>
void computeRP ( int start,
int end )
private

compute weights for rows.

◆ isConsistent()

template<class R>
virtual bool isConsistent ( ) const
virtual

checks for consistency

Reimplemented from SPxPricer< R >.

◆ load()

template<class R>
virtual void load ( SPxSolverBase< R > * base)
virtual

sets the solver

Reimplemented from SPxPricer< R >.

◆ operator=()

template<class R>
SPxWeightPR & operator= ( const SPxWeightPR< R > & rhs)

assignment operator

Definition at line 119 of file spxweightpr.h.

References coPenalty, cPenalty, leavePenalty, objlength, SPxPricer< R >::operator=(), penalty, rPenalty, and SPxWeightPR().

◆ removedCoVec()

template<class R>
virtual void removedCoVec ( int i)
virtual

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

Reimplemented from SPxPricer< R >.

◆ removedCoVecs()

template<class R>
virtual void removedCoVecs ( const int perm[])
virtual

n covectors have been removed from the loaded LP.

◆ removedVec()

template<class R>
virtual void removedVec ( int i)
virtual

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

Reimplemented from SPxPricer< R >.

◆ removedVecs()

template<class R>
virtual void removedVecs ( const int perm[])
virtual

n vectors have been removed from the loaded LP.

◆ selectEnter()

template<class R>
virtual SPxId selectEnter ( )
virtual

Implements SPxPricer< R >.

◆ selectLeave()

template<class R>
virtual int selectLeave ( )
virtual

Implements SPxPricer< R >.

◆ setRep()

template<class R>
void setRep ( typename SPxSolverBase< R >::Representation rep)
virtual

set row/column representation

Reimplemented from SPxPricer< R >.

◆ setType()

template<class R>
void setType ( typename SPxSolverBase< R >::Type tp)
virtual

set entering/leaving algorithm

Reimplemented from SPxPricer< R >.

Member Data Documentation

◆ coPenalty

template<class R>
const R* coPenalty
private

Definition at line 67 of file spxweightpr.h.

Referenced by operator=(), SPxWeightPR(), and SPxWeightPR().

◆ cPenalty

template<class R>
VectorBase<R> cPenalty
private

column penalties

Definition at line 59 of file spxweightpr.h.

Referenced by operator=(), and SPxWeightPR().

◆ leavePenalty

template<class R>
VectorBase<R> leavePenalty
private

penalties for leaving alg

Definition at line 63 of file spxweightpr.h.

Referenced by operator=(), and SPxWeightPR().

◆ objlength

template<class R>
R objlength
private

length of objective vector.

Definition at line 69 of file spxweightpr.h.

Referenced by operator=(), SPxWeightPR(), and SPxWeightPR().

◆ penalty

template<class R>
const R* penalty
private

Definition at line 65 of file spxweightpr.h.

Referenced by operator=(), SPxWeightPR(), and SPxWeightPR().

◆ rPenalty

template<class R>
VectorBase<R> rPenalty
private

row penalties

Definition at line 61 of file spxweightpr.h.

Referenced by operator=(), and SPxWeightPR().