#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 43 of file solver_rr_opt.cpp.
#define COEFF RR |
Definition at line 59 of file solver_rr_opt.cpp.
#define COMPUTE_MAT |
Definition at line 49 of file solver_rr_opt.cpp.
#define DEBUGSDP |
Definition at line 76 of file solver_rr_opt.cpp.
#define MINMarta |
Definition at line 115 of file solver_rr_opt.cpp.
#define MON_PREMIER 32051 |
Definition at line 51 of file solver_rr_opt.cpp.
#define NBDIGITS 160 |
Definition at line 50 of file solver_rr_opt.cpp.
#define NEED_INIT_ELEM |
Definition at line 63 of file solver_rr_opt.cpp.
#define nored |
Definition at line 34 of file solver_rr_opt.cpp.
#define PETITFERMAT |
Definition at line 62 of file solver_rr_opt.cpp.
#define RATIONAL |
Definition at line 35 of file solver_rr_opt.cpp.
#define REALSOLVE |
Definition at line 36 of file solver_rr_opt.cpp.
#define sdp sdp |
Definition at line 69 of file solver_rr_opt.cpp.
#define unimul |
Definition at line 37 of file solver_rr_opt.cpp.
#define uninf |
Definition at line 38 of file solver_rr_opt.cpp.
#define WORKSPACE |
Definition at line 70 of file solver_rr_opt.cpp.
Definition at line 85 of file solver_rr_opt.cpp.
typedef Monom< RR , numexp<'x',7, long long > > Mon |
Definition at line 84 of file solver_rr_opt.cpp.
typedef predicat<mon> typpredicat |
Definition at line 92 of file solver_rr_opt.cpp.
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 118 of file solver_rr_opt.cpp.
References countpoint(), Iszero(), mult(), printmatfile(), readfile(), sweep(), tempsCDSP, and tempsdssdp.
00119 { 00120 #ifdef tableop 00121 inittableop(); 00122 #endif 00123 #ifdef mymod 00124 macrev_Z dummy; 00125 dummy.init_Z("32051"); 00126 #endif 00127 list<harewell<COEFF> > lmat; 00128 list<mon> stockmon; 00129 #ifndef DENSE 00130 monomial_server<mon,pol<mon,COEFF> > serv; 00131 #endif 00132 FILE *fic; 00133 list<Poly> toto; 00134 list<dumpstruct<pol<mon,COEFF> > > dump; 00135 harewell<COEFF> m; 00136 Base<predicat<mon> > b; 00137 cout<<"argc"<<argc<<endl; 00138 //cout<<"sizeof(long int) "<<sizeof(long int)<<endl; 00139 mpai_set_prec(3); 00140 Precision(90); 00141 printf("%s\n",argv[1]);fflush(stdout); 00142 cout<<"que pasa"<<endl; 00143 readfile(toto,argv[1]); 00144 #ifdef MINMarta 00145 cout<<"entra a leer funcion"<<endl; 00146 list<Poly> fun; 00147 printf("%s\n",argv[4]);fflush(stdout); 00148 cout<<"error antes de leer"<<endl; 00149 readfile(fun,argv[4]); 00150 cout<<"sale de leer funcion"<<endl; 00151 #endif 00152 // perturb(toto); 00153 #ifndef DENSE 00154 #ifndef MINMarta 00155 algo<list<Poly>,list<pol<mon,COEFF> >, 00156 list<dumpstruct<pol<mon,COEFF> > > 00157 ,Base<predicat<mon> >, harewell >(toto,dump,b,serv); 00158 #else 00159 cout<<"entra en MinMarta "<<endl; 00160 algo<list<Poly>,list<pol<mon,COEFF> >, 00161 list<dumpstruct<pol<mon,COEFF> > > 00162 ,Base<predicat<mon> >, harewell>(toto,dump,b,serv,fun); 00163 #endif 00164 #else 00165 algo<list<Poly>,list<pol<mon,COEFF> >, 00166 list<dumpstruct<pol<mon,COEFF> > > 00167 ,Base<predicat<mon> >, harewell >(toto,dump,b); 00168 #endif 00169 cout<<"coucou"<<endl; 00170 00171 #ifdef AFFICHE 00172 //debut affichage 00173 int total=0; 00174 for(list<dumpstruct<pol<mon,COEFF> > >::iterator iter=dump.begin(); 00175 iter!=dump.end();iter++) 00176 for(int i=0;i<iter->size;i++) 00177 { 00178 00179 int nbzero=0; 00180 for(int j=0;j<iter->nf[i].size;j++) 00181 if(Iszero(iter->nf[i].nf[j])) nbzero++; 00182 cout<<invconv<Poly>(iter->nf[i])<<","<<endl; 00183 total+=iter->nf[i].size; 00184 cout<<" Size "<<iter->nf[i].size<<"nbzero "<<nbzero<<endl; 00185 } 00186 cout<<" Total memory size"<<total<<endl; 00187 //fin affichage 00188 #endif 00189 00190 #ifndef DENSE 00191 cout<<"Number of solutions (with multiplicity): "<<countpoint(b,dump,serv)<<endl; 00192 #else 00193 cout<<"Number of solutions (with multiplicity): "<<countpoint(b,dump)<<endl; 00194 #endif 00195 cout <<"multi"<<endl; 00196 #ifndef DENSE 00197 // affdebug(m); 00198 if(argc>2) 00199 { 00200 char nom[10]; 00201 harewell<complex< long double> > tmp; 00202 //harewell<complex< mpf_class> > tmp; 00203 int i,j; 00204 list<mon>::iterator iterstock; 00205 computestockmon(stockmon,b,dump); 00206 cout<<"coputestockmon "<<stockmon.size()<<endl; 00207 list<harewell<mpq_t> > loclmat; 00208 harewell<mpq_t > tmploc; 00209 fic=fopen(argv[2],"w"); 00210 fprintf(fic,"basis:=["); 00211 00212 iterstock=stockmon.begin(); 00213 for(i=0;i<stockmon.size();i++,iterstock++) 00214 { 00215 bool mult=false; 00216 for( j=0;j<b.nbvar();j++) { 00217 if (iterstock->GetDegree(j)>1) { 00218 if (mult) fprintf(fic,"*"); 00219 fprintf(fic,"x%d^%d",j,iterstock->GetDegree(j)); 00220 mult=true; 00221 } 00222 else if (iterstock->GetDegree(j)>0) { 00223 if (mult) fprintf(fic,"*"); 00224 fprintf(fic,"x%d",j); 00225 mult=true; 00226 } else if (!mult && j == b.nbvar()-1) 00227 fprintf(fic,"1"); 00228 } 00229 if (i < stockmon.size()-1) 00230 fprintf(fic,","); 00231 else 00232 fprintf(fic,"];\n"); 00233 } 00234 00235 for(int i=0;i<b.nbvar();i++) 00236 { 00237 #ifdef SYMBO 00238 tmploc= harewell<mpq_t >(stockmon.size(),stockmon.size()); 00239 #endif 00240 matmul(m,i,dump,b,stockmon,serv); 00241 sprintf(nom,"m%d",i); 00242 printmatfile(m,nom,fic); 00243 #ifdef SYMBO 00244 for(int k=0;k<stockmon.size();k++) 00245 for(int l=0;l<stockmon.size();l++) 00246 harewell_set_coeff(tmploc,l,k,&m(k,l).rep()); 00247 #endif 00248 lmat.push_back(m); 00249 loclmat.push_back(tmploc); 00250 } 00251 #ifdef SYMBO 00252 ptpol_t *res; 00253 res=(ptpol_t*)malloc((b.nbvar()+1)*sizeof(ptpol_t)); 00254 for(int i=0;i<b.nbvar()+1;i++) 00255 ptpol_init(res[i]); 00256 symbo(res,loclmat, stockmon,dump,b); 00257 for(int i=0;i<b.nbvar()+1;i++) 00258 { 00259 ptpol_out_str(fic,res[i]); 00260 fprintf(fic,";\n"); 00261 } 00262 #endif 00263 00264 #ifdef REALSOLVE 00265 if(argc>3) 00266 { 00267 cout<<"argv[3]"<<argv[3]<<endl; 00268 FILE *fic2; 00269 fic2=fopen(argv[3],"w"); 00270 realsolve2(lmat,b,tmp); 00271 printmatfile(tmp,"sol",fic2); 00272 fclose(fic2); 00273 } 00274 #endif 00275 tmp.destroystore();m.destroystore(); 00276 00277 } 00278 00279 #ifdef RS_OUT 00280 fic=fopen(argv[2],"w"); 00281 rs_out(dump,b,fic); 00282 #endif 00283 // printdump(stdout,dump); 00284 00285 //Liberation de la memoire 00286 /*#ifdef unimul 00287 #ifdef uninf 00288 sweep(dump,b,multiple,nfmul); 00289 #endif 00290 #else 00291 #ifdef unimul 00292 sweep(dump,b,multiple); 00293 #else 00294 #ifdef uninf 00295 sweep(dump,b,nfmul); 00296 #else 00297 */ 00298 sweep(dump,b); 00299 //#endif 00300 //#endif 00301 //#endif 00302 00303 #ifdef WITH_TIMING 00304 cout<<"time in generickernel "<<tempsdssdp<<endl; 00305 cout<<"time in CSDP "<<tempsCDSP<<endl; 00306 #endif //WITH_TIMING 00307 00308 #endif //DENSE 00309 cout<<"argc"<<argc<<endl; 00310 }
double tempsCDSP = 0 |
Definition at line 7 of file solver_rr_opt.cpp.
double tempsdssdp = 0 |
Definition at line 6 of file solver_rr_opt.cpp.
struct timeval initclock tmpclock |
Definition at line 5 of file solver_rr_opt.cpp.