diff options
author | Georgey | 2017-07-05 11:40:43 +0530 |
---|---|---|
committer | Georgey | 2017-07-05 11:40:43 +0530 |
commit | 938fef4a37a7b7c61b4b6ff74cb4cfd2f100c427 (patch) | |
tree | b343c0ee5609433c80e0de1db8b6886c9126dc2d /thirdparty/linux/include/coin/BonOaNlpOptim.hpp | |
parent | 5b72577efe080c5294b32d804e4d26351fef30bc (diff) | |
download | FOSSEE-Optimization-toolbox-938fef4a37a7b7c61b4b6ff74cb4cfd2f100c427.tar.gz FOSSEE-Optimization-toolbox-938fef4a37a7b7c61b4b6ff74cb4cfd2f100c427.tar.bz2 FOSSEE-Optimization-toolbox-938fef4a37a7b7c61b4b6ff74cb4cfd2f100c427.zip |
Added linux shared libraries and header files for int and ecos functions
Diffstat (limited to 'thirdparty/linux/include/coin/BonOaNlpOptim.hpp')
-rw-r--r-- | thirdparty/linux/include/coin/BonOaNlpOptim.hpp | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/thirdparty/linux/include/coin/BonOaNlpOptim.hpp b/thirdparty/linux/include/coin/BonOaNlpOptim.hpp new file mode 100644 index 0000000..c157b66 --- /dev/null +++ b/thirdparty/linux/include/coin/BonOaNlpOptim.hpp @@ -0,0 +1,116 @@ +// (C) Copyright Carnegie Mellon University 2005, 2006 +// All Rights Reserved. +// This code is published under the Eclipse Public License. +// +// Authors : +// P. Bonami, Carnegie Mellon University +// +// Date : 05/26/2005 + +#ifndef BonOaNlpOptim_HPP +#define BonOaNlpOptim_HPP +#include "CglCutGenerator.hpp" +#include "BonOsiTMINLPInterface.hpp" +#include "BonOAMessages.hpp" +#include "BonBabSetupBase.hpp" +namespace Bonmin +{ + /** Generate cuts for the nlp corresponding to continuous relaxation at a node.*/ + class OaNlpOptim : public CglCutGenerator + { + public: + /// Default constructor + OaNlpOptim(OsiTMINLPInterface * si = NULL, + int maxDepth = 10, bool addOnlyViolated = false, + bool globalCuts = true); + + /// Constructor with basic setup + OaNlpOptim(BabSetupBase &b); + /// Copy constructor + OaNlpOptim(const OaNlpOptim ©) + : + CglCutGenerator(copy), + nlp_(copy.nlp_), + maxDepth_(copy.maxDepth_), + nSolve_(0), + addOnlyViolated_(copy.addOnlyViolated_), + global_(copy.global_), + solves_per_level_(copy.solves_per_level_) + { + handler_ = new CoinMessageHandler(); + handler_ -> setLogLevel(copy.handler_->logLevel()); + messages_ = OaMessages(); + } + void passInMessageHandler(const CoinMessageHandler * handler) + { + delete handler_; + handler_ = handler->clone(); + } + ///Abstract constructor + virtual CglCutGenerator * clone() const + { + return new OaNlpOptim(*this); + } + + /** Desctructor */ + virtual ~OaNlpOptim() + { + if (handler_) + delete handler_; + } + + /// Assign an OsiTMINLPInterface + void assignInterface(OsiTMINLPInterface * si); + /// cut generation method + virtual void generateCuts( const OsiSolverInterface & si, OsiCuts & cs, + const CglTreeInfo info); + + + + inline void setMaxDepth(int value) + { + maxDepth_ = value; + } + inline void setAddOnlyViolated(bool yesno) + { + addOnlyViolated_ = yesno; + } + inline void setGlobalCuts(bool yesno) + { + global_ = yesno; + } + inline int getNSolve() + { + return nSolve_; + } + /**set log level */ + void setLogLevel(int value) + { + handler_->setLogLevel(value); + } + + /** Register OaNlpOptim options.*/ + static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions); + + private: + /// Pointer to the Ipopt interface + OsiTMINLPInterface * nlp_; + + /** maximum depth at which generate cuts*/ + int maxDepth_; + + ///Number of NLP resolution done + mutable int nSolve_; + /** messages handler. */ + CoinMessageHandler * handler_; + /** handler */ + CoinMessages messages_; + /** Add only violated cuts?*/ + bool addOnlyViolated_; + /** Add cuts as global?*/ + bool global_; + /** Average number of nodes per level in tree */ + double solves_per_level_; + }; +} +#endif |