summaryrefslogtreecommitdiff
path: root/build/Bonmin/include/coin/CglLiftAndProject.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'build/Bonmin/include/coin/CglLiftAndProject.hpp')
-rw-r--r--build/Bonmin/include/coin/CglLiftAndProject.hpp104
1 files changed, 104 insertions, 0 deletions
diff --git a/build/Bonmin/include/coin/CglLiftAndProject.hpp b/build/Bonmin/include/coin/CglLiftAndProject.hpp
new file mode 100644
index 0000000..364ba5a
--- /dev/null
+++ b/build/Bonmin/include/coin/CglLiftAndProject.hpp
@@ -0,0 +1,104 @@
+// Copyright (C) 2000, International Business Machines
+// Corporation and others. All Rights Reserved.
+// This code is licensed under the terms of the Eclipse Public License (EPL).
+
+#ifndef CglLiftAndProject_H
+#define CglLiftAndProject_H
+
+#include <string>
+
+#include "CglCutGenerator.hpp"
+
+/** Lift And Project Cut Generator Class */
+class CglLiftAndProject : public CglCutGenerator {
+ friend void CglLiftAndProjectUnitTest(const OsiSolverInterface * siP,
+ const std::string mpdDir );
+
+public:
+ /**@name Generate Cuts */
+ //@{
+ /** Generate lift-and-project cuts for the
+ model of the solver interface, si.
+ Insert the generated cuts into OsiCut, cs.
+ */
+ virtual void generateCuts(const OsiSolverInterface & si, OsiCuts & cs,
+ const CglTreeInfo info = CglTreeInfo());
+
+ /** Get the normalization : Either beta=+1 or beta=-1.
+ */
+
+ double getBeta() const {
+ return beta_;
+ }
+
+ /** Set the normalization : Either beta=+1 or beta=-1.
+ Default value is 1.
+ */
+ void setBeta(int oneOrMinusOne){
+ if (oneOrMinusOne==1 || oneOrMinusOne==-1){
+ beta_= static_cast<double>(oneOrMinusOne);
+ }
+ else {
+ throw CoinError("Unallowable value. Beta must be 1 or -1",
+ "cutGeneration","CglLiftAndProject");
+ }
+ }
+
+ //@}
+
+ /**@name Constructors and destructors */
+ //@{
+ /// Default constructor
+ CglLiftAndProject ();
+
+ /// Copy constructor
+ CglLiftAndProject (
+ const CglLiftAndProject &);
+
+ /// Clone
+ virtual CglCutGenerator * clone() const;
+
+ /// Assignment operator
+ CglLiftAndProject &
+ operator=(
+ const CglLiftAndProject& rhs);
+
+ /// Destructor
+ virtual
+ ~CglLiftAndProject ();
+ /// Create C++ lines to get to current state
+ virtual std::string generateCpp( FILE * fp);
+ //@}
+
+private:
+
+ // Private member methods
+
+ /**@name Private methods */
+ //@{
+
+ //@}
+
+ // Private member data
+
+ /**@name Private member data */
+ //@{
+ /// The normalization is beta_=1 or beta_=-1
+ double beta_;
+ /// epsilon
+ double epsilon_;
+ /// 1-epsilon
+ double onetol_;
+ //@}
+};
+
+//#############################################################################
+/** A function that tests the methods in the CglLiftAndProject class. The
+ only reason for it not to be a member method is that this way it doesn't
+ have to be compiled into the library. And that's a gain, because the
+ library should be compiled with optimization on, but this method should be
+ compiled with debugging. */
+void CglLiftAndProjectUnitTest(const OsiSolverInterface * siP,
+ const std::string mpdDir );
+
+#endif