33 #ifndef CBC_SYMMETRY_HPP
34 #define CBC_SYMMETRY_HPP
37 #include "nausparse.h"
52 #define NTY_BAD_DEPTH 10
65 void node(
int,
double,
double,
double,
int,
int);
69 inline double get_lb ()
const {
return lb;}
70 inline double get_ub ()
const {
return ub;}
74 inline void bounds(
register double a,
register double b){ lb = a; ub = b;}
77 #define COUENNE_HACKED_EPS 1.e-07
78 #define COUENNE_HACKED_EPS_SYMM 1e-8
79 #define COUENNE_HACKED_EXPRGROUP 8
105 inline bool operator() (
register const char *a,
register const char *b)
const
106 {
return strcmp (a, b) < 0;}
148 {
return numberUsefulOrbits_ ? whichOrbit_ : NULL;}
150 {
return numberUsefulOrbits_;}
152 {
return numberUsefulObjects_;}
153 int largestOrbit(
const double * lower,
const double * upper)
const;
154 void ChangeBounds (
const double * lower,
const double * upper,
155 int numberColumns,
bool justFixedAtOne)
const;
165 mutable std::vector<Node> node_info_;
168 int numberUsefulOrbits_;
169 int numberUsefulObjects_;
186 CbcNauty (
int n,
const size_t * v,
const int * d,
const int * e);
203 void insertRHS(
int rhs ,
int cons) {constr_rhs.insert( std::pair<int,int>(rhs,cons));}
209 int getN()
const {
return n_; }
215 std::vector<std::vector<int> > *
getOrbits()
const;
219 {
return GSparse_ != NULL;}
221 {
return stats_->errstatus;}
239 sparsegraph *GSparse_;
248 TracesOptions *options_;
265 std::multimap<int,int> constr_rhs;
266 std::multimap<int,int>::iterator it;
268 std::pair<std::multimap<int,int>::iterator,
269 std::multimap<int,int>::iterator> ret;
292 int numberExtra,
const int * extraToZero);
311 virtual void fix(OsiSolverInterface * solver,
312 double * lower,
double * upper,
313 int branchState)
const ;
325 virtual void print();
void setupSymmetry(const OsiSolverInterface &solver)
empty if no NTY, symmetry data structure setup otherwise
void bounds(register double a, register double b)
void color_node(int ix, int color)
virtual ~CbcOrbitalBranchingObject()
void addElement(int ix, int jx)
virtual CbcBranchingObject * clone() const
Clone.
void ChangeBounds(const double *lower, const double *upper, int numberColumns, bool justFixedAtOne) const
#define COUENNE_HACKED_EPS_SYMM
bool operator()(register const Node &a, register const Node &b)
void deleteElement(int ix, int jx)
bool operator()(register const char *a, register const char *b) const
std::vector< std::vector< int > > * getOrbits() const
Returns the orbits in a "convenient" form.
virtual double branch()
Does next branch and updates state.
Branching object for Orbital branching.
~CbcSymmetry()
Destructor.
void node(int, double, double, double, int, int)
void Compute_Symmetry() const
bool compare(register Node &a, register Node &b) const
Class to deal with symmetry.
double getGroupSize() const
void setWriteAutoms(const std::string &afilename)
Methods to classify orbits.
int way() const
Get the state of the branching object.
Abstract branching object base class Now just difference with OsiBranchingObject. ...
int numberUsefulOrbits() const
virtual void previousBranch()
Reset every information so that the branching object appears to point to the previous child...
void getVstat(double *v, int nv)
virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
Compare the this with brObj.
void Print_Orbits() const
CbcOrbitalBranchingObject & operator=(const CbcOrbitalBranchingObject &rhs)
CbcModel * model() const
Return model.
virtual double branch()=0
Execute the actions required to branch, as specified by the current state of the branching object...
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
virtual void print() const
Print something about branch - only if log level high.
void insertRHS(int rhs, int cons)
void color_vertex(register int k)
int statsOrbits(CbcModel *model, int type) const
CbcNauty & operator=(const CbcNauty &rhs)
Assignment operator.
virtual int compareOriginalObject(const CbcBranchingObject *brObj) const
Compare the original object of this with the original object of brObj.
CbcOrbitalBranchingObject()
virtual void print()
Print something about branch - only if log level high.
virtual void previousBranch()
Reset every information so that the branching object appears to point to the previous child...
virtual void fix(OsiSolverInterface *solver, double *lower, double *upper, int branchState) const
Update bounds in solver as in 'branch' and update given bounds.
CbcSymmetry & operator=(const CbcSymmetry &rhs)
Assignment operator.
int orbitalFixing(OsiSolverInterface *solver)
Fixes variables using orbits (returns number fixed)
int largestOrbit(const double *lower, const double *upper) const
bool operator()(register const Node &a, register const Node &b)
Simple Branch and bound class.
int getNumGenerators() const
std::vector< int > * Find_Orbit(int) const
CbcSymmetry()
Default constructor.
int numberUsefulObjects() const