app/solver_bb_floating.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_grevlex   choice

Definition at line 36 of file solver_bb_floating.cpp.

Referenced by choice_mix().

#define COEFF   RR

Definition at line 43 of file solver_bb_floating.cpp.

#define COMPUTE_MAT

Definition at line 41 of file solver_bb_floating.cpp.

#define GOTZMANN

Definition at line 51 of file solver_bb_floating.cpp.

#define NBDIGITS   160

Definition at line 42 of file solver_bb_floating.cpp.

Referenced by printmatfile(), and printmatfile_pequan().

#define NEED_INIT_ELEM

Definition at line 46 of file solver_bb_floating.cpp.

#define nored

Definition at line 29 of file solver_bb_floating.cpp.

#define PETITFERMAT

Definition at line 45 of file solver_bb_floating.cpp.

#define REALSOLVE

Definition at line 30 of file solver_bb_floating.cpp.

#define sparse2

Definition at line 50 of file solver_bb_floating.cpp.

#define unimul

Definition at line 31 of file solver_bb_floating.cpp.

#define uninf

Definition at line 32 of file solver_bb_floating.cpp.

#define WORKSPACE

Definition at line 53 of file solver_bb_floating.cpp.


Typedef Documentation

typedef Mon mon

Definition at line 64 of file solver_bb_floating.cpp.

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

Definition at line 63 of file solver_bb_floating.cpp.

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

Definition at line 66 of file solver_bb_floating.cpp.

typedef Base<predicat<mon> > typB

Definition at line 70 of file solver_bb_floating.cpp.

Definition at line 71 of file solver_bb_floating.cpp.


Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 94 of file solver_bb_floating.cpp.

References countpoint(), Iszero(), printmatfile(), readfile(), sweep(), tempsCDSP, and tempsdssdp.

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   //cout<<"sizeof(long int) "<<sizeof(long int)<<endl;
00114   mpai_set_prec(3);
00115     Precision(90);
00116   printf("%s\n",argv[1]);fflush(stdout);
00117   readfile(toto,argv[1]);
00118   //  perturb(toto);
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   //debut affichage
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   //fin affichage
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   //  affdebug(m);
00154   if(argc>2)
00155     {
00156       char nom[10];
00157       harewell<complex< long double> > tmp;
00158       //harewell<complex< mpf_class> > tmp;
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   //   printdump(stdout,dump);
00223   
00224   //Liberation de la memoire
00225   /*#ifdef unimul 
00226 #ifdef uninf 
00227    sweep(dump,b,multiple,nfmul);
00228 #endif
00229 #else
00230 #ifdef unimul
00231    sweep(dump,b,multiple);
00232 #else
00233 #ifdef uninf
00234    sweep(dump,b,nfmul);
00235 #else
00236   */
00237    sweep(dump,b);
00238    //#endif
00239    //#endif
00240    //#endif
00241 cout<<"temps dans generickernel "<<tempsdssdp<<endl;
00242 cout<<"temps dans CSDP "<<tempsCDSP<<endl;
00243 #endif //DENSE
00244 }


Variable Documentation

double tempsCDSP = 0

Definition at line 7 of file solver_bb_floating.cpp.

Referenced by main().

double tempsdssdp = 0

Definition at line 6 of file solver_bb_floating.cpp.

Referenced by main().

struct timeval initclock tmpclock

Definition at line 5 of file solver_bb_floating.cpp.


Generated on 6 Dec 2012 for borderbasix by  doxygen 1.6.1