24 #ifndef BlisSolution_h_
25 #define BlisSolution_h_
28 #include "BcpsSolution.h"
51 BcpsSolution(s, values, objValue)
59 virtual void print(std::ostream& os)
const {
61 for (
int j = 0; j < size_; ++j) {
62 if (values_[j] > 1.0e-15 || values_[j] < -1.0e-15) {
63 nearInt = floor(values_[j] + 0.5);
64 if (ALPS_FABS(nearInt - values_[j]) < 1.0e-6) {
65 os <<
"x[" << j <<
"] = " << nearInt << std::endl;
68 os <<
"x[" << j <<
"] = " << values_[j] << std::endl;
78 using AlpsKnowledge::encode ;
80 virtual AlpsEncoded*
encode()
const {
81 AlpsEncoded* encoded =
new AlpsEncoded(AlpsKnowledgeTypeSolution);
88 virtual AlpsKnowledge*
decode(AlpsEncoded& encoded)
const {
90 sol->decodeBcps(encoded);
virtual void print(std::ostream &os) const
Print out the solution.
This class contains the solutions generated by the LP solver (either primal or dual.
virtual AlpsEncoded * encode() const
The method that encodes the solution into a encoded object.
virtual AlpsKnowledge * decode(AlpsEncoded &encoded) const
The method that decodes the solution from a encoded object.
virtual ~BlisSolution()
Destructor.
BlisSolution(int s, const double *values, double objValue)
Useful constructor.
BlisSolution()
Default constructor.