00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef NAUTY_H
00012 #define NAUTY_H
00013
00014 extern "C" {
00015 #include "nauty.h"
00016 }
00017
00018 #include <cstdio>
00019 #include <map>
00020 #include <vector>
00021
00022 class Nauty
00023 {
00024
00025 public:
00026 enum VarStatus { FIX_AT_ZERO, FIX_AT_ONE, FREE };
00027
00028 Nauty(int n_);
00029 ~Nauty();
00030
00031 void addElement(int ix, int jx);
00032 void clearPartitions();
00033 void computeAuto();
00034 void deleteElement(int ix, int jx);
00035 void color_node(int ix, int color) { vstat_[ix] = color; }
00036 void insertRHS(int rhs , int cons) {constr_rhs.insert( std::pair<int,int>(rhs,cons));}
00037
00038 double getGroupSize() const;
00039 int getNautyCalls() const { return nautyCalls_; }
00040 double getNautyTime() const { return nautyTime_; }
00041
00042 int getN() const { return n_; }
00043
00044 int getNumGenerators() const;
00045 int getNumOrbits() const;
00046
00048 std::vector<std::vector<int> > *getOrbits() const;
00049
00050 void getVstat(double *v, int nv);
00051
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 private:
00065
00066 Nauty ();
00067
00068
00069 graph *G_;
00070 int *lab_;
00071 int *ptn_;
00072 set *active_;
00073 int *orbits_;
00074 optionblk *options_;
00075 statsblk *stats_;
00076 setword *workspace_;
00077 int worksize_;
00078 int m_;
00079 int n_;
00080 graph *canonG_;
00081
00082 bool autoComputed_;
00083
00084 int *vstat_;
00085
00086 static int nautyCalls_;
00087 static double nautyTime_;
00088
00089 std::multimap<int,int> constr_rhs;
00090 std::multimap<int,int>::iterator it;
00091
00092 std::pair<std::multimap<int,int>::iterator,
00093 std::multimap<int,int>::iterator> ret;
00094
00095
00096 FILE *afp_;
00097
00098 };
00099
00100 #endif