Couenne  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Nauty.h
Go to the documentation of this file.
1 /* $Id: Nauty.h 858 2012-06-12 03:41:05Z pbelotti $
2  *
3  * Name: Nauty.cpp
4  * Authors: Jim Ostrowski
5  * Purpose: Branching with symmetry
6  * Date: October 13, 2010
7  *
8  * This file is licensed under the Common Public License (CPL)
9  */
10 
11 #ifndef NAUTY_H
12 #define NAUTY_H
13 
14 extern "C" {
15 #include "nauty.h"
16 }
17 
18 #include <cstdio>
19 #include <map>
20 #include <vector>
21 #include <string>
22 
23 class Nauty
24 {
25 
26 public:
28 
29  Nauty(int n_);
30  ~Nauty();
31 
32  void addElement(int ix, int jx);
33  void clearPartitions();
34  void computeAuto();
35  void deleteElement(int ix, int jx);
36  void color_node(int ix, int color) { vstat_[ix] = color; }
37  void insertRHS(int rhs , int cons) {constr_rhs.insert( std::pair<int,int>(rhs,cons));}
38 
39  double getGroupSize() const;
40  int getNautyCalls() const { return nautyCalls_; }
41  double getNautyTime() const { return nautyTime_; }
42 
43  int getN() const { return n_; }
44 
45  int getNumGenerators() const;
46  int getNumOrbits() const;
47 
49  std::vector<std::vector<int> > *getOrbits() const;
50 
51  void getVstat(double *v, int nv);
52 
56  // bool isAllFixOneOrbit(const std::vector<int> &orbit) const;
57  // bool isAllFreeOrbit(const std::vector<int> &orbit) const;
58  //bool isAutoComputed() const { return autoComputed_; }
59  //bool isConstraintOrbit(const std::vector<int> &orbit) const;
60  //bool isMixedFreeZeroOrbit(const std::vector<int> &orbit) const;
61  //void makeFree(int ix) { vstat_[ix] = FREE; }
62 
63  void setWriteAutoms (const std::string &afilename);
64  void unsetWriteAutoms();
65 
66 private:
67 
68  Nauty ();
69 
70  // The base nauty stuff
71  graph *G_;
72  int *lab_;
73  int *ptn_;
74  set *active_;
75  int *orbits_;
76  optionblk *options_;
77  statsblk *stats_;
78  setword *workspace_;
79  int worksize_;
80  int m_;
81  int n_;
82  graph *canonG_;
83 
85 
86  int *vstat_;
87 
88  static int nautyCalls_;
89  static double nautyTime_;
90 
91  std::multimap<int,int> constr_rhs;
92  std::multimap<int,int>::iterator it;
93 
94  std::pair<std::multimap<int,int>::iterator,
95  std::multimap<int,int>::iterator> ret;
96 
97  // File pointer for automorphism group
98  FILE *afp_;
99 
100 };
101 
102 #endif
static double nautyTime_
Definition: Nauty.h:89
void computeAuto()
std::multimap< int, int >::iterator it
Definition: Nauty.h:92
int * lab_
Definition: Nauty.h:72
void addElement(int ix, int jx)
statsblk * stats_
Definition: Nauty.h:77
optionblk * options_
Definition: Nauty.h:76
int * vstat_
Definition: Nauty.h:86
VarStatus
Definition: Nauty.h:27
void getVstat(double *v, int nv)
int getN() const
Definition: Nauty.h:43
void deleteElement(int ix, int jx)
int * orbits_
Definition: Nauty.h:75
int m_
Definition: Nauty.h:80
std::multimap< int, int > constr_rhs
Definition: Nauty.h:91
void clearPartitions()
void color_node(int ix, int color)
Definition: Nauty.h:36
setword * workspace_
Definition: Nauty.h:78
int getNautyCalls() const
Definition: Nauty.h:40
int getNumGenerators() const
void unsetWriteAutoms()
int * ptn_
Definition: Nauty.h:73
bool autoComputed_
Definition: Nauty.h:84
std::pair< std::multimap< int, int >::iterator, std::multimap< int, int >::iterator > ret
Definition: Nauty.h:95
int getNumOrbits() const
set * active_
Definition: Nauty.h:74
FILE * afp_
Definition: Nauty.h:98
void setWriteAutoms(const std::string &afilename)
Methods to classify orbits.
double getNautyTime() const
Definition: Nauty.h:41
void insertRHS(int rhs, int cons)
Definition: Nauty.h:37
std::vector< std::vector< int > > * getOrbits() const
Returns the orbits in a &quot;convenient&quot; form.
graph * canonG_
Definition: Nauty.h:82
Definition: Nauty.h:23
int worksize_
Definition: Nauty.h:79
int n_
Definition: Nauty.h:81
double getGroupSize() const
graph * G_
Definition: Nauty.h:71
static int nautyCalls_
Definition: Nauty.h:88