Couenne 0.5.8
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
14extern "C" {
15#include "nauty.h"
16}
17
18#include <cstdio>
19#include <map>
20#include <vector>
21#include <string>
22
23class Nauty
24{
25
26public:
28
29 Nauty(int n_);
31
32 void addElement(int ix, int jx);
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);
65
66private:
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
84 bool autoComputed_;
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
Definition: Nauty.h:24
void unsetWriteAutoms()
int getNumGenerators() const
void computeAuto()
std::vector< std::vector< int > > * getOrbits() const
Returns the orbits in a "convenient" form.
double getGroupSize() const
int getNautyCalls() const
Definition: Nauty.h:40
void color_node(int ix, int color)
Definition: Nauty.h:36
void getVstat(double *v, int nv)
double getNautyTime() const
Definition: Nauty.h:41
void addElement(int ix, int jx)
void setWriteAutoms(const std::string &afilename)
Methods to classify orbits.
void deleteElement(int ix, int jx)
VarStatus
Definition: Nauty.h:27
@ FIX_AT_ZERO
Definition: Nauty.h:27
@ FREE
Definition: Nauty.h:27
@ FIX_AT_ONE
Definition: Nauty.h:27
void insertRHS(int rhs, int cons)
Definition: Nauty.h:37
int getN() const
Definition: Nauty.h:43
void clearPartitions()
Nauty(int n_)
int getNumOrbits() const