#include <sys/time.h>
#include <gmpxx.h>
#include "borderbasix/arithm/bignum.H"
#include "borderbasix/arithm/Zp.H"
#include <iostream>
#include <stdio.h>
#include <list>
#include <vector>
#include <map>
#include "borderbasix/mpoly.H"
#include <time.h>
#include "borderbasix/dlexorder.cc"
#include "borderbasix/general.h"
#include "borderbasix/arithm/zpspecial.cc"
#include "borderbasix/post_treatment/resolve2.cc"
Go to the source code of this file.
#define choice_fall choice |
Definition at line 39 of file solver_bb_rational.cpp.
#define COEFF QQ |
Definition at line 55 of file solver_bb_rational.cpp.
#define COMPUTE_MAT |
Definition at line 45 of file solver_bb_rational.cpp.
#define GOTZMANN |
Definition at line 64 of file solver_bb_rational.cpp.
#define MON_PREMIER 32051 |
Definition at line 47 of file solver_bb_rational.cpp.
#define NBDIGITS 160 |
Definition at line 46 of file solver_bb_rational.cpp.
#define NEED_INIT_ELEM |
Definition at line 59 of file solver_bb_rational.cpp.
#define nored |
Definition at line 30 of file solver_bb_rational.cpp.
#define PETITFERMAT |
Definition at line 58 of file solver_bb_rational.cpp.
#define RATIONAL |
Definition at line 31 of file solver_bb_rational.cpp.
#define REALSOLVE |
Definition at line 32 of file solver_bb_rational.cpp.
#define sparse2 |
Definition at line 63 of file solver_bb_rational.cpp.
#define unimul |
Definition at line 33 of file solver_bb_rational.cpp.
#define uninf |
Definition at line 34 of file solver_bb_rational.cpp.
#define WORKSPACE |
Definition at line 66 of file solver_bb_rational.cpp.
Definition at line 78 of file solver_bb_rational.cpp.
typedef Monom< RR , numexp<'x',7, long long > > Mon |
Definition at line 77 of file solver_bb_rational.cpp.
Definition at line 80 of file solver_bb_rational.cpp.
typedef predicat<mon> typpredicat |
Definition at line 85 of file solver_bb_rational.cpp.
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 108 of file solver_bb_rational.cpp.
References countpoint(), Iszero(), mult(), printmatfile(), readfile(), sweep(), tempsCDSP, and tempsdssdp.
00109 { 00110 #ifdef tableop 00111 inittableop(); 00112 #endif 00113 #ifdef mymod 00114 macrev_Z dummy; 00115 dummy.init_Z("32051"); 00116 #endif 00117 list<harewell<COEFF> > lmat; 00118 list<mon> stockmon; 00119 #ifndef DENSE 00120 monomial_server<mon,pol<mon,COEFF> > serv; 00121 #endif 00122 FILE *fic; 00123 list<Poly> toto; 00124 list<dumpstruct<pol<mon,COEFF> > > dump; 00125 harewell<COEFF> m; 00126 Base<predicat<mon> > b; 00127 //cout<<"sizeof(long int) "<<sizeof(long int)<<endl; 00128 mpai_set_prec(3); 00129 Precision(90); 00130 printf("%s\n",argv[1]);fflush(stdout); 00131 readfile(toto,argv[1]); 00132 // perturb(toto); 00133 #ifndef DENSE 00134 algo<list<Poly>,list<pol<mon,COEFF> >, 00135 list<dumpstruct<pol<mon,COEFF> > > 00136 ,Base<predicat<mon> >, harewell >(toto,dump,b,serv); 00137 #else 00138 algo<list<Poly>,list<pol<mon,COEFF> >, 00139 list<dumpstruct<pol<mon,COEFF> > > 00140 ,Base<predicat<mon> >, harewell >(toto,dump,b); 00141 #endif 00142 00143 #ifdef AFFICHE 00144 //debut affichage 00145 int total=0; 00146 for(list<dumpstruct<pol<mon,COEFF> > >::iterator iter=dump.begin(); 00147 iter!=dump.end();iter++) 00148 for(int i=0;i<iter->size;i++) 00149 { 00150 00151 int nbzero=0; 00152 for(int j=0;j<iter->nf[i].size;j++) 00153 if(Iszero(iter->nf[i].nf[j])) nbzero++; 00154 cout<<invconv<Poly>(iter->nf[i])<<","<<endl; 00155 total+=iter->nf[i].size; 00156 cout<<" Size "<<iter->nf[i].size<<"nbzero "<<nbzero<<endl; 00157 } 00158 cout<<" Total memory size"<<total<<endl; 00159 //fin affichage 00160 #endif 00161 00162 #ifndef DENSE 00163 cout<<"Number of solutions (with multiplicity): "<<countpoint(b,dump,serv)<<endl; 00164 #else 00165 cout<<"Number of solutions (with multiplicity): "<<countpoint(b,dump)<<endl; 00166 #endif 00167 00168 #ifndef DENSE 00169 // affdebug(m); 00170 if(argc>2) 00171 { 00172 char nom[10]; 00173 harewell<complex< long double> > tmp; 00174 //harewell<complex< mpf_class> > tmp; 00175 int i,j; 00176 list<mon>::iterator iterstock; 00177 computestockmon(stockmon,b,dump); 00178 cout<<"coputestockmon "<<stockmon.size()<<endl; 00179 list<harewell<mpq_t> > loclmat; 00180 harewell<mpq_t > tmploc; 00181 fic=fopen(argv[2],"w"); 00182 fprintf(fic,"basis:=["); 00183 cout<<"prueba1 "<<endl; 00184 iterstock=stockmon.begin(); 00185 for(i=0;i<stockmon.size();i++,iterstock++) 00186 { 00187 bool mult=false; 00188 for( j=0;j<b.nbvar();j++) { 00189 if (iterstock->GetDegree(j)>1) { 00190 if (mult) fprintf(fic,"*"); 00191 fprintf(fic,"x%d^%d",j,iterstock->GetDegree(j)); 00192 mult=true; 00193 } 00194 else if (iterstock->GetDegree(j)>0) { 00195 if (mult) fprintf(fic,"*"); 00196 fprintf(fic,"x%d",j); 00197 mult=true; 00198 } else if (!mult && j == b.nbvar()-1) 00199 fprintf(fic,"1"); 00200 } 00201 if (i < stockmon.size()-1) 00202 fprintf(fic,","); 00203 else 00204 fprintf(fic,"];\n"); 00205 } 00206 cout<<"prueba2 "<<endl; 00207 for(int i=0;i<b.nbvar();i++) 00208 { 00209 #ifdef SYMBO 00210 tmploc= harewell<mpq_t >(stockmon.size(),stockmon.size()); 00211 #endif 00212 matmul(m,i,dump,b,stockmon,serv); 00213 sprintf(nom,"m%d",i); 00214 printmatfile(m,nom,fic); 00215 #ifdef SYMBO 00216 for(int k=0;k<stockmon.size();k++) 00217 for(int l=0;l<stockmon.size();l++) 00218 harewell_set_coeff(tmploc,l,k,&m(k,l).rep()); 00219 #endif 00220 cout<<"prueba3 "<<endl; 00221 lmat.push_back(m); 00222 loclmat.push_back(tmploc); 00223 } 00224 #ifdef SYMBO 00225 ptpol_t *res; 00226 res=(ptpol_t*)malloc((b.nbvar()+1)*sizeof(ptpol_t)); 00227 for(int i=0;i<b.nbvar()+1;i++) 00228 ptpol_init(res[i]); 00229 symbo(res,loclmat, stockmon,dump,b); 00230 for(int i=0;i<b.nbvar()+1;i++) 00231 { 00232 ptpol_out_str(fic,res[i]); 00233 fprintf(fic,";\n"); 00234 } 00235 #endif 00236 cout<<"prueba4 "<<endl; 00237 cout<<"argc "<<argc<<endl; 00238 #ifdef REALSOLVE 00239 if(argc>3) 00240 { 00241 cout<<"prueba5 "<<endl; 00242 FILE *fic2; 00243 fic2=fopen(argv[3],"w"); 00244 cout<<"prueba5/1 "<<endl; 00245 realsolve2(lmat,b,tmp); 00246 cout<<"prueba5/1/1 "<<endl; 00247 printmatfile(tmp,"sol",fic2); 00248 cout<<"prueba5/2 "<<endl; 00249 fclose(fic2); 00250 } 00251 #endif 00252 cout<<"prueba6 "<<endl; 00253 00254 tmp.destroystore();m.destroystore(); 00255 00256 } 00257 00258 00259 #ifdef RS_OUT 00260 fic=fopen(argv[2],"w"); 00261 rs_out(dump,b,fic); 00262 #endif 00263 // printdump(stdout,dump); 00264 00265 //Liberation de la memoire 00266 /*#ifdef unimul 00267 #ifdef uninf 00268 sweep(dump,b,multiple,nfmul); 00269 #endif 00270 #else 00271 #ifdef unimul 00272 sweep(dump,b,multiple); 00273 #else 00274 #ifdef uninf 00275 sweep(dump,b,nfmul); 00276 #else 00277 */ 00278 sweep(dump,b); 00279 //#endif 00280 //#endif 00281 //#endif 00282 00283 #ifdef WITH_TIMING 00284 cout<<"time in generickernel "<<tempsdssdp<<endl; 00285 cout<<"time in CSDP "<<tempsCDSP<<endl; 00286 #endif //WITH_TIMING 00287 00288 #endif //DENSE 00289 }
double tempsCDSP = 0 |
Definition at line 6 of file solver_bb_rational.cpp.
double tempsdssdp = 0 |
Definition at line 5 of file solver_bb_rational.cpp.
struct timeval initclock tmpclock |
Definition at line 4 of file solver_bb_rational.cpp.