This class holds the solution objects. More...
#include <BcpsSolution.h>
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_p * | getObjects () const |
Get the appropriate data member. More... | |
const double * | getValues () const |
Get the appropriate data member. More... | |
double | getQuality () const |
Get the appropriate data member. More... | |
void | setSize (int s) |
Set/assign the appropriate data member. More... | |
void | assignObjects (BcpsObject_p *&obj) |
Set/assign the appropriate data member. More... | |
void | setValues (const double *vs, int s) |
Set/assign the appropriate data member. More... | |
void | setQuality (double q) |
Set/assign the appropriate data member. More... | |
virtual BcpsSolution * | selectNonzeros (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 BcpsSolution * | selectFractional (const double etol=1e-5) const |
Select the fractional/nonzero elements from the solution array and return a new object in compacted form. More... | |
![]() | |
AlpsSolution () | |
Default constructor. More... | |
AlpsSolution (const AlpsNodeIndex_t i, const int d) | |
Constructor to set index and depth. More... | |
virtual | ~AlpsSolution () |
Destructor. More... | |
AlpsNodeIndex_t | getIndex () |
Get index where solution was found. More... | |
void | setIndex (const AlpsNodeIndex_t i) |
Set index where solution was found. More... | |
int | getDepth () |
Get depth where solution was found. More... | |
void | setDepth (const int d) |
Set depth where solution was found. More... | |
![]() | |
AlpsKnowledge () | |
virtual | ~AlpsKnowledge () |
KnowledgeType | getType () |
void | setType (KnowledgeType t) |
virtual AlpsEncoded * | encode () const |
This method should encode the content of the object and return a pointer to the encoded form. More... | |
virtual AlpsReturnStatus | encode (AlpsEncoded *encoded) |
Pack into a encode object. More... | |
virtual AlpsKnowledge * | decode (AlpsEncoded &encoded) const |
This method should decode and return a pointer to a brand new object, i.e., the method must create a new object on the heap from the decoded data instead of filling up the object for which the method was invoked. More... | |
AlpsEncoded * | getEncoded () const |
Get/set encoded. More... | |
void | setEncoded (AlpsEncoded *e) |
Protected Attributes | |
int | size_ |
Size of values_. More... | |
BcpsObject_p * | objects_ |
List of objects associated with values. More... | |
double * | values_ |
Solution values. More... | |
double | quality_ |
Quality/Objective value associated with this solution. More... | |
![]() | |
KnowledgeType | type_ |
Private Member Functions | |
BcpsSolution (const BcpsSolution &) | |
BcpsSolution & | operator= (const BcpsSolution &) |
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.
|
private |
|
inline |
Default constructor.
Definition at line 58 of file BcpsSolution.h.
|
inline |
Useful constructor.
Definition at line 64 of file BcpsSolution.h.
|
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.
|
inlinevirtual |
Distructor.
Definition at line 88 of file BcpsSolution.h.
|
private |
|
inline |
Get the appropriate data member.
Definition at line 100 of file BcpsSolution.h.
|
inline |
Get the appropriate data member.
Definition at line 101 of file BcpsSolution.h.
|
inline |
Get the appropriate data member.
Definition at line 102 of file BcpsSolution.h.
|
inline |
Get the appropriate data member.
Definition at line 103 of file BcpsSolution.h.
|
inline |
Set/assign the appropriate data member.
Definition at line 108 of file BcpsSolution.h.
|
inline |
Set/assign the appropriate data member.
Definition at line 109 of file BcpsSolution.h.
|
inline |
Set/assign the appropriate data member.
Definition at line 113 of file BcpsSolution.h.
|
inline |
Set/assign the appropriate data member.
Definition at line 119 of file BcpsSolution.h.
|
virtual |
Select the fractional/nonzero elements from the solution array and return a new object in compacted form.
|
virtual |
Select the fractional/nonzero elements from the solution array and return a new object in compacted form.
|
inlinevirtual |
Print out the solution.
Reimplemented from AlpsSolution.
Reimplemented in BlisSolution, and VrpSolution.
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.
|
protected |
Size of values_.
Definition at line 44 of file BcpsSolution.h.
|
protected |
|
protected |
Solution values.
Definition at line 50 of file BcpsSolution.h.
|
protected |
Quality/Objective value associated with this solution.
Definition at line 53 of file BcpsSolution.h.