00001
00002
00003 using namespace std;
00004 #include<sys/time.h>
00005 struct timeval initclock,tmpclock;
00006 double tempsdssdp=0;
00007 double tempsCDSP=0;
00008
00009 #include<gmpxx.h>
00010 #include"borderbasix/arithm/bignum.H"
00011 #include"borderbasix/arithm/Zp.H"
00012 #include <iostream>
00013 #include<stdio.h>
00014 #include<list>
00015 #include<vector>
00016 #include<map>
00017 #include "borderbasix/mpoly.H"
00018 #include <time.h>
00019
00020 #ifdef mymod
00021 #include"Phtmod.cc"
00022 #endif
00023
00024
00025
00026
00027
00028
00029 #define nored
00030 #define REALSOLVE
00031 #define unimul
00032 #define uninf
00033
00034
00035 #ifndef NO_CHOICE
00036 #define choice_grevlex choice
00037 #endif
00038
00039
00040
00041 #define COMPUTE_MAT
00042 #define NBDIGITS 160
00043 #define COEFF RR
00044
00045 #define PETITFERMAT
00046 #define NEED_INIT_ELEM
00047
00048
00049
00050 #define sparse2
00051 #define GOTZMANN
00052
00053 #define WORKSPACE
00054
00055
00056
00057
00058 #ifdef RS_OUT
00059 #include "rs2.cc"
00060 #endif
00061
00062 typedef Monom<COEFF ,
00063 numexp<'x',7, long long > > Mon;
00064 typedef Mon mon;
00065 #include "borderbasix/dlexorder.cc"
00066 typedef MPoly<vector<Mon>, my_Dlex<Mon> > Poly;
00067
00068 #include"borderbasix/general.h"
00069 #include"borderbasix/arithm/zpspecial.cc"
00070 typedef Base<predicat<mon> > typB;
00071 typedef predicat<mon> typpredicat;
00072
00073
00074 #ifdef mymod
00075 #include"borderbasix/dpivmacrev_z.cc"
00076 #endif
00077
00078 #ifdef REALSOLVE
00079
00080
00081 #include"borderbasix/post_treatment/resolve2.cc"
00082
00083
00084 #endif
00085
00086 #ifdef dimpos
00087 #include "dimpos.cc"
00088 #endif
00089
00090 #ifdef SYMBO
00091 #include"post_treatment/symbo2.cc"
00092 #endif
00093
00094 int main(int argc,char** argv)
00095 {
00096 #ifdef tableop
00097 inittableop();
00098 #endif
00099 #ifdef mymod
00100 macrev_Z dummy;
00101 dummy.init_Z("32051");
00102 #endif
00103 list<harewell<COEFF> > lmat;
00104 list<mon> stockmon;
00105 #ifndef DENSE
00106 monomial_server<mon,pol<mon,COEFF> > serv;
00107 #endif
00108 FILE *fic;
00109 list<Poly> toto;
00110 list<dumpstruct<pol<mon,COEFF> > > dump;
00111 harewell<COEFF> m;
00112 Base<predicat<mon> > b;
00113
00114 mpai_set_prec(3);
00115 Precision(90);
00116 printf("%s\n",argv[1]);fflush(stdout);
00117 readfile(toto,argv[1]);
00118
00119 #ifndef DENSE
00120 algo<list<Poly>,list<pol<mon,COEFF> >,
00121 list<dumpstruct<pol<mon,COEFF> > >
00122 ,Base<predicat<mon> >, harewell >(toto,dump,b,serv);
00123 #else
00124 algo<list<Poly>,list<pol<mon,COEFF> >,
00125 list<dumpstruct<pol<mon,COEFF> > >
00126 ,Base<predicat<mon> >, harewell >(toto,dump,b);
00127 #endif
00128 #ifdef AFFICHE
00129
00130 int total=0;
00131 for(list<dumpstruct<pol<mon,COEFF> > >::iterator iter=dump.begin();
00132 iter!=dump.end();iter++)
00133 for(int i=0;i<iter->size;i++)
00134 {
00135
00136 int nbzero=0;
00137 for(int j=0;j<iter->nf[i].size;j++)
00138 if(Iszero(iter->nf[i].nf[j])) nbzero++;
00139 cout<<invconv<Poly>(iter->nf[i])<<","<<endl;
00140 total+=iter->nf[i].size;
00141 cout<<"taille "<<iter->nf[i].size<<"nbzero "<<nbzero<<endl;
00142 }
00143 cout<<"total place memoire "<<total<<endl;
00144
00145 #endif
00146 #ifndef DENSE
00147 cout<<"nb point dans quotient "<<countpoint(b,dump,serv)<<endl;
00148 #else
00149 cout<<"nb point dans quotient "<<countpoint(b,dump)<<endl;
00150 #endif
00151
00152 #ifndef DENSE
00153
00154 if(argc>2)
00155 {
00156 char nom[10];
00157 harewell<complex< long double> > tmp;
00158
00159 int i,j;
00160 list<mon>::iterator iterstock;
00161 computestockmon(stockmon,b,dump);
00162 cout<<"coputestockmon "<<stockmon.size()<<endl;
00163 list<harewell<mpq_t> > loclmat;
00164 harewell<mpq_t > tmploc;
00165 fic=fopen(argv[2],"w");
00166 for(int i=0;i<b.nbvar();i++)
00167 {
00168 #ifdef SYMBO
00169 tmploc= harewell<mpq_t >(stockmon.size(),stockmon.size());
00170 #endif
00171 matmul(m,i,dump,b,stockmon,serv);
00172 sprintf(nom,"m%d",i);
00173 printmatfile(m,nom,fic);
00174 #ifdef SYMBO
00175 for(int k=0;k<stockmon.size();k++)
00176 for(int l=0;l<stockmon.size();l++)
00177 harewell_set_coeff(tmploc,l,k,&m(k,l).rep());
00178 #endif
00179 lmat.push_back(m);
00180 loclmat.push_back(tmploc);
00181 }
00182 #ifdef SYMBO
00183 ptpol_t *res;
00184 res=(ptpol_t*)malloc((b.nbvar()+1)*sizeof(ptpol_t));
00185 for(int i=0;i<b.nbvar()+1;i++)
00186 ptpol_init(res[i]);
00187 symbo(res,loclmat, stockmon,dump,b);
00188 for(int i=0;i<b.nbvar()+1;i++)
00189 {
00190 ptpol_out_str(fic,res[i]);
00191 fprintf(fic,";\n");
00192 }
00193 #endif
00194 #ifdef REALSOLVE
00195
00196 if(argc>3)
00197 {
00198 realsolve2(lmat,b,tmp);
00199 printmatfile(tmp,"sol",fic);
00200 }
00201 #endif
00202 tmp.destroystore();m.destroystore();
00203 fprintf(fic,"mon:=[");
00204 iterstock=stockmon.begin();
00205 for(i=0;i<(int)(stockmon.size()-1);i++,iterstock++)
00206 {
00207 for( j=0;j<b.nbvar()-1;j++)
00208 fprintf(fic,"x%d^%d*",j,(int)iterstock->GetDegree(j));
00209 fprintf(fic,"x%d^%d,",j,(int)iterstock->GetDegree(j));
00210 }
00211 for(j=0;j<b.nbvar()-1;j++)
00212 fprintf(fic,"x%d^%d*",j,(int)iterstock->GetDegree(j));
00213 fprintf(fic,"x%d^%d];\n",j,(int)iterstock->GetDegree(j));
00214
00215 fclose(fic);
00216 }
00217
00218 #ifdef RS_OUT
00219 fic=fopen(argv[2],"w");
00220 rs_out(dump,b,fic);
00221 #endif
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237 sweep(dump,b);
00238
00239
00240
00241 cout<<"temps dans generickernel "<<tempsdssdp<<endl;
00242 cout<<"temps dans CSDP "<<tempsCDSP<<endl;
00243 #endif //DENSE
00244 }