Loading...
Searching...
No Matches
CglCutGenerator.hpp
Go to the documentation of this file.
// 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 CglCutGenerator_H
#define CglCutGenerator_H
#include "OsiCuts.hpp"
#include "OsiSolverInterface.hpp"
#include "CglTreeInfo.hpp"
//-------------------------------------------------------------------
//
// Abstract base class for generating cuts.
//
//-------------------------------------------------------------------
class CglCutGenerator {
public:
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs,
const CglTreeInfo info = CglTreeInfo())
= 0;
CglCutGenerator();
CglCutGenerator(const CglCutGenerator &);
virtual CglCutGenerator *clone() const = 0;
CglCutGenerator &operator=(const CglCutGenerator &rhs);
virtual ~CglCutGenerator();
virtual std::string generateCpp(FILE *) { return ""; }
virtual void refreshSolver(OsiSolverInterface *) {}
inline int getAggressiveness() const
{
return aggressive_;
}
inline void setAggressiveness(int value)
{
aggressive_ = value;
}
inline void setGlobalCuts(bool trueOrFalse)
{
canDoGlobalCuts_ = trueOrFalse;
}
inline bool canDoGlobalCuts() const
{
return canDoGlobalCuts_;
}
virtual bool mayGenerateRowCutsInTree() const;
virtual bool needsOptimalBasis() const;
virtual int maximumLengthOfCutInTree() const
{
return COIN_INT_MAX;
}
// test this class
//static void unitTest();
// private:
int aggressive_;
bool canDoGlobalCuts_;
};
#endif
/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
CglTreeInfo.hpp
CglCutGenerator::operator=
CglCutGenerator & operator=(const CglCutGenerator &rhs)
Assignment operator.
CglCutGenerator::clone
virtual CglCutGenerator * clone() const =0
Clone.
CglCutGenerator::setGlobalCuts
void setGlobalCuts(bool trueOrFalse)
Set whether can do global cuts.
Definition CglCutGenerator.hpp:90
CglCutGenerator::generateCuts
virtual void generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())=0
Generate cuts for the model data contained in si.
CglCutGenerator::aggressive_
int aggressive_
Aggressiveness - 0 = neutral, 100 is normal root node.
Definition CglCutGenerator.hpp:125
CglCutGenerator::getAggressiveness
int getAggressiveness() const
Get Aggressiveness - 0 = neutral, 100 is normal root node.
Definition CglCutGenerator.hpp:76
CglCutGenerator::canDoGlobalCuts
bool canDoGlobalCuts() const
Say whether can do global cuts.
Definition CglCutGenerator.hpp:95
CglCutGenerator::CglCutGenerator
CglCutGenerator()
Default constructor.
CglCutGenerator::mayGenerateRowCutsInTree
virtual bool mayGenerateRowCutsInTree() const
Returns true if may generate Row cuts in tree (rather than root node).
CglCutGenerator::maximumLengthOfCutInTree
virtual int maximumLengthOfCutInTree() const
Return maximum length of cut in tree.
Definition CglCutGenerator.hpp:110
CglCutGenerator::setAggressiveness
void setAggressiveness(int value)
Set Aggressiveness - 0 = neutral, 100 is normal root node.
Definition CglCutGenerator.hpp:85
CglCutGenerator::CglCutGenerator
CglCutGenerator(const CglCutGenerator &)
Copy constructor.
CglCutGenerator::~CglCutGenerator
virtual ~CglCutGenerator()
Destructor.
CglCutGenerator::needsOptimalBasis
virtual bool needsOptimalBasis() const
Return true if needs optimal basis to do cuts.
CglCutGenerator::generateCpp
virtual std::string generateCpp(FILE *)
Create C++ lines to set the generator in the current state.
Definition CglCutGenerator.hpp:64
CglCutGenerator::refreshSolver
virtual void refreshSolver(OsiSolverInterface *)
This can be used to refresh any information.
Definition CglCutGenerator.hpp:67
CglCutGenerator::canDoGlobalCuts_
bool canDoGlobalCuts_
True if can do global cuts i.e. no general integers.
Definition CglCutGenerator.hpp:127
CglTreeInfo
Information about where the cut generator is invoked from.
Definition CglTreeInfo.hpp:15