Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

AgentSolution Class Reference

auxiliary class for MipHandler More...

#include <AgentSolution.h>

List of all members.

Public Member Functions

Data query functions
int getNumberOfRows () const
int getNumberOfColumns () const
double * getColumnSolution () const
double getColumnSolution (int index) const
double * getObjectiveFunctCoeff () const
double getObjectiveFunctCoeff (int index) const
double getObjValue () const
double * getDualRightHandSide () const
 get pointer to array of dual rhs, i.e. shadow prices
double getDualRightHandSide (int index) const
 get element index of dual rhs, i.e. component index of shadow prices
double * getSlackRightHandSide () const
double getSlackRightHandSide (int index) const
double * getRowActivity () const
double getRowActivity (int index) const
bool getTestFlag () const
double getInfinity () const
 Get solver's value for infinity.
double getTolerance () const
SymWarmStart * getWarmStartSym () const
 returns a warm start description
CoinWarmStartBasis * getWarmStartCoin () const
Data input functions
virtual void setNumberOfRows (const int numberofrows)
virtual void setNumberOfColumns (const int numberofcolumns)
virtual void setColumnSolution (const double *columnsolution_)
virtual int setColumnSolution (const double value, int index)
virtual void setObjectiveFunctCoeff (const double *objectivefunctcoeff_)
virtual int setObjectiveFunctCoeff (const double value, int index)
virtual void setObjValue (const double objvalue_)
virtual void setDualRightHandSide (const double *dualrhs_)
virtual int setDualRightHandSide (const double value, int index)
virtual void setSlackRightHandSide (const double *slackrhs_)
virtual int setSlackRightHandSide (const double value, int index)
virtual void setRowActivity (const double *rowactivities_)
virtual int setRowActivity (const double value, int index)
virtual void setInfinity (double infinity)
virtual void setTestFlag (bool test)
virtual void setTolerance (double eps)
virtual void setWarmStart (const SymWarmStart *const warmstart)
 set the warmstart description of the solution process in case of SYMPHONY
virtual void setWarmStart (const CoinWarmStartBasis *const warmstart)
 set the warmstart description of the solution process in case o OSL (maybe also CBC?)
virtual void load (const int numberofrows_, const int numberofcolumns_, const double *columnsolution_, const double *objectivefunctcoeff_, const double objvalue_, const double *dualrhs_, const double *slackrhs_, const double *rowactivities_, const SymWarmStart *warmstart)
 Load solution in SYMPOHNY case.
virtual void load (const int numberofrows_, const int numberofcolumns_, const double *columnsolution_, const double *objectivefunctcoeff_, const double objvalue_, const double *dualrhs_, const double *slackrhs_, const double *rowactivities_, const CoinWarmStartBasis *warmstart)
 The same as above for OSL.
Constructors and Destructors
 AgentSolution ()
 Standard Constructor.
 AgentSolution (int numberofrows_, int numberofcols_)
 Constructor which also allocates apropriate memory.
 AgentSolution (const AgentSolution &solution)
 Copy constructor.
AgentSolutionoperator= (const AgentSolution &rhs)
 Assignment operator.
virtual ~AgentSolution ()
 Destructor.

Private Member Functions

Private methods
void round ()
 round /truncate all the data:
void round (double *vector, int vectorlength)
 round/truncate all elements of a vector
void round (CoinPackedMatrix *MatrixDouble)
 round /truncate all elements of a MatrixDouble
double round (double value)
 round / truncate a single value
double truncate (double precision, double &x)
double round (int numberofdecimals_, double &x)
void gutsOfConstructor ()
 the real work of the constructor
void gutsOfDestructor ()
 the real work of the destructor
void allocate ()
 allocate all arrays
template<class Type>
int allocateVector (Type *&pointertovector, long int sizeofvector)
 allocates memory for an array of type Type with size sizefovector and checks if size is positive
template<class ClassType>
void copy (ClassType *&finalObjectPtr_, const ClassType *const originalObjectPtr_)
 Allocates memory for class member finalObjectPtr_ if necessary and copies data from the object originalObjectPtr_ points to.

Private Attributes

Private member data
int numberofrows
 Number of rows.
int numberofcolumns
 Number of columns.
double * columnsolution
 Column solution vector.
double * objectivefunctcoeff
 Objective function coefficient vector.
double objvalue
 value of optimal objective function
