00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _Equation_h__
00011 #define _Equation_h__
00012
00013
00014 #include "GraphType.h"
00015 #include "GraphConcept.h"
00016 #include "GraphConceptAlgorithms.h"
00017 using namespace Graphs;
00018
00019 #include "Word.h"
00020
00021
00022
00023
00024
00025
00026
00027 class Equation
00028 {
00029
00031
00032
00033
00035
00036 public:
00037
00038 Equation( int nGen , int nVar , const Word& eq );
00039
00041
00042
00043
00045
00046 public:
00047
00048
00050 int getTheNumberOfGenerators( ) const { return theNumberOfGenerators; }
00052 int getTheNumberOfVariables( ) const { return theNumberOfVariables; }
00054 const Word& getTheEquation( ) const { return theEquation; }
00055
00057 bool isQuadratic( ) const;
00058
00060 pair< IntLabeledGraph , map< Word , int > > constructTransformationGraph( ) const;
00061
00063 bool trivialSolution( ) const;
00064
00066
00067
00068
00070
00071 private:
00072
00073 friend ostream& operator << ( ostream& os , const Equation& eq );
00074
00076
00077
00078
00080
00081 private:
00082
00083 bool isGenerator( int g ) const;
00084 bool isVariable ( int g ) const;
00085
00087 void addEquationToTransformationGraph( const Word& eq , set< Word >& chk_eq , set< Word >& new_eq , const set< int >& permutableGenerators , int x , const Word& im ) const;
00088
00089
00091
00092
00093
00095
00096 private:
00097
00099 int theNumberOfGenerators;
00101 int theNumberOfVariables;
00103
00109 Word theEquation;
00110
00111 };
00112
00113
00114 #endif
00115