Couenne 0.5.8
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Couenne::CouenneCutGenerator Class Reference

Cut Generator for linear convexifications. More...

#include <CouenneCutGenerator.hpp>

+ Inheritance diagram for Couenne::CouenneCutGenerator:
+ Collaboration diagram for Couenne::CouenneCutGenerator:

Public Member Functions

 CouenneCutGenerator (Bonmin::OsiTMINLPInterface *=NULL, Bonmin::BabSetupBase *base=NULL, CouenneProblem *=NULL, struct ASL *=NULL)
 constructor
 
 CouenneCutGenerator (const CouenneCutGenerator &)
 copy constructor
 
 ~CouenneCutGenerator ()
 destructor
 
CouenneCutGeneratorclone () const
 clone method (necessary for the abstract CglCutGenerator class)
 
CouenneProblemProblem () const
 return pointer to symbolic problem
 
void setProblem (CouenneProblem *p)
 return pointer to symbolic problem
 
int getnvars () const
 total number of variables (original + auxiliary)
 
bool isFirst () const
 has generateCuts been called yet?
 
bool addViolated () const
 should we add the violated cuts only (true), or all of them (false)?
 
enum conv_type ConvType () const
 get convexification type (see CouenneTypes.h)
 
int nSamples () const
 get number of convexification samples
 
void generateCuts (const OsiSolverInterface &, OsiCuts &, const CglTreeInfo=CglTreeInfo()) const
 the main CglCutGenerator
 
int createCut (OsiCuts &, CouNumber, CouNumber, int, CouNumber, int=-1, CouNumber=0., int=-1, CouNumber=0., bool=false) const
 create cut and check violation. Insert and return status
 
int createCut (OsiCuts &, CouNumber, int, int, CouNumber, int=-1, CouNumber=0., int=-1, CouNumber=0., bool=false) const
 create cut and check violation. Other version with only one bound
 
void addEnvelope (OsiCuts &, int, unary_function, unary_function, int, int, CouNumber, CouNumber, CouNumber, t_chg_bounds *=NULL, bool=false) const
 Add general linear envelope to convex function, given its variables' indices, the (univariate) function and its first derivative.
 
void addEnvelope (OsiCuts &, int, funtriplet *, int, int, CouNumber, CouNumber, CouNumber, t_chg_bounds *=NULL, bool=false) const
 Add general linear envelope to convex function, given its variables' indices, the (univariate) function and its first derivative.
 
int addSegment (OsiCuts &, int, int, CouNumber, CouNumber, CouNumber, CouNumber, int) const
 Add half-plane through (x1,y1) and (x2,y2) – resp.
 
int addTangent (OsiCuts &, int, int, CouNumber, CouNumber, CouNumber, int) const
 add tangent at given poing (x,w) with given slope
 
void setBabPtr (Bonmin::Bab *p)
 Method to set the Bab pointer.
 
void getStats (int &nrc, int &ntc, double &st)
 Get statistics.
 
bool & infeasNode () const
 Allow to get and set the infeasNode_ flag (used only in generateCuts())
 
void genRowCuts (const OsiSolverInterface &, OsiCuts &cs, int, int *, t_chg_bounds *=NULL) const
 generate OsiRowCuts for current convexification
 
void genColCuts (const OsiSolverInterface &, OsiCuts &, int, int *) const
 generate OsiColCuts for improved (implied and propagated) bounds
 
void printLineInfo () const
 print node, depth, LB/UB/LP info
 
ConstJnlstPtr Jnlst () const
 Provide Journalist.
 
void setJnlst (JnlstPtr jnlst__)
 
double & rootTime ()
 Time spent at root node.
 
bool check_lp () const
 return check_lp flag (used in CouenneSolverInterface)
 
bool enableLpImpliedBounds () const
 returns value of enable_lp_implied_bounds_
 
- Public Member Functions inherited from CglCutGenerator
virtual void generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())=0
 
 CglCutGenerator ()
 
 CglCutGenerator (const CglCutGenerator &)
 
virtual CglCutGeneratorclone () const=0
 
CglCutGeneratoroperator= (const CglCutGenerator &rhs)
 
virtual ~CglCutGenerator ()
 
virtual std::string generateCpp (FILE *)
 
virtual void refreshSolver (OsiSolverInterface *)
 
int getAggressiveness () const
 
void setAggressiveness (int value)
 
void setGlobalCuts (bool trueOrFalse)
 
bool canDoGlobalCuts () const
 
virtual bool mayGenerateRowCutsInTree () const
 
virtual bool needsOptimalBasis () const
 
virtual int maximumLengthOfCutInTree () const
 
virtual void generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())=0
 
 CglCutGenerator ()
 
 CglCutGenerator (const CglCutGenerator &)
 
virtual CglCutGeneratorclone () const=0
 
CglCutGeneratoroperator= (const CglCutGenerator &rhs)
 
virtual ~CglCutGenerator ()
 
virtual std::string generateCpp (FILE *)
 
virtual void refreshSolver (OsiSolverInterface *)
 

Static Public Member Functions

static void registerOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
 Add list of options to be read from file.
 

Protected Attributes

bool firstcall_
 True if no convexification cuts have been generated yet for this problem.
 
bool addviolated_
 True if we should add the violated cuts only, false if all of them should be added.
 
enum conv_type convtype_
 what kind of sampling should be performed?
 
int nSamples_
 how many cuts should be added for each function?
 
CouenneProblemproblem_
 pointer to symbolic repr. of constraint, variables, and bounds
 
int nrootcuts_
 number of cuts generated at the first call
 
int ntotalcuts_
 total number of cuts generated
 
double septime_
 separation time (includes generation of problem)
 
double objValue_
 Record obj value at final point of CouenneConv.
 
Bonmin::OsiTMINLPInterfacenlp_
 nonlinear solver interface as used within Bonmin (used at first Couenne pass of each b&b node
 
Bonmin::BabBabPtr_
 pointer to the Bab object (used to retrieve the current primal bound through bestObj())
 
bool infeasNode_
 signal infeasibility of current node (found through bound tightening)
 
JnlstPtr jnlst_
 SmartPointer to the Journalist.
 
double rootTime_
 Time spent at the root node.
 
bool check_lp_
 Check all generated LPs through an independent call to OsiClpSolverInterface::initialSolve()
 
bool enable_lp_implied_bounds_
 Take advantage of OsiClpSolverInterface::tightenBounds (), known to have caused some problems some time ago.
 
int lastPrintLine
 Running count of printed info lines.
 

Additional Inherited Members

- Public Attributes inherited from CglCutGenerator
int aggressive_
 
bool canDoGlobalCuts_
 

Detailed Description

Cut Generator for linear convexifications.

Definition at line 49 of file CouenneCutGenerator.hpp.

Constructor & Destructor Documentation

◆ CouenneCutGenerator() [1/2]

Couenne::CouenneCutGenerator::CouenneCutGenerator ( Bonmin::OsiTMINLPInterface = NULL,
Bonmin::BabSetupBase base = NULL,
CouenneProblem = NULL,
struct ASL *  = NULL 
)

constructor

◆ CouenneCutGenerator() [2/2]

Couenne::CouenneCutGenerator::CouenneCutGenerator ( const CouenneCutGenerator )

copy constructor

◆ ~CouenneCutGenerator()

Couenne::CouenneCutGenerator::~CouenneCutGenerator ( )

destructor

Member Function Documentation

◆ clone()

CouenneCutGenerator * Couenne::CouenneCutGenerator::clone ( ) const
inlinevirtual

clone method (necessary for the abstract CglCutGenerator class)

Implements CglCutGenerator.

Definition at line 125 of file CouenneCutGenerator.hpp.

◆ Problem()

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

return pointer to symbolic problem

Definition at line 129 of file CouenneCutGenerator.hpp.

◆ setProblem()

void Couenne::CouenneCutGenerator::setProblem ( CouenneProblem p)
inline

return pointer to symbolic problem

Definition at line 133 of file CouenneCutGenerator.hpp.

◆ getnvars()

int Couenne::CouenneCutGenerator::getnvars ( ) const

total number of variables (original + auxiliary)

◆ isFirst()

bool Couenne::CouenneCutGenerator::isFirst ( ) const
inline

has generateCuts been called yet?

Definition at line 140 of file CouenneCutGenerator.hpp.

◆ addViolated()

bool Couenne::CouenneCutGenerator::addViolated ( ) const
inline

should we add the violated cuts only (true), or all of them (false)?

Definition at line 144 of file CouenneCutGenerator.hpp.

◆ ConvType()

enum conv_type Couenne::CouenneCutGenerator::ConvType ( ) const
inline

get convexification type (see CouenneTypes.h)

Definition at line 148 of file CouenneCutGenerator.hpp.

◆ nSamples()

int Couenne::CouenneCutGenerator::nSamples ( ) const
inline

get number of convexification samples

Definition at line 152 of file CouenneCutGenerator.hpp.

◆ generateCuts()

void Couenne::CouenneCutGenerator::generateCuts ( const OsiSolverInterface ,
OsiCuts ,
const  CglTreeInfo = CglTreeInfo() 
) const

the main CglCutGenerator

◆ createCut() [1/2]

int Couenne::CouenneCutGenerator::createCut ( OsiCuts ,
CouNumber  ,
CouNumber  ,
int  ,
CouNumber  ,
int  = -1,
CouNumber  = 0.,
int  = -1,
CouNumber  = 0.,
bool  = false 
) const

create cut and check violation. Insert and return status

◆ createCut() [2/2]

int Couenne::CouenneCutGenerator::createCut ( OsiCuts ,
CouNumber  ,
int  ,
int  ,
CouNumber  ,
int  = -1,
CouNumber  = 0.,
int  = -1,
CouNumber  = 0.,
bool  = false 
) const

create cut and check violation. Other version with only one bound

◆ addEnvelope() [1/2]

void Couenne::CouenneCutGenerator::addEnvelope ( OsiCuts ,
int  ,
unary_function  ,
unary_function  ,
int  ,
int  ,
CouNumber  ,
CouNumber  ,
CouNumber  ,
t_chg_bounds = NULL,
bool  = false 
) const

Add general linear envelope to convex function, given its variables' indices, the (univariate) function and its first derivative.

◆ addEnvelope() [2/2]

void Couenne::CouenneCutGenerator::addEnvelope ( OsiCuts ,
int  ,
funtriplet ,
int  ,
int  ,
CouNumber  ,
CouNumber  ,
CouNumber  ,
t_chg_bounds = NULL,
bool  = false 
) const

Add general linear envelope to convex function, given its variables' indices, the (univariate) function and its first derivative.

◆ addSegment()

int Couenne::CouenneCutGenerator::addSegment ( OsiCuts ,
int  ,
int  ,
CouNumber  ,
CouNumber  ,
CouNumber  ,
CouNumber  ,
int   
) const

Add half-plane through (x1,y1) and (x2,y2) – resp.

4th, 5th, 6th, and 7th argument

◆ addTangent()

int Couenne::CouenneCutGenerator::addTangent ( OsiCuts ,
int  ,
int  ,
CouNumber  ,
CouNumber  ,
CouNumber  ,
int   
) const

add tangent at given poing (x,w) with given slope

◆ setBabPtr()

void Couenne::CouenneCutGenerator::setBabPtr ( Bonmin::Bab p)
inline

Method to set the Bab pointer.

Definition at line 218 of file CouenneCutGenerator.hpp.

◆ getStats()

void Couenne::CouenneCutGenerator::getStats ( int &  nrc,
int &  ntc,
double &  st 
)
inline

Get statistics.

Definition at line 222 of file CouenneCutGenerator.hpp.

◆ infeasNode()

bool & Couenne::CouenneCutGenerator::infeasNode ( ) const
inline

Allow to get and set the infeasNode_ flag (used only in generateCuts())

Definition at line 229 of file CouenneCutGenerator.hpp.

◆ genRowCuts()

void Couenne::CouenneCutGenerator::genRowCuts ( const OsiSolverInterface ,
OsiCuts cs,
int  ,
int *  ,
t_chg_bounds = NULL 
) const

generate OsiRowCuts for current convexification

◆ genColCuts()

void Couenne::CouenneCutGenerator::genColCuts ( const OsiSolverInterface ,
OsiCuts ,
int  ,
int *   
) const

generate OsiColCuts for improved (implied and propagated) bounds

◆ registerOptions()

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

Add list of options to be read from file.

◆ printLineInfo()

void Couenne::CouenneCutGenerator::printLineInfo ( ) const

print node, depth, LB/UB/LP info

◆ Jnlst()

ConstJnlstPtr Couenne::CouenneCutGenerator::Jnlst ( ) const
inline

Provide Journalist.

Definition at line 246 of file CouenneCutGenerator.hpp.

◆ setJnlst()

void Couenne::CouenneCutGenerator::setJnlst ( JnlstPtr  jnlst__)
inline

Definition at line 249 of file CouenneCutGenerator.hpp.

◆ rootTime()

double & Couenne::CouenneCutGenerator::rootTime ( )
inline

Time spent at root node.

Definition at line 253 of file CouenneCutGenerator.hpp.

◆ check_lp()

bool Couenne::CouenneCutGenerator::check_lp ( ) const
inline

return check_lp flag (used in CouenneSolverInterface)

Definition at line 257 of file CouenneCutGenerator.hpp.

◆ enableLpImpliedBounds()

bool Couenne::CouenneCutGenerator::enableLpImpliedBounds ( ) const
inline

returns value of enable_lp_implied_bounds_

Definition at line 261 of file CouenneCutGenerator.hpp.

Member Data Documentation

◆ firstcall_

bool Couenne::CouenneCutGenerator::firstcall_
mutableprotected

True if no convexification cuts have been generated yet for this problem.

Definition at line 55 of file CouenneCutGenerator.hpp.

◆ addviolated_

bool Couenne::CouenneCutGenerator::addviolated_
mutableprotected

True if we should add the violated cuts only, false if all of them should be added.

Definition at line 59 of file CouenneCutGenerator.hpp.

◆ convtype_

enum conv_type Couenne::CouenneCutGenerator::convtype_
protected

what kind of sampling should be performed?

Definition at line 62 of file CouenneCutGenerator.hpp.

◆ nSamples_

int Couenne::CouenneCutGenerator::nSamples_
protected

how many cuts should be added for each function?

Definition at line 65 of file CouenneCutGenerator.hpp.

◆ problem_

CouenneProblem* Couenne::CouenneCutGenerator::problem_
protected

pointer to symbolic repr. of constraint, variables, and bounds

Definition at line 68 of file CouenneCutGenerator.hpp.

◆ nrootcuts_

int Couenne::CouenneCutGenerator::nrootcuts_
mutableprotected

number of cuts generated at the first call

Definition at line 71 of file CouenneCutGenerator.hpp.

◆ ntotalcuts_

int Couenne::CouenneCutGenerator::ntotalcuts_
mutableprotected

total number of cuts generated

Definition at line 74 of file CouenneCutGenerator.hpp.

◆ septime_

double Couenne::CouenneCutGenerator::septime_
mutableprotected

separation time (includes generation of problem)

Definition at line 77 of file CouenneCutGenerator.hpp.

◆ objValue_

double Couenne::CouenneCutGenerator::objValue_
mutableprotected

Record obj value at final point of CouenneConv.

Definition at line 80 of file CouenneCutGenerator.hpp.

◆ nlp_

Bonmin::OsiTMINLPInterface* Couenne::CouenneCutGenerator::nlp_
protected

nonlinear solver interface as used within Bonmin (used at first Couenne pass of each b&b node

Definition at line 84 of file CouenneCutGenerator.hpp.

◆ BabPtr_

Bonmin::Bab* Couenne::CouenneCutGenerator::BabPtr_
protected

pointer to the Bab object (used to retrieve the current primal bound through bestObj())

Definition at line 88 of file CouenneCutGenerator.hpp.

◆ infeasNode_

bool Couenne::CouenneCutGenerator::infeasNode_
mutableprotected

signal infeasibility of current node (found through bound tightening)

Definition at line 91 of file CouenneCutGenerator.hpp.

◆ jnlst_

JnlstPtr Couenne::CouenneCutGenerator::jnlst_
protected

SmartPointer to the Journalist.

Definition at line 94 of file CouenneCutGenerator.hpp.

◆ rootTime_

double Couenne::CouenneCutGenerator::rootTime_
mutableprotected

Time spent at the root node.

Definition at line 97 of file CouenneCutGenerator.hpp.

◆ check_lp_

bool Couenne::CouenneCutGenerator::check_lp_
protected

Check all generated LPs through an independent call to OsiClpSolverInterface::initialSolve()

Definition at line 101 of file CouenneCutGenerator.hpp.

◆ enable_lp_implied_bounds_

bool Couenne::CouenneCutGenerator::enable_lp_implied_bounds_
protected

Take advantage of OsiClpSolverInterface::tightenBounds (), known to have caused some problems some time ago.

Definition at line 105 of file CouenneCutGenerator.hpp.

◆ lastPrintLine

int Couenne::CouenneCutGenerator::lastPrintLine
mutableprotected

Running count of printed info lines.

Definition at line 108 of file CouenneCutGenerator.hpp.


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