00001 #include <fstream>
00002 #include <iostream>
00003 #include "cmdline.H"
00004 #include "my_gmp.H"
00005 #include "algebras.H"
00006 #include "repring.H"
00007 #include "ftwo.H"
00008 #include "exp_classes.H"
00009 #include "sw_maker.H"
00010 #include "chern_maker.H"
00011 using namespace std;
00012
00013
00014 int main(int argc, char** argv){
00015
00016 CommandLine::init(argc, argv);
00017
00018 if(CommandLine::parameters.size() != 1){
00019 cout << "Usage: rep <name> [options]" << endl
00020 << "This will create 'name.W' and "
00021 << "'name.W.res.elemab' based on " << endl
00022 << "information contained in 'name.gaprep', "
00023 << "'name.gaprep.real', " << endl
00024 <<"and 'name.res.elemab'."
00025 << endl
00026 << "Options:" << endl
00027 << " -quiet: displays less messages"
00028 << endl
00029 << " -silent: displays no "
00030 << "messages at all."
00031 << endl;
00032 return 1;
00033 }
00034
00036 RepresentationRing R_CG;
00037 RealRepresentationRing R_RG;
00038
00039
00040 string name= CommandLine::parameters[0];
00041
00042
00043 PowProd::use_order(LEX);
00044
00045
00046 R_CG.verbose= R_RG.verbose= true;
00047 R_CG.very_verbose= R_RG.very_verbose= true;
00048 if(CommandLine::has_tag("-quiet"))
00049 R_CG.very_verbose= R_RG.very_verbose= false;
00050 if(CommandLine::has_tag("-silent")){
00051 R_CG.verbose= R_RG.verbose= false;
00052 R_CG.very_verbose= R_RG.very_verbose= false;
00053 }
00054
00056
00058
00059 if(R_CG.verbose)
00060 cout << "\\bigskip {\\large\\bf Computing a presentation"
00061 << " of the complex representation ring}"
00062 << endl << endl;
00063
00064
00065 R_CG.read_from_GAP_file(name + ".gaprep");
00066
00067
00068
00069 if(R_CG.very_verbose)
00070 cout << endl << "Current presentation:"
00071 << endl << endl
00072 << R_CG << endl;
00073
00074 if(R_CG.verbose)
00075 cout << "\\bigskip {\\large\\bf Computing a presentation"
00076 << " of the real representation ring}"
00077 << endl << endl;
00078
00079
00080 R_RG.read_from_GAP_file(name + ".gaprep.real");
00081
00082
00083
00084 if(R_CG.very_verbose)
00085 cout << endl << "Current presentation:"
00086 << endl << endl
00087 << R_RG << endl;
00088
00089
00090
00092
00094
00095 GradedAlgebra<F_2> H_ch;
00096 UnstableAlgebra H_sw;
00097 Chern_Maker chern;
00098 SW_Maker sw;
00099
00100 H_ch.verbose= H_sw.verbose= R_CG.verbose;
00101 H_ch.very_verbose= H_sw.very_verbose= R_CG.very_verbose;
00102
00103 if(R_CG.verbose)
00104 cout << "\\bigskip {\\large\\bf Computing"
00105 << " Chern classes}"
00106 << endl << endl;
00107
00108
00109 chern.start(&R_CG, &H_ch);
00110
00111 if(R_CG.very_verbose)
00112 cout << H_ch << endl;
00113
00114 if(R_CG.verbose)
00115 cout << "\\bigskip {\\large\\bf Computing"
00116 << " Stiefel-Whitney classes}"
00117 << endl << endl;
00118
00119
00120
00121 sw.start(&R_RG, &H_sw, &H_ch);
00122
00123
00124
00125
00126
00127 AffineHomomorphism<F_2> f( &H_ch, &H_sw );
00128
00129
00130
00131 f.get_data_from(sw.chern_sw);
00132
00133 if(R_CG.very_verbose)
00134 cout << "Correspondence between Chern and "
00135 <<"Stiefel-Whitney classes: "
00136 << endl << f << endl;
00137
00138
00140
00142
00143
00144
00145
00146 UnstableAlgebra H_reduced;
00147 H_reduced= H_sw;
00148 H_reduced.fix_alphabets();
00149
00150 H_sw.relations.generators.clear();
00151
00152
00153 AffineHomomorphism<F_2> g( &H_sw, &H_reduced);
00154 g.get_data_from( H_reduced.saturate_and_reduce() );
00155 f= g * f;
00156
00157 if(R_CG.verbose){
00158 H_reduced.display();
00159 cout << "Reduction homomorphism: " << endl
00160 << g << endl;
00161
00162 cout << "Chern classes in the reduced ring: " << endl
00163 << f << endl;
00164 }
00165
00166
00167 string out_W= name + ".W";
00168 ofstream W_file(out_W.c_str());
00169 W_file << H_reduced;
00170
00171 string out_sw= name + ".sw";
00172 ofstream sw_file(out_sw.c_str());
00173 sw_file << H_sw;
00174 sw_file << g;
00175
00176 string out_chern= name + ".chern";
00177 ofstream chern_file(out_chern.c_str());
00178 chern_file << H_ch;
00179 chern_file << f;
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193 AffineHomomorphism<F_2> s(&H_reduced, &H_sw);
00194 long i, j;
00195 Tuple< Polynomial<F_2> > var= H_sw.get_variables();
00196
00197 for(i=1; i<= H_reduced.variables_in_use(); i++){
00198
00199 for(j=1; j<= H_sw.variables_in_use(); j++)
00200 if( H_sw.nameof(j) == H_reduced.nameof(i) )
00201 break;
00202 s.set_image(i, var[j] );
00203 }
00204
00205
00206
00208
00210
00211 if(R_CG.verbose)
00212 cout << "Computing the restrictions to "
00213 << "elementary abelian subgroups" << endl;
00214
00215
00216
00217
00218 string res_name= name + ".res.elemab";
00219 string save_name=name + ".W.res.elemab";
00220 ifstream res_file(res_name.c_str());
00221 ofstream save_res(save_name.c_str());
00222 long nb_elemab;
00223 string rank, prev_rank;;
00224 RealRepresentationRing R_elemab, empty_ring;
00225 UnstableAlgebra H_elemab, H_elemab_red, empty_unstable;
00226 AffineHomomorphism<QQ> res_hom(&R_RG, &R_elemab);
00227 AffineHomomorphism<F_2> restriction( &H_sw, &H_elemab);
00228 AffineHomomorphism<F_2> reduc( &H_elemab, &H_elemab_red);
00229
00230 AffineHomomorphism<F_2> save_hom(&H_reduced, &H_elemab_red);
00231 SW_Maker sw_elemab, sw_empty;;
00232
00233 res_file >> nb_elemab;
00234 save_res << nb_elemab << " ";
00235
00236 prev_rank="";
00237
00238 for(i=0; i< nb_elemab; i++){
00239 res_file >> rank;
00240 save_res << rank << " ";
00241
00242 if( rank != prev_rank ){
00243 res_name= "elemab-rank" + rank + ".gaprep.real";
00244 R_elemab= empty_ring;
00245 R_elemab.read_from_GAP_file(res_name);
00246 sw_elemab= sw_empty;
00247 H_elemab= empty_unstable;
00248 sw_elemab.start(&R_elemab, &H_elemab);
00249 H_elemab_red= H_elemab;
00250 H_elemab_red.fix_alphabets();
00251 reduc.get_data_from( H_elemab_red.find_redundancies() );
00252 }
00253 prev_rank= rank;
00254 res_hom.read_from_GAP_file(res_file);
00255
00256
00257
00258
00259 restriction= sw.translate_homomorphism(res_hom, sw_elemab);
00260
00261
00262 save_hom= reduc * restriction * s;
00263
00264 if(R_CG.very_verbose){
00265 cout << "restriction to elementary abelian subgroup "
00266 << i << endl;
00267 cout << save_hom << endl;
00268 }
00269 save_res << save_hom;
00270 }
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281 return 0;
00282 }