Nauty.h

Go to the documentation of this file.
00001 /* $Id: Nauty.h 487 2011-01-10 16:18:44Z 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 
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   //  bool isAllFixOneOrbit(const std::vector<int> &orbit) const;
00056   // bool isAllFreeOrbit(const std::vector<int> &orbit) const;
00057   //bool isAutoComputed() const { return autoComputed_; }
00058   //bool isConstraintOrbit(const std::vector<int> &orbit) const;
00059   //bool isMixedFreeZeroOrbit(const std::vector<int> &orbit) const;
00060   //void makeFree(int ix) { vstat_[ix] = FREE; }  
00061   //  void setWriteAutoms(const std::string &afilename);
00062   //void unsetWriteAutoms();
00063 
00064 private:
00065 
00066   Nauty ();
00067 
00068   // The base nauty stuff
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   // File pointer for automorphism group
00096   FILE *afp_;
00097 
00098 };
00099 
00100 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 2 Aug 2012 for Couenne by  doxygen 1.6.1