00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "CouenneFixPoint.hpp"
00012 #include <string>
00013
00014 using namespace Couenne;
00015
00017 CouenneFixPoint::CouenneFixPoint (CouenneProblem *p,
00018 const Ipopt::SmartPtr<Ipopt::OptionsList> options):
00019 problem_ (p),
00020 firstCall_ (true),
00021 CPUtime_ (0.),
00022 nRuns_ (0),
00023 nTightened_ (0) {
00024
00025 std::string s;
00026 options -> GetStringValue ("fixpoint_bt_model", s, "couenne.");
00027 extendedModel_ = (s == "extended");
00028 }
00029
00030
00032 CouenneFixPoint::CouenneFixPoint (const CouenneFixPoint &rhs):
00033 extendedModel_ (rhs.extendedModel_),
00034 problem_ (rhs.problem_),
00035 firstCall_ (rhs.firstCall_),
00036 CPUtime_ (rhs.CPUtime_),
00037 nRuns_ (rhs.nRuns_),
00038 nTightened_ (rhs.nTightened_) {}
00039
00040
00042 CouenneFixPoint::~CouenneFixPoint () {
00043
00044 if (!firstCall_)
00045 printf ("Fixed point BT: CPU time %g, %d runs, %d tightened\n",
00046 CPUtime_, nRuns_, nTightened_);
00047 }
00048
00049
00051 void CouenneFixPoint::registerOptions (Ipopt::SmartPtr <Bonmin::RegisteredOptions> roptions) {
00052
00053 roptions -> AddLowerBoundedIntegerOption
00054 ("fixpoint_bt",
00055 "The frequency (in terms of nodes) at which Fix Point Bound Tightening is performed.",
00056 -99, 0,
00057 "A frequency of 0 (default) means these cuts are never generated. "
00058 "Any positive number n instructs Couenne to generate them at every n nodes of the B&B tree. "
00059 "A negative number -n means that generation should be attempted at the root node, and if successful it can be repeated at every n nodes, otherwise it is stopped altogether."
00060 );
00061
00062 roptions -> AddStringOption2
00063 ("fixpoint_bt_model",
00064 "Choose whether to add an extended fixpoint LP model or a more compact one.",
00065 "compact",
00066 "extended", "",
00067 "compact", "",
00068 "");
00069 }