milnor.cpp

00001 #include <fstream>
00002 #include <iostream>
00003 #include "tables.H"
00004 #include "algebras.H"
00005 #include "my_gmp.H"
00006 #include "ftwo.H"
00007 #include <string>
00008 #include "derive.H"
00009 #include "cmdline.H"
00010 using namespace std;
00011 
00012 
00013 int main(int argc, char** argv)
00014 {
00016   // initialization   /////////////////////////////
00018 
00019   CommandLine::init(argc, argv);
00020   string name= CommandLine::parameters[0] + ".final";
00021 
00022   ifstream my_source(name.c_str());
00023   if(my_source.fail()) {
00024     cout << "cannot read file" << endl;
00025     return 2;
00026   }
00027 
00028   UnstableAlgebra A;
00029   my_source >> A;
00030 
00031 //   Polynomial<F_2> x, y, z, t, u, P;//these commented
00032 //   x=  A.new_variable("X", 1);            //lines correspond
00033 //   y=  A.new_variable("Y", 1);            //to an example
00034 //   z=  A.new_variable("Z", 1);            //written "by hand"
00035 //   // t=  A.new_variable("T", 1);         //rather than loaded
00036 //   //  u=  A.new_variable("D", 4);        //from a file.
00037 //   A.write_trivial_steenrod_operations();
00038 //   P= A.one();
00039 //  //  P.sets_to_zero();
00040 // //   A.steenrod[3][1]= P;
00041 // //   A.steenrod[3][2]= P;
00042 // //   A.steenrod[3][3]= P;
00043 
00044 // //   A.add_relation(x*x + x*y + y*y);
00045 //   //A.add_relation(x*y + z*t);
00046 //   A.saturate_and_reduce();
00047   A.display();
00048   A.find_grobner_basis();
00049 
00050   MilnorAnalyzer der;
00051   der.start( &A );
00052   
00053   GradedAlgebra<F_2> milnor;
00054   AffineHomomorphism<F_2> reduction, section, milnor_inclusion;
00055   // we make a copy of der.ans, which is the
00056   // answer, and we find a simpler presentation
00057   milnor= der.ans;
00058   milnor.fix_alphabets();
00059   //set the reduction homomorphism
00060   reduction.source= &der.ans;
00061   reduction.target= &milnor;
00062   milnor.split_and_sort_relations();
00063   reduction.get_data_from( milnor.find_redundancies() );
00064   //now find a section for it
00065   section= reduction.simple_section();
00066   milnor_inclusion= der.ans_inclusion * section;
00067 
00068   cout << "Milnor constants: " << endl
00069        << milnor << endl
00070        << "where: " << endl
00071        << milnor_inclusion
00072        << endl;
00073   //now save
00074   string out_name= CommandLine::parameters[0] + ".milnor";
00075   ofstream my_out(out_name.c_str());
00076 
00077   milnor.relations.generators.clear();
00078   my_out << milnor;
00079   my_out << milnor_inclusion;
00080 
00081   return 0;
00082 }
00083 
00084  

Generated on Tue Jun 17 11:29:10 2008 for Pierre Guillot by  doxygen 1.3.9.1