1 /*===========================================================================* 2 * This file is part of the Discrete Conic Optimization (DisCO) Solver. * 3 * * 4 * DisCO is distributed under the Eclipse Public License as part of the * 5 * COIN-OR repository (http://www.coin-or.org). * 6 * * 7 * Authors: * 8 * Aykut Bulut, Lehigh University * 9 * Yan Xu, Lehigh University * 10 * Ted Ralphs, Lehigh University * 11 * * 12 * Copyright (C) 2001-2018, Lehigh University, Aykut Bulut, Yan Xu, and * 13 * Ted Ralphs. * 14 * All Rights Reserved. * 15 *===========================================================================*/ 16 17 18 #ifndef DcoSolution_hpp_ 19 #define DcoSolution_hpp_ 20 21 #include <BcpsSolution.h> 22 23 /*! 24 25 DcoSolution represents a solution for the MISOCO problem (master problem) 26 represented by the DcoModel. Inherits BcpsSolution. 27 28 # Design concerns: 29 30 BcpsSolution can also keep objects (variables) associated with the solution. 31 We are not using that for now, but it can be usefull. 32 33 */ 34 35 class DcoSolution: public BcpsSolution { 36 public: 37 DcoSolution(); 38 DcoSolution(int size, double const * values, double quality); 39 virtual ~DcoSolution(); 40 virtual BcpsSolution * selectNonzeros(const double etol=1e-5) const; 41 virtual BcpsSolution * selectFractional(const double etol=1e-5) const; 42 43 ///@name Encode and Decode functions 44 //@{ 45 /// Get encode defined in AlpsKnowledge. 46 /// Encodes the solution into AlpsEncoded object and return pointer to it. 47 using AlpsKnowledge::encode; 48 /// Encode this into the given AlpsEncoded object. 49 virtual AlpsReturnStatus encode(AlpsEncoded * encoded) const; 50 /// Decodes the given object into a new solution and returns the pointer to 51 /// it. 52 virtual AlpsKnowledge * decode(AlpsEncoded & encoded) const; 53 /// Decode the given AlpsEncoded object into this. 54 virtual AlpsReturnStatus decodeToSelf(AlpsEncoded & encoded); 55 //@} 56 private: 57 DcoSolution(DcoSolution const & other); 58 DcoSolution & operator=(DcoSolution const & rhs); 59 }; 60 61 #endif 62