double * dualrhs
 vector of dual right hand side( in case it is retruned by the solver, i.e. not yet for SYMPHONY) (= schadow prices)
double * slackrhs
 vector of slack right hand side
double * rowactivities
 row activities (= row solution = variables left hand side)
double infinity
 Infinity of chosen solver.
bool test
 Test flag.
double eps
 Tolerance used in round().
SymWarmStart * lastYearWarmStartSym
 storage for SYMPHONY warmstart information
CoinWarmStartBasis * lastYearWarmStartCoin
 the same as above for OSL


Detailed Description

auxiliary class for MipHandler

Auxiliary class for MipHandler which contains the solution of the input problem; i.e. columns solution vector, original objective coefficient vector, objective value, vector of dual right hand side( in case it is retruned by the solver, i.e. not yet for SYMPHONY) (= schadow prices), vector of slack right hand side and row activities (= row solution = variables left hand side).


Constructor & Destructor Documentation

AgentSolution::AgentSolution  ) 
 

Standard Constructor.

AgentSolution::AgentSolution int  numberofrows_,
int  numberofcols_
 

Constructor which also allocates apropriate memory.

AgentSolution::AgentSolution const AgentSolution solution  ) 
 

Copy constructor.

virtual AgentSolution::~AgentSolution  )  [virtual]
 

Destructor.


Member Function Documentation

void AgentSolution::allocate  )  [private]
 

allocate all arrays

template<class Type>
int AgentSolution::allocateVector Type *&  pointertovector,
long int  sizeofvector
[private]
 

allocates memory for an array of type Type with size sizefovector and checks if size is positive

template<class ClassType>
void AgentSolution::copy ClassType *&  finalObjectPtr_,
const ClassType *const   originalObjectPtr_
[private]
 

Allocates memory for class member finalObjectPtr_ if necessary and copies data from the object originalObjectPtr_ points to.

double AgentSolution::getColumnSolution int  index  )  const
 

double* AgentSolution::getColumnSolution  )  const
 

double AgentSolution::getDualRightHandSide int  index  )  const
 

get element index of dual rhs, i.e. component index of shadow prices

CAVE: Not returned by SYMPHONY

double* AgentSolution::getDualRightHandSide  )  const
 

get pointer to array of dual rhs, i.e. shadow prices

CAVE: Not retruned by SYMPHONY

double AgentSolution::getInfinity  )  const
 

Get solver's value for infinity.

int AgentSolution::getNumberOfColumns  )  const
 

int AgentSolution::getNumberOfRows  )  const
 

double AgentSolution::getObjectiveFunctCoeff int  index  )  const
 

double* AgentSolution::getObjectiveFunctCoeff  )  const
 

double AgentSolution::getObjValue  )  const
 

double AgentSolution::getRowActivity int  index  )  const
 

double* AgentSolution::getRowActivity  )  const
 

double AgentSolution::getSlackRightHandSide int  index  )  const
 

double* AgentSolution::getSlackRightHandSide  )  const
 

bool AgentSolution::getTestFlag  )  const
 

double AgentSolution::getTolerance  )  const
 

CoinWarmStartBasis* AgentSolution::getWarmStartCoin  )  const
 

SymWarmStart* AgentSolution::getWarmStartSym  )  const
 

returns a warm start description

The warmstart description which is returned should contain the previously solved problem corresponding to the solution which is also loaded to this class

void AgentSolution::gutsOfConstructor  )  [private]
 

the real work of the constructor

void AgentSolution::gutsOfDestructor  )  [private]
 

the real work of the destructor

virtual void AgentSolution::load const int  numberofrows_,
const int  numberofcolumns_,
const double *  columnsolution_,
const double *  objectivefunctcoeff_,
const double  objvalue_,
const double *  dualrhs_,
const double *  slackrhs_,
const double *  rowactivities_,
const CoinWarmStartBasis *  warmstart
[virtual]
 

The same as above for OSL.

virtual void AgentSolution::load const int  numberofrows_,
const int  numberofcolumns_,
const double *  columnsolution_,
const double *  objectivefunctcoeff_,
const double  objvalue_,
const double *  dualrhs_,
const double *  slackrhs_,
const double *  rowactivities_,
const SymWarmStart *  warmstart
[virtual]
 

Load solution in SYMPOHNY case.

Load the full solution to the object. Values smaller than eps are set to zero: CAVE: const double*dualrhs_ and const double*slackrhs_ are dummy variables yet

AgentSolution& AgentSolution::operator= const AgentSolution rhs  ) 
 

Assignment operator.

double AgentSolution::round int  numberofdecimals_,
double &  x
[private]
 

round a single value to certain number of decimals (found on the web) CAVE: plattformdependent

double AgentSolution::round double  value  )  [private]
 

round / truncate a single value

void AgentSolution::round CoinPackedMatrix *  MatrixDouble  )  [private]
 

round /truncate all elements of a MatrixDouble

void AgentSolution::round double *  vector,
int  vectorlength
[private]
 

round/truncate all elements of a vector

void AgentSolution::round  )  [private]
 

round /truncate all the data:

virtual int AgentSolution::setColumnSolution const double  value,
int  index
[virtual]
 

virtual void AgentSolution::setColumnSolution const double *  columnsolution_  )  [virtual]
 

virtual int AgentSolution::setDualRightHandSide const double  value,
int  index
[virtual]
 

virtual void AgentSolution::setDualRightHandSide const double *  dualrhs_  )  [virtual]
 

virtual void AgentSolution::setInfinity double  infinity  )  [virtual]
 

virtual void AgentSolution::setNumberOfColumns const int  numberofcolumns  )  [virtual]
 

virtual void AgentSolution::setNumberOfRows const int  numberofrows  )  [virtual]
 

virtual int AgentSolution::setObjectiveFunctCoeff const double  value,
int  index
[virtual]
 

virtual void AgentSolution::setObjectiveFunctCoeff const double *  objectivefunctcoeff_  )  [virtual]
 

virtual void AgentSolution::setObjValue const double  objvalue_  )  [virtual]
 

virtual int AgentSolution::setRowActivity const double  value,
int  index
[virtual]
 

virtual void AgentSolution::setRowActivity const double *  rowactivities_  )  [virtual]
 

virtual int AgentSolution::setSlackRightHandSide const double  value,
int  index
[virtual]
 

virtual void AgentSolution::setSlackRightHandSide const double *  slackrhs_  )  [virtual]
 

virtual void AgentSolution::setTestFlag bool  test  )  [virtual]
 

virtual void AgentSolution::setTolerance double  eps  )  [virtual]
 

virtual void AgentSolution::setWarmStart const CoinWarmStartBasis *const   warmstart  )  [virtual]
 

set the warmstart description of the solution process in case o OSL (maybe also CBC?)

virtual void AgentSolution::setWarmStart const SymWarmStart *const   warmstart  )  [virtual]
 

set the warmstart description of the solution process in case of SYMPHONY

Here, the warmstart description which contains the previously solved problem corresponding to the solution which is also loaded to this class should be set using this method.

double AgentSolution::truncate double  precision,
double &  x
[private]
 

truncate a single value with certain precision (i.e. cut of decimals with smaller order of magnitude than precision): advantage: plattform independent


Member Data Documentation

double* AgentSolution::columnsolution [mutable, private]
 

Column solution vector.

double* AgentSolution::dualrhs [mutable, private]
 

vector of dual right hand side( in case it is retruned by the solver, i.e. not yet for SYMPHONY) (= schadow prices)

double AgentSolution::eps [private]
 

Tolerance used in round().

double AgentSolution::infinity [private]
 

Infinity of chosen solver.

CoinWarmStartBasis* AgentSolution::lastYearWarmStartCoin [private]
 

the same as above for OSL

SymWarmStart* AgentSolution::lastYearWarmStartSym [private]
 

storage for SYMPHONY warmstart information

stores the SYMPHONY solver warm start description s. th. it can be used solving the following years MIP as a warm start

int AgentSolution::numberofcolumns [private]
 

Number of columns.

int AgentSolution::numberofrows [private]
 

Number of rows.

double* AgentSolution::objectivefunctcoeff [mutable, private]
 

Objective function coefficient vector.

double AgentSolution::objvalue [private]
 

value of optimal objective function

double* AgentSolution::rowactivities [mutable, private]
 

row activities (= row solution = variables left hand side)

double* AgentSolution::slackrhs [mutable, private]
 

vector of slack right hand side

bool AgentSolution::test [private]
 

Test flag.


The documentation for this class was generated from the following file:
Generated on Thu Aug 28 12:39:51 2008 for MPMAS by  doxygen 1.3.9.1