Bcps  0.94.4
Public Member Functions | Protected Attributes | List of all members
BcpsSolution Class Reference

This class holds the solution objects. More...

#include <BcpsSolution.h>

+ Inheritance diagram for BcpsSolution:
+ Collaboration diagram for BcpsSolution:

Public Member Functions

 BcpsSolution ()
 Default constructor. More...
 
 BcpsSolution (int size, const double *values, double q)
 Useful constructor. More...
 
 BcpsSolution (int size, BcpsObject_p *&objects, double *&values, double q)
 Construct an object using the given arrays. More...
 
virtual ~BcpsSolution ()
 Distructor. More...
 
virtual void print (std::ostream &os) const
 Print out the solution. More...
 
AlpsReturnStatus encodeBcps (AlpsEncoded *encoded) const
 Pack Bcps part of solution into an encoded objects. More...
 
AlpsReturnStatus decodeBcps (AlpsEncoded &encoded)
 Unpack Bcps part of solution from an encoded objects. More...
 
int getSize () const
 Get the appropriate data member. More...
 
const BcpsObject_pgetObjects () const
 
const double * getValues () const
 
double getQuality () const
 
void setSize (int s)
 Set/assign the appropriate data member. More...
 
void assignObjects (BcpsObject_p *&obj)
 
void setValues (const double *vs, int s)
 
void setQuality (double q)
 
virtual BcpsSolutionselectNonzeros (const double etol=1e-5) const
 Select the fractional/nonzero elements from the solution array and return a new object in compacted form. More...
 
virtual BcpsSolutionselectFractional (const double etol=1e-5) const
 

Protected Attributes

int size_
 Size of values_. More...
 
BcpsObject_pobjects_
 List of objects associated with values. More...
 
double * values_
 Solution values. More...
 
double quality_
 Quality/Objective value associated with this solution. More...
 

Detailed Description

This class holds the solution objects.

At this level, a solution is just considered to be a list of objects with associated values.

Definition at line 34 of file BcpsSolution.h.

Constructor & Destructor Documentation

BcpsSolution::BcpsSolution ( )
inline

Default constructor.

Definition at line 58 of file BcpsSolution.h.

BcpsSolution::BcpsSolution ( int  size,
const double *  values,
double  q 
)
inline

Useful constructor.

Definition at line 64 of file BcpsSolution.h.

BcpsSolution::BcpsSolution ( int  size,
BcpsObject_p *&  objects,
double *&  values,
double  q 
)
inline

Construct an object using the given arrays.

Note that the new objects takes over the pointers and NULLs them out in the calling method.

Definition at line 80 of file BcpsSolution.h.

virtual BcpsSolution::~BcpsSolution ( )
inlinevirtual

Distructor.

Definition at line 88 of file BcpsSolution.h.

Member Function Documentation

int BcpsSolution::getSize ( ) const
inline

Get the appropriate data member.

Definition at line 100 of file BcpsSolution.h.

const BcpsObject_p* BcpsSolution::getObjects ( ) const
inline

Definition at line 101 of file BcpsSolution.h.

const double* BcpsSolution::getValues ( ) const
inline

Definition at line 102 of file BcpsSolution.h.

double BcpsSolution::getQuality ( ) const
inline

Definition at line 103 of file BcpsSolution.h.

void BcpsSolution::setSize ( int  s)
inline

Set/assign the appropriate data member.

Definition at line 108 of file BcpsSolution.h.

void BcpsSolution::assignObjects ( BcpsObject_p *&  obj)
inline

Definition at line 109 of file BcpsSolution.h.

void BcpsSolution::setValues ( const double *  vs,
int  s 
)
inline

Definition at line 113 of file BcpsSolution.h.

void BcpsSolution::setQuality ( double  q)
inline

Definition at line 119 of file BcpsSolution.h.

virtual BcpsSolution* BcpsSolution::selectNonzeros ( const double  etol = 1e-5) const
virtual

Select the fractional/nonzero elements from the solution array and return a new object in compacted form.

virtual BcpsSolution* BcpsSolution::selectFractional ( const double  etol = 1e-5) const
virtual
virtual void BcpsSolution::print ( std::ostream &  os) const
inlinevirtual

Print out the solution.

Definition at line 130 of file BcpsSolution.h.

AlpsReturnStatus BcpsSolution::encodeBcps ( AlpsEncoded *  encoded) const

Pack Bcps part of solution into an encoded objects.

AlpsReturnStatus BcpsSolution::decodeBcps ( AlpsEncoded &  encoded)

Unpack Bcps part of solution from an encoded objects.

Member Data Documentation

int BcpsSolution::size_
protected

Size of values_.

Definition at line 44 of file BcpsSolution.h.

BcpsObject_p* BcpsSolution::objects_
protected

List of objects associated with values.

Can be NULL.

Definition at line 47 of file BcpsSolution.h.

double* BcpsSolution::values_
protected

Solution values.

Definition at line 50 of file BcpsSolution.h.

double BcpsSolution::quality_
protected

Quality/Objective value associated with this solution.

Definition at line 53 of file BcpsSolution.h.


The documentation for this class was generated from the following file: