Couenne 0.5.8
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Couenne::CouenneFeasPump Class Reference

An implementation of the Feasibility pump that uses linearization and Ipopt to find the two sequences of points. More...

#include <CouenneFeasPump.hpp>

+ Inheritance diagram for Couenne::CouenneFeasPump:
+ Collaboration diagram for Couenne::CouenneFeasPump:

Public Types

enum  fpCompDistIntType { FP_DIST_INT , FP_DIST_ALL , FP_DIST_POST }
 
enum  fpCutPlane { FP_CUT_NONE , FP_CUT_INTEGRATED , FP_CUT_EXTERNAL , FP_CUT_POST }
 
enum  fpTabuMgtPolicy { FP_TABU_NONE , FP_TABU_POOL , FP_TABU_PERTURB , FP_TABU_CUT }
 

Public Member Functions

 CouenneFeasPump (CouenneProblem *couenne=NULL, CouenneCutGenerator *cg=NULL, Ipopt::SmartPtr< Ipopt::OptionsList > options=NULL)
 Constructor with (optional) MINLP pointer. More...
 
 CouenneFeasPump (const CouenneFeasPump &other)
 Copy constructor. More...
 
virtual ~CouenneFeasPump ()
 Destructor. More...
 
virtual CbcHeuristicclone () const
 Clone. More...
 
CouenneFeasPumpoperator= (const CouenneFeasPump &rhs)
 Assignment operator. More...
 
virtual void resetModel (CbcModel *model)
 Does nothing, but necessary as CbcHeuristic declares it pure virtual. More...
 
virtual int solution (double &objectiveValue, double *newSolution)
 Run heuristic, return 1 if a better solution than the one passed is found and 0 otherwise. More...
 
void setNumberSolvePerLevel (int value)
 set number of nlp's solved for each given level of the tree More...
 
virtual CouNumber solveMILP (const CouNumber *nSol, CouNumber *&iSol, int niter, int *nsuciter)
 find integer (possibly NLP-infeasible) point isol closest (according to the l-1 norm of the hessian) to the current NLP-feasible (but fractional) solution nsol More...
 
virtual CouNumber solveNLP (const CouNumber *nSol, CouNumber *&iSol)
 obtain solution to NLP More...
 
expressionupdateNLPObj (const double *)
 set new expression as the NLP objective function using argument as point to minimize distance from. More...
 
bool fixIntVariables (const double *sol)
 admits a (possibly fractional) solution and fixes the integer components in the nonlinear problem for later re-solve. More...
 
double findSolution (const double *nSol, double *&sol, int niter, int *nsuciter)
 find feasible solution (called by solveMILP ()) More...
 
void init_MILP ()
 initialize all solvers at the first call, where the initial MILP is built More...
 
void initIpoptApp ()
 Common code for initializing non-smartptr ipopt application. More...
 
CouenneProblemProblem () const
 return pointer to problem More...
 
enum fpCompDistIntType compDistInt () const
 return type of MILP solved More...
 
double multDistNLP () const
 Return Weights in computing distance, in both MILP and NLP (must sum up to 1 for MILP and for NLP): More...
 
double multHessNLP () const
 weight of Hessian in NLP More...
 
double multObjFNLP () const
 weight of objective in NLP More...
 
double multDistMILP () const
 weight of distance in MILP More...
 
double multHessMILP () const
 weight of Hessian in MILP More...
 
double multObjFMILP () const
 weight of objective in MILP More...
 
CouenneTNLPnlp () const
 return NLP More...
 
int & nCalls ()
 return number of calls (can be changed) More...
 
int milpPhase (double *nSol, double *iSol)
 MILP phase of the FP. More...
 
int nlpPhase (double *iSol, double *nSol)
 NLP phase of the FP. More...
 
- Public Member Functions inherited from CbcHeuristic
 CbcHeuristic ()
 
 CbcHeuristic (CbcModel &model)
 
 CbcHeuristic (const CbcHeuristic &)
 
virtual ~CbcHeuristic ()
 
virtual CbcHeuristicclone () const=0
 
CbcHeuristicoperator= (const CbcHeuristic &rhs)
 
virtual void setModel (CbcModel *model)
 
virtual void resetModel (CbcModel *model)=0
 
virtual int solution (double &objectiveValue, double *newSolution)=0
 
virtual int solution2 (double &, double *, OsiCuts &)
 
virtual void validate ()
 
void setWhen (int value)
 
int when () const
 
void setNumberNodes (int value)
 
int numberNodes () const
 
void setSwitches (int value)
 
int switches () const
 
bool exitNow (double bestObjective) const
 
void setFeasibilityPumpOptions (int value)
 
int feasibilityPumpOptions () const
 
void setModelOnly (CbcModel *model)
 
void setFractionSmall (double value)
 
double fractionSmall () const
 
int numberSolutionsFound () const
 
void incrementNumberSolutionsFound ()
 
int smallBranchAndBound (OsiSolverInterface *solver, int numberNodes, double *newSolution, double &newSolutionValue, double cutoff, std::string name) const
 
virtual void generateCpp (FILE *)
 
void generateCpp (FILE *fp, const char *heuristic)
 
virtual bool canDealWithOdd () const
 
const char * heuristicName () const
 
void setHeuristicName (const char *name)
 
void setSeed (int value)
 
int getSeed () const
 
void setDecayFactor (double value)
 
void setInputSolution (const double *solution, double objValue)
 
void setWhereFrom (int value)
 
int whereFrom () const
 
void setShallowDepth (int value)
 
void setHowOftenShallow (int value)
 
void setMinDistanceToRun (int value)
 
virtual bool shouldHeurRun (int whereFrom)
 
bool shouldHeurRun_randomChoice ()
 
void debugNodes ()
 
void printDistanceToNodes ()
 
int numRuns () const
 
int numCouldRun () const
 
bool isHeuristicInteger (const OsiSolverInterface *solver, int iColumn)
 
OsiSolverInterfacecloneBut (int type)
 

Static Public Member Functions

static void registerOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions >)
 initialize options to be read later More...
 

Additional Inherited Members

- Protected Attributes inherited from CbcHeuristic
CbcModelmodel_
 
int when_
 
int numberNodes_
 
int feasibilityPumpOptions_
 
double fractionSmall_
 
CoinThreadRandom randomNumberGenerator_
 
std::string heuristicName_
 
int howOften_
 
double decayFactor_
 
int switches_
 
int whereFrom_
 
int shallowDepth_
 
int howOftenShallow_
 
int numInvocationsInShallow_
 
int numInvocationsInDeep_
 
int lastRunDeep_
 
int numRuns_
 
int minDistanceToRun_
 
CbcHeuristicNodeList runNodes_
 
int numCouldRun_
 
int numberSolutionsFound_
 
int numberNodesDone_
 
double * inputSolution_
 

Detailed Description

An implementation of the Feasibility pump that uses linearization and Ipopt to find the two sequences of points.

Definition at line 57 of file CouenneFeasPump.hpp.

Member Enumeration Documentation

◆ fpCompDistIntType

Enumerator
FP_DIST_INT 
FP_DIST_ALL 
FP_DIST_POST 

Definition at line 61 of file CouenneFeasPump.hpp.

◆ fpCutPlane

Enumerator
FP_CUT_NONE 
FP_CUT_INTEGRATED 
FP_CUT_EXTERNAL 
FP_CUT_POST 

Definition at line 62 of file CouenneFeasPump.hpp.

◆ fpTabuMgtPolicy

Enumerator
FP_TABU_NONE 
FP_TABU_POOL 
FP_TABU_PERTURB 
FP_TABU_CUT 

Definition at line 63 of file CouenneFeasPump.hpp.

Constructor & Destructor Documentation

◆ CouenneFeasPump() [1/2]

Couenne::CouenneFeasPump::CouenneFeasPump ( CouenneProblem couenne = NULL,
CouenneCutGenerator cg = NULL,
Ipopt::SmartPtr< Ipopt::OptionsList options = NULL 
)

Constructor with (optional) MINLP pointer.

◆ CouenneFeasPump() [2/2]

Couenne::CouenneFeasPump::CouenneFeasPump ( const CouenneFeasPump other)

Copy constructor.

◆ ~CouenneFeasPump()

virtual Couenne::CouenneFeasPump::~CouenneFeasPump ( )
virtual

Destructor.

Member Function Documentation

◆ clone()

virtual CbcHeuristic * Couenne::CouenneFeasPump::clone ( ) const
virtual

Clone.

Implements CbcHeuristic.

◆ operator=()

CouenneFeasPump & Couenne::CouenneFeasPump::operator= ( const CouenneFeasPump rhs)

Assignment operator.

◆ resetModel()

virtual void Couenne::CouenneFeasPump::resetModel ( CbcModel model)
inlinevirtual

Does nothing, but necessary as CbcHeuristic declares it pure virtual.

Implements CbcHeuristic.

Definition at line 83 of file CouenneFeasPump.hpp.

◆ solution()

virtual int Couenne::CouenneFeasPump::solution ( double &  objectiveValue,
double *  newSolution 
)
virtual

Run heuristic, return 1 if a better solution than the one passed is found and 0 otherwise.

\argument objectiveValue Best known solution in input and value of solution found in output

\argument newSolution Solution found by heuristic.

Implements CbcHeuristic.

◆ setNumberSolvePerLevel()

void Couenne::CouenneFeasPump::setNumberSolvePerLevel ( int  value)
inline

set number of nlp's solved for each given level of the tree

Definition at line 95 of file CouenneFeasPump.hpp.

◆ solveMILP()

virtual CouNumber Couenne::CouenneFeasPump::solveMILP ( const CouNumber nSol,
CouNumber *&  iSol,
int  niter,
int *  nsuciter 
)
virtual

find integer (possibly NLP-infeasible) point isol closest (according to the l-1 norm of the hessian) to the current NLP-feasible (but fractional) solution nsol

◆ solveNLP()

virtual CouNumber Couenne::CouenneFeasPump::solveNLP ( const CouNumber nSol,
CouNumber *&  iSol 
)
virtual

obtain solution to NLP

◆ updateNLPObj()

expression * Couenne::CouenneFeasPump::updateNLPObj ( const double *  )

set new expression as the NLP objective function using argument as point to minimize distance from.

Return new objective function

◆ fixIntVariables()

bool Couenne::CouenneFeasPump::fixIntVariables ( const double *  sol)

admits a (possibly fractional) solution and fixes the integer components in the nonlinear problem for later re-solve.

Returns false if restriction infeasible, true otherwise

◆ registerOptions()

static void Couenne::CouenneFeasPump::registerOptions ( Ipopt::SmartPtr< Bonmin::RegisteredOptions )
static

initialize options to be read later

◆ findSolution()

double Couenne::CouenneFeasPump::findSolution ( const double *  nSol,
double *&  sol,
int  niter,
int *  nsuciter 
)

find feasible solution (called by solveMILP ())

◆ init_MILP()

void Couenne::CouenneFeasPump::init_MILP ( )

initialize all solvers at the first call, where the initial MILP is built

◆ initIpoptApp()

void Couenne::CouenneFeasPump::initIpoptApp ( )

Common code for initializing non-smartptr ipopt application.

◆ Problem()

CouenneProblem * Couenne::CouenneFeasPump::Problem ( ) const
inline

return pointer to problem

Definition at line 135 of file CouenneFeasPump.hpp.

◆ compDistInt()

enum fpCompDistIntType Couenne::CouenneFeasPump::compDistInt ( ) const
inline

return type of MILP solved

Definition at line 139 of file CouenneFeasPump.hpp.

◆ multDistNLP()

double Couenne::CouenneFeasPump::multDistNLP ( ) const
inline

Return Weights in computing distance, in both MILP and NLP (must sum up to 1 for MILP and for NLP):

weight of distance in NLP

Definition at line 145 of file CouenneFeasPump.hpp.

◆ multHessNLP()

double Couenne::CouenneFeasPump::multHessNLP ( ) const
inline

weight of Hessian in NLP

Definition at line 146 of file CouenneFeasPump.hpp.

◆ multObjFNLP()

double Couenne::CouenneFeasPump::multObjFNLP ( ) const
inline

weight of objective in NLP

Definition at line 147 of file CouenneFeasPump.hpp.

◆ multDistMILP()

double Couenne::CouenneFeasPump::multDistMILP ( ) const
inline

weight of distance in MILP

Definition at line 149 of file CouenneFeasPump.hpp.

◆ multHessMILP()

double Couenne::CouenneFeasPump::multHessMILP ( ) const
inline

weight of Hessian in MILP

Definition at line 150 of file CouenneFeasPump.hpp.

◆ multObjFMILP()

double Couenne::CouenneFeasPump::multObjFMILP ( ) const
inline

weight of objective in MILP

Definition at line 151 of file CouenneFeasPump.hpp.

◆ nlp()

CouenneTNLP * Couenne::CouenneFeasPump::nlp ( ) const
inline

return NLP

Definition at line 154 of file CouenneFeasPump.hpp.

◆ nCalls()

int & Couenne::CouenneFeasPump::nCalls ( )
inline

return number of calls (can be changed)

Definition at line 158 of file CouenneFeasPump.hpp.

◆ milpPhase()

int Couenne::CouenneFeasPump::milpPhase ( double *  nSol,
double *  iSol 
)

MILP phase of the FP.

◆ nlpPhase()

int Couenne::CouenneFeasPump::nlpPhase ( double *  iSol,
double *  nSol 
)

NLP phase of the FP.


The documentation for this class was generated from the following file: