app/solver_bb_rr.cpp File Reference

#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.

Defines

Typedefs

Functions

Variables


Define Documentation

#define choice_fall   choice

Definition at line 43 of file solver_bb_rr.cpp.

#define COEFF   RR

Definition at line 59 of file solver_bb_rr.cpp.

#define COMPUTE_MAT

Definition at line 49 of file solver_bb_rr.cpp.

#define DEBUGSDP

Definition at line 76 of file solver_bb_rr.cpp.

#define MON_PREMIER   32051

Definition at line 51 of file solver_bb_rr.cpp.

#define NBDIGITS   160

Definition at line 50 of file solver_bb_rr.cpp.

#define NEED_INIT_ELEM

Definition at line 63 of file solver_bb_rr.cpp.

#define nored

Definition at line 34 of file solver_bb_rr.cpp.

#define PETITFERMAT

Definition at line 62 of file solver_bb_rr.cpp.

#define RATIONAL

Definition at line 35 of file solver_bb_rr.cpp.

#define REALSOLVE

Definition at line 36 of file solver_bb_rr.cpp.

#define sdp   sdp

Definition at line 69 of file solver_bb_rr.cpp.

#define unimul

Definition at line 37 of file solver_bb_rr.cpp.

#define uninf

Definition at line 38 of file solver_bb_rr.cpp.

#define WORKSPACE

Definition at line 70 of file solver_bb_rr.cpp.


Typedef Documentation

typedef Mon mon

Definition at line 85 of file solver_bb_rr.cpp.

typedef Monom< RR , numexp<'x',7, long long > > Mon

Definition at line 84 of file solver_bb_rr.cpp.

typedef MPoly<vector<Mon>, my_Dlex<Mon> > Poly

Definition at line 87 of file solver_bb_rr.cpp.

typedef Base<predicat<mon> > typB

Definition at line 91 of file solver_bb_rr.cpp.

Definition at line 92 of file solver_bb_rr.cpp.


Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 118 of file solver_bb_rr.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   readfile(toto,argv[1]);
00143 #ifdef MINMarta
00144   cout<<"entra a leer funcion"<<endl;
00145   list<Poly> fun;
00146   printf("%s\n",argv[4]);fflush(stdout);
00147   cout<<"error antes de leer"<<endl;
00148   readfile(fun,argv[4]);
00149   cout<<"sale de leer funcion"<<endl;
00150 #endif
00151   //  perturb(toto);
00152 #ifndef DENSE
00153  #ifndef MINMarta
00154   algo<list<Poly>,list<pol<mon,COEFF> >,
00155     list<dumpstruct<pol<mon,COEFF> > >
00156     ,Base<predicat<mon> >, harewell >(toto,dump,b,serv);
00157  #else
00158   cout<<"entra en MinMarta "<<endl;
00159   algo<list<Poly>,list<pol<mon,COEFF> >,
00160    list<dumpstruct<pol<mon,COEFF> > >
00161    ,Base<predicat<mon> >, harewell>(toto,dump,b,serv,fun);
00162  #endif
00163 #else 
00164   algo<list<Poly>,list<pol<mon,COEFF> >,
00165     list<dumpstruct<pol<mon,COEFF> > >
00166     ,Base<predicat<mon> >, harewell >(toto,dump,b);
00167 #endif
00168   cout<<"coucou"<<endl;
00169 
00170 #ifdef AFFICHE
00171   //debut affichage
00172   int total=0;
00173   for(list<dumpstruct<pol<mon,COEFF> > >::iterator iter=dump.begin();
00174       iter!=dump.end();iter++)
00175     for(int i=0;i<iter->size;i++)
00176       {
00177         
00178         int nbzero=0;
00179         for(int j=0;j<iter->nf[i].size;j++)
00180           if(Iszero(iter->nf[i].nf[j])) nbzero++;
00181         cout<<invconv<Poly>(iter->nf[i])<<","<<endl;
00182         total+=iter->nf[i].size;
00183         cout<<"   Size "<<iter->nf[i].size<<"nbzero "<<nbzero<<endl;     
00184       }
00185   cout<<"   Total memory size"<<total<<endl; 
00186   //fin affichage
00187 #endif
00188 
00189 #ifndef DENSE
00190   cout<<"Number of solutions (with multiplicity): "<<countpoint(b,dump,serv)<<endl;
00191 #else
00192   cout<<"Number of solutions (with multiplicity): "<<countpoint(b,dump)<<endl;
00193 #endif
00194   cout <<"multi"<<endl;
00195 #ifndef DENSE
00196   //  affdebug(m);
00197   if(argc>2)
00198     {
00199       char nom[10];
00200       harewell<complex< long double> > tmp;
00201       //harewell<complex< mpf_class> > tmp;
00202       int i,j;
00203       list<mon>::iterator iterstock;
00204       computestockmon(stockmon,b,dump);
00205       cout<<"coputestockmon "<<stockmon.size()<<endl;
00206       list<harewell<mpq_t> > loclmat;
00207       harewell<mpq_t > tmploc;
00208       fic=fopen(argv[2],"w");
00209       fprintf(fic,"basis:=[");    
00210 
00211       iterstock=stockmon.begin();
00212       for(i=0;i<stockmon.size();i++,iterstock++)
00213         {
00214           bool mult=false;
00215           for( j=0;j<b.nbvar();j++) {
00216             if (iterstock->GetDegree(j)>1) {
00217               if (mult) fprintf(fic,"*");
00218               fprintf(fic,"x%d^%d",j,iterstock->GetDegree(j));
00219               mult=true;
00220             }
00221             else if (iterstock->GetDegree(j)>0) {
00222               if (mult) fprintf(fic,"*");
00223               fprintf(fic,"x%d",j);
00224               mult=true;
00225             } else if (!mult && j == b.nbvar()-1)
00226               fprintf(fic,"1"); 
00227           }
00228           if (i < stockmon.size()-1)
00229             fprintf(fic,","); 
00230           else
00231             fprintf(fic,"];\n");
00232         }
00233 
00234       for(int i=0;i<b.nbvar();i++)
00235         {
00236 #ifdef SYMBO      
00237           tmploc= harewell<mpq_t >(stockmon.size(),stockmon.size());
00238 #endif    
00239           matmul(m,i,dump,b,stockmon,serv);
00240           sprintf(nom,"m%d",i);
00241           printmatfile(m,nom,fic);
00242 #ifdef SYMBO     
00243           for(int k=0;k<stockmon.size();k++)
00244             for(int l=0;l<stockmon.size();l++)
00245               harewell_set_coeff(tmploc,l,k,&m(k,l).rep());
00246 #endif
00247           lmat.push_back(m);
00248           loclmat.push_back(tmploc);
00249         }
00250 #ifdef SYMBO      
00251       ptpol_t *res;
00252       res=(ptpol_t*)malloc((b.nbvar()+1)*sizeof(ptpol_t));
00253       for(int i=0;i<b.nbvar()+1;i++)
00254         ptpol_init(res[i]);
00255       symbo(res,loclmat, stockmon,dump,b);
00256       for(int i=0;i<b.nbvar()+1;i++)
00257         {
00258           ptpol_out_str(fic,res[i]);
00259           fprintf(fic,";\n");
00260         }
00261 #endif
00262 
00263 #ifdef REALSOLVE
00264       if(argc>3)
00265         {
00266           cout<<"argv[3]"<<argv[3]<<endl;
00267           FILE *fic2;
00268           fic2=fopen(argv[3],"w");
00269           realsolve2(lmat,b,tmp);
00270           printmatfile(tmp,"sol",fic2);
00271           fclose(fic2);
00272         }
00273 #endif
00274       tmp.destroystore();m.destroystore();
00275       
00276     }
00277 
00278 #ifdef RS_OUT
00279   fic=fopen(argv[2],"w");
00280   rs_out(dump,b,fic);
00281 #endif
00282   //   printdump(stdout,dump);
00283   
00284   //Liberation de la memoire
00285   /*#ifdef unimul 
00286 #ifdef uninf 
00287    sweep(dump,b,multiple,nfmul);
00288 #endif
00289 #else
00290 #ifdef unimul
00291    sweep(dump,b,multiple);
00292 #else
00293 #ifdef uninf
00294    sweep(dump,b,nfmul);
00295 #else
00296   */
00297    sweep(dump,b);
00298    //#endif
00299    //#endif
00300    //#endif
00301 
00302 #ifdef WITH_TIMING
00303 cout<<"time in generickernel "<<tempsdssdp<<endl;
00304 cout<<"time in CSDP "<<tempsCDSP<<endl;
00305 #endif //WITH_TIMING
00306 
00307 #endif //DENSE
00308 cout<<"argc"<<argc<<endl;
00309 }


Variable Documentation

double tempsCDSP = 0

Definition at line 7 of file solver_bb_rr.cpp.

double tempsdssdp = 0

Definition at line 6 of file solver_bb_rr.cpp.

struct timeval initclock tmpclock

Definition at line 5 of file solver_bb_rr.cpp.


Generated on 6 Dec 2012 for borderbasix by  doxygen 1.6.1