00001 #ifndef _HOMFINDER_H_
00002 #define _HOMFINDER_H_
00003
00004 #include "algebras.H"
00005 #include "matrix.H"
00006 #include "my_gmp.H"
00007 #include "ftwo.H"
00008 #include <string>
00009 using namespace std;
00010
00011
00012
00014
00061 class HomFinder {
00062 private:
00063 list< Matrix<F_2> > GL;
00064 list< long > basic_variables;
00065 list< long > target_basic_variables;
00066 list< long > higher_variables;
00067 list< long > polvars;
00069 map< long, Tuple< Polynomial<F_2> > > monomials;
00070 ZZ possibilities;
00072
00077 GradedAlgebra<F_2> basic_source;
00078 list< Polynomial<F_2> > higher_relations;
00079 AffineHomomorphism<F_2> f;
00080
00081
00083 ZZ populate_GL(long n);
00085
00091 ZZ filter_GL();
00093
00104 void set_hom_from_matrix(AffineHomomorphism<F_2>& phi,
00105 const list< long >& basics,
00106 const Matrix<F_2>& M);
00107 void set_f_from_matrix(const Matrix<F_2>& M);
00108 void set_f_from_integer(ZZ code);
00110
00127 void branch(const AffineHomomorphism<F_2>& phi,
00128 list< Polynomial<F_2> >::iterator next,
00129 long depth);
00130
00131
00132 public:
00133 bool verbose, very_verbose;
00134 GradedAlgebra<F_2> *source;
00135 const GradedAlgebra<F_2> *target;
00136 list< AffineHomomorphism<F_2> > solutions;
00138
00146 ZZ solution_count;
00147
00148 HomFinder();
00149 HomFinder(GradedAlgebra<F_2> *thesource, GradedAlgebra<F_2> *thetarget);
00151 void read_solutions_from(ifstream& file);
00153 void write_solutions_to(ofstream& file);
00155
00169 void init();
00171
00187 void start();
00189
00201 void define_polynomial_variables();
00203
00208 void define_polynomial_variables_brutally();
00209 void old_define_polynomial_variables();
00211
00216 void identify();
00218
00227 long weight(const Polynomial<F_2>& relation, const AffineHomomorphism<F_2>& phi);
00229
00234 void sort();
00236 void test_steenrod();
00238 void restrict_to_elemab(ifstream& res_file);
00240
00250 void get_equivalence_class(const list< AffineHomomorphism<F_2> >& homs,
00251 const AffineHomomorphism<F_2>& f);
00253
00257 bool polvars_are_involved_in(const AffineHomomorphism<F_2>& f);
00259
00264 long extend(AffineHomomorphism<F_2>& f);
00266
00274 long extend_all();
00276
00285 bool polynomial_test();
00287
00290 void compute_all_kernels();
00291 };
00292
00293
00294 #endif
00295
00296
00297
00298
00299
00300
00301