33 #ifndef CBC_SYMMETRY_HPP 34 #define CBC_SYMMETRY_HPP 37 #include "nausparse.h" 52 #define NTY_BAD_DEPTH 10 58 #define COUENNE_HACKED_EPS 1.e-07 59 #define COUENNE_HACKED_EPS_SYMM 1e-8 60 #define COUENNE_HACKED_EXPRGROUP 8 79 void node(
int,
double,
double,
double,
int,
int);
80 inline void color_vertex (
register int k) {color = k;}
81 inline int get_index ()
const {
return index;}
82 inline double get_coeff ()
const {
return coeff;}
83 inline double get_lb ()
const {
return lb;}
84 inline double get_ub ()
const {
return ub;}
85 inline int get_color ()
const {
return color;}
86 inline int get_code ()
const {
return code;}
87 inline int get_sign ()
const {
return sign;}
88 inline void bounds(
register double a,
register double b){ lb = a; ub = b;}
92 inline bool operator() (
register const Node &a,
register const Node &b) {
94 return (( a.get_code () < b.get_code ()) ||
95 (( a.get_code () == b.get_code () &&
102 (( a.get_index () < b.get_index ())))))))))));
109 inline bool operator() (
register const Node &a,
register const Node &b) {
110 return (a.get_index() < b.get_index() );
114 struct less_than_str {
115 inline bool operator() (
register const char *a,
register const char *b)
const 116 {
return strcmp (a, b) < 0;}
151 {
return numberUsefulOrbits_ ? whichOrbit_ : NULL;}
153 {
return numberUsefulOrbits_;}
155 {
return numberUsefulObjects_;}
156 int largestOrbit(
const double * lower,
const double * upper)
const;
157 void ChangeBounds (
const double * lower,
const double * upper,
158 int numberColumns,
bool justFixedAtOne)
const;
159 inline bool compare (
register Node &a,
register Node &b)
const;
168 mutable std::vector<Node> node_info_;
171 int numberUsefulOrbits_;
172 int numberUsefulObjects_;
189 CbcNauty (
int n,
const size_t * v,
const int * d,
const int * e);
201 void addElement(
int ix,
int jx);
202 void clearPartitions();
204 void deleteElement(
int ix,
int jx);
206 void insertRHS(
int rhs ,
int cons) {constr_rhs.insert( std::pair<int,int>(rhs,cons));}
208 double getGroupSize()
const;
212 int getN()
const {
return n_; }
214 int getNumGenerators()
const;
215 int getNumOrbits()
const;
218 std::vector<std::vector<int> > *getOrbits()
const;
220 void getVstat(
double *v,
int nv);
222 {
return GSparse_ != NULL;}
224 {
return stats_->errstatus;}
235 void setWriteAutoms (
const std::string &afilename);
236 void unsetWriteAutoms();
242 sparsegraph *GSparse_;
251 TracesOptions *options_;
268 std::multimap<int,int> constr_rhs;
269 std::multimap<int,int>::iterator it;
271 std::pair<std::multimap<int,int>::iterator,
272 std::multimap<int,int>::iterator> ret;
295 int numberExtra,
const int * extraToZero);
311 virtual double branch();
314 virtual void fix(OsiSolverInterface * solver,
315 double * lower,
double * upper,
316 int branchState)
const ;
328 virtual void print();
void setupSymmetry(const OsiSolverInterface &solver)
empty if no NTY, symmetry data structure setup otherwise
void color_node(int ix, int color)
void ChangeBounds(const double *lower, const double *upper, int numberColumns, bool justFixedAtOne) const
#define COUENNE_HACKED_EPS_SYMM
Branching object for Orbital branching.
~CbcSymmetry()
Destructor.
void Compute_Symmetry() const
bool compare(register Node &a, register Node &b) const
Class to deal with symmetry.
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 Print_Orbits() const
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)
int statsOrbits(CbcModel *model, int type) const
virtual void previousBranch()
Reset every information so that the branching object appears to point to the previous child...
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
Simple Branch and bound class.
std::vector< int > * Find_Orbit(int) const
CbcSymmetry()
Default constructor.
int numberUsefulObjects() const