include/borderbasix/basisutil.cc File Reference

Go to the source code of this file.

Functions


Function Documentation

int countpoint ( const Base b,
const typdump &  dump,
monomial_server &  serv 
) [inline]

Definition at line 5 of file basisutil.cc.

References member(), and Base< predicat >::nbvar().

Referenced by main().

00006 {
00007   typedef typename typdump::value_type::pol_t pol;
00008   typedef typename pol::monom_t mon;
00009   int maxdeg=-1;
00010   list<mon> current;
00011   list<mon> stockmon;
00012   cout<<"countmon "<<endl;
00013   current.push_back(mon(1));
00014   stockmon.push_back(mon(1));
00015 #if 0
00016   {
00017     typename typdump::const_iterator iter;
00018       for(iter=dump.begin();
00019           iter!=dump.end();iter++);
00020     maxdeg=(--iter)->k;
00021   }
00022 #endif
00023   //on a le degre max
00024   //le quotient est connexe a 1 donc on par t 
00025   //de 1 et on decrit le reste en multipliant par les variables
00026   for(int i=-2;i!=maxdeg;i=maxdeg,maxdeg=stockmon.size())
00027     {
00028       
00029       list<mon> tmpcurrent=current;
00030       //my_merge(stockmon,current);
00031       current.erase(current.begin(),current.end());
00032       for(int i=0;i<b.nbvar();i++)
00033         {
00034           for(typename list<mon>::iterator iter=tmpcurrent.begin();
00035               iter!=tmpcurrent.end();iter++)
00036             current.push_back((*iter)*mon(i,1));
00037         }
00038       //maintenant on tri;
00039       for(typename list<mon>::iterator iter=current.begin();iter!=current.end();iter++)
00040         if((IsinB(*iter,b))&&(!member(stockmon,*iter)))
00041           {
00042             serv.mon2int(*iter);//pour etre sur que l'on a la place 
00043                            //pour tous les monomes du quotient
00044             stockmon.push_back(*iter);
00045           }
00046       else
00047         {
00048           current.erase(iter--);
00049         }
00050     }
00051   return stockmon.size();
00052 }

void MonomialBase ( const Base b,
const typdump &  dump,
typMk &  res 
) [inline]

Definition at line 55 of file basisutil.cc.

References member(), and Base< predicat >::nbvar().

00056 {
00057   typedef typename typdump::value_type::pol_t pol;
00058   typedef typename pol::monom_t mon;
00059   int maxdeg=0;
00060   list<mon> current;
00061   //  list<mon> stockmon;
00062   current.push_back(mon(1));
00063   res.push_back(mon(1));
00064   {
00065     typename typdump::const_iterator iter;
00066       for(iter=dump.begin();
00067           iter!=dump.end();iter++);
00068     maxdeg=(--iter)->k;
00069   }
00070   //on a le degre max
00071   //le quotient est connexe a 1 donc on par t 
00072   //de 1 et on decrit le reste en multipliant par les variables
00073   for(int i=0;i<maxdeg;i++)
00074     {
00075       list<mon> tmpcurrent=current;
00076       //my_merge(stockmon,current);
00077       current.erase(current.begin(),current.end());
00078       for(int i=0;i<b.nbvar();i++)
00079         {
00080           for(typename list<mon>::iterator iter=tmpcurrent.begin();
00081               iter!=tmpcurrent.end();iter++)
00082             current.push_back((*iter)*mon(i,1));
00083         }
00084       //maintenant on tri;
00085       for(typename list<mon>::iterator iter=current.begin();iter!=current.end();iter++)
00086         if((IsinB(*iter,b))&&(!member(res,*iter)))
00087           {
00088             res.push_back(*iter);
00089           }
00090       else
00091         {
00092           current.erase(iter--);
00093         }
00094     }
00095   return;
00096 }


Generated on 6 Dec 2012 for borderbasix by  doxygen 1.6.1