Go to the documentation of this file.
23 #ifndef BcpsSolution_h_
24 #define BcpsSolution_h_
70 memcpy(
values_, values,
sizeof(
double) * size);
73 std::cout <<
"ERROR: Solution size = " << size << std::endl;
90 for (
int i = 0; i <
size_; ++i) {
117 memcpy(
values_, vs, s *
sizeof(
double));
130 virtual void print(std::ostream& os)
const {
131 for (
int j = 0; j <
size_; ++j) {
133 os <<
"x[" << j <<
"] = " <<
values_[j] << std::endl;
int size_
Size of values_.
BcpsObject_p * objects_
List of objects associated with values.
A class for describing the objects that comprise a BCPS subproblem.
BcpsSolution(int size, const double *values, double q)
Useful constructor.
void setQuality(double q)
AlpsReturnStatus encodeBcps(AlpsEncoded *encoded) const
Pack Bcps part of solution into an encoded objects.
virtual BcpsSolution * selectFractional(const double etol=1e-5) const
virtual ~BcpsSolution()
Distructor.
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 f...
const BcpsObject_p * getObjects() const
int getSize() const
Get the appropriate data member.
double quality_
Quality/Objective value associated with this solution.
double * values_
Solution values.
virtual void print(std::ostream &os) const
Print out the solution.
void assignObjects(BcpsObject_p *&obj)
AlpsReturnStatus decodeBcps(AlpsEncoded &encoded)
Unpack Bcps part of solution from an encoded objects.
BcpsSolution()
Default constructor.
This class holds the solution objects.
const double * getValues() const
void setSize(int s)
Set/assign the appropriate data member.
BcpsSolution(int size, BcpsObject_p *&objects, double *&values, double q)
Construct an object using the given arrays.
double getQuality() const
void setValues(const double *vs, int s)