Nauty.h

Go to the documentation of this file.
00001 /* $Id: Nauty.h 858 2012-06-12 03:41:05Z pbelotti $ 
00002  *
00003  * Name:    Nauty.cpp
00004  * Authors: Jim Ostrowski
00005  * Purpose: Branching with symmetry
00006  * Date:    October 13, 2010
00007  *
00008  * This file is licensed under the Common Public License (CPL)
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 #include <string>
00022 
00023 class Nauty
00024 {
00025 
00026 public:
00027   enum VarStatus { FIX_AT_ZERO, FIX_AT_ONE, FREE };
00028   
00029   Nauty(int n_);
00030   ~Nauty();
00031 
00032   void addElement(int ix, int jx);
00033   void clearPartitions();
00034   void computeAuto();
00035   void deleteElement(int ix, int jx);
00036   void color_node(int ix, int color) { vstat_[ix] = color; }
00037   void insertRHS(int rhs , int cons) {constr_rhs.insert( std::pair<int,int>(rhs,cons));}
00038   
00039   double getGroupSize() const;
00040   int getNautyCalls() const { return nautyCalls_; }
00041   double getNautyTime() const { return nautyTime_; }
00042 
00043   int getN() const { return n_; }
00044   
00045   int getNumGenerators() const;
00046   int getNumOrbits() const;
00047 
00049   std::vector<std::vector<int> > *getOrbits() const;
00050 
00051   void getVstat(double *v, int nv);
00052 
00056   //  bool isAllFixOneOrbit(const std::vector<int> &orbit) const;
00057   // bool isAllFreeOrbit(const std::vector<int> &orbit) const;
00058   //bool isAutoComputed() const { return autoComputed_; }
00059   //bool isConstraintOrbit(const std::vector<int> &orbit) const;
00060   //bool isMixedFreeZeroOrbit(const std::vector<int> &orbit) const;
00061   //void makeFree(int ix) { vstat_[ix] = FREE; }  
00062 
00063   void setWriteAutoms (const std::string &afilename);
00064   void unsetWriteAutoms();
00065 
00066 private:
00067 
00068   Nauty ();
00069 
00070   // The base nauty stuff
00071   graph *G_;
00072   int *lab_;
00073   int *ptn_;
00074   set *active_;
00075   int *orbits_;
00076   optionblk *options_;
00077   statsblk *stats_;
00078   setword *workspace_;
00079   int worksize_;
00080   int m_;
00081   int n_;
00082   graph *canonG_;
00083   
00084   bool autoComputed_;
00085 
00086   int *vstat_;
00087 
00088   static int nautyCalls_;
00089   static double nautyTime_;
00090 
00091   std::multimap<int,int> constr_rhs;
00092   std::multimap<int,int>::iterator it;
00093 
00094   std::pair<std::multimap<int,int>::iterator,
00095             std::multimap<int,int>::iterator> ret;
00096 
00097   // File pointer for automorphism group
00098   FILE *afp_;
00099 
00100 };
00101 
00102 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 13 May 2015 for Couenne by  doxygen 1.6.1