diff options
author | Harpreet | 2016-08-04 15:25:44 +0530 |
---|---|---|
committer | Harpreet | 2016-08-04 15:25:44 +0530 |
commit | 9fd2976931c088dc523974afb901e96bad20f73c (patch) | |
tree | 22502de6e6988d5cd595290d11266f8432ad825b /build/Bonmin/include/coin/CglStored.hpp | |
download | FOSSEE-Optim-toolbox-development-9fd2976931c088dc523974afb901e96bad20f73c.tar.gz FOSSEE-Optim-toolbox-development-9fd2976931c088dc523974afb901e96bad20f73c.tar.bz2 FOSSEE-Optim-toolbox-development-9fd2976931c088dc523974afb901e96bad20f73c.zip |
initial add
Diffstat (limited to 'build/Bonmin/include/coin/CglStored.hpp')
-rw-r--r-- | build/Bonmin/include/coin/CglStored.hpp | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/build/Bonmin/include/coin/CglStored.hpp b/build/Bonmin/include/coin/CglStored.hpp new file mode 100644 index 0000000..07039d9 --- /dev/null +++ b/build/Bonmin/include/coin/CglStored.hpp @@ -0,0 +1,125 @@ +// $Id: CglStored.hpp 1119 2013-04-06 20:24:18Z stefan $ +// Copyright (C) 2005, International Business Machines +// Corporation and others. All Rights Reserved. +// This code is licensed under the terms of the Eclipse Public License (EPL). + +#ifndef CglStored_H +#define CglStored_H + +#include <string> + +#include "CglCutGenerator.hpp" + +class CoinWarmStartBasis; +class CglTreeProbingInfo; +/** Stored Cut Generator Class */ +class CglStored : public CglCutGenerator { + +public: + + + /**@name Generate Cuts */ + //@{ + /** Generate Mixed Integer Stored cuts for the model of the + solver interface, si. + + Insert the generated cuts into OsiCut, cs. + + This generator just looks at previously stored cuts + and inserts any that are violated by enough + */ + virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs, + const CglTreeInfo info = CglTreeInfo()); + //@} + + /**@name Change criterion on whether to include cut. + Violations of more than this will be added to current cut list + (default 1.0e-5) */ + //@{ + /// Set + inline void setRequiredViolation(double value) + { requiredViolation_=value;} + /// Get + inline double getRequiredViolation() const + { return requiredViolation_;} + /// Takes over ownership of probing info + inline void setProbingInfo(CglTreeProbingInfo * info) + { probingInfo_ = info;} + //@} + + /**@name Cut stuff */ + //@{ + /// Add cuts + void addCut(const OsiCuts & cs); + /// Add a row cut + void addCut(const OsiRowCut & cut); + /// Add a row cut from a packed vector + void addCut(double lb, double ub, const CoinPackedVector & vector); + /// Add a row cut from elements + void addCut(double lb, double ub, int size, const int * colIndices, const double * elements); + inline int sizeRowCuts() const + { return cuts_.sizeRowCuts();} + const OsiRowCut * rowCutPointer(int index) const + { return cuts_.rowCutPtr(index);} + /// Save stuff + void saveStuff(double bestObjective, const double * bestSolution, + const double * lower, const double * upper); + /// Best solution (or NULL) + inline const double * bestSolution() const + { return bestSolution_;} + /// Best objective + double bestObjective() const; + /// Tight lower bounds + const double * tightLower() const + { return bounds_;} + /// Tight upper bounds + const double * tightUpper() const + { return bounds_+numberColumns_;} + //@} + + /**@name Constructors and destructors */ + //@{ + /// Default constructor + CglStored (int numberColumns=0); + + /// Copy constructor + CglStored (const CglStored & rhs); + + /// Constructor from file + CglStored (const char * fileName); + + /// Clone + virtual CglCutGenerator * clone() const; + + /// Assignment operator + CglStored & + operator=(const CglStored& rhs); + + /// Destructor + virtual + ~CglStored (); + //@} + +protected: + + // Protected member methods + + // Protected member data + + /**@name Protected member data */ + //@{ + /// Only add if more than this requiredViolation + double requiredViolation_; + /// Pointer to probing information + CglTreeProbingInfo * probingInfo_; + /// Cuts + OsiCuts cuts_; + /// Number of columns in model + int numberColumns_; + /// Best solution (objective at end) + double * bestSolution_; + /// Tight bounds + double * bounds_; + //@} +}; +#endif |