Changeset b429551 in git


Ignore:
Timestamp:
Jan 22, 2008, 10:51:37 AM (15 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
Children:
f24a7f4cb925cec508572ae72f9bf06624119a14
Parents:
35cfa3461f55f0fe3760bcefda25c627641368c7
Message:
*hannes: sqrFree/InternalSqrFree -> factory


git-svn-id: file:///usr/local/Singular/svn/trunk@10520 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
libfac
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • libfac/charset/alg_factor.cc

    r35cfa3 rb429551  
    33// emacs edit mode for this file is -*- C++ -*-
    44////////////////////////////////////////////////////////////
    5 static char * rcsid = "$Id: alg_factor.cc,v 1.17 2007-05-15 14:46:48 Singular Exp $";
     5static char * rcsid = "$Id: alg_factor.cc,v 1.18 2008-01-22 09:51:36 Singular Exp $";
    66////////////////////////////////////////////////////////////
    77// FACTORY - Includes
     
    754754    Fgcd= pp(Fgcd); Ggcd= pp(Ggcd);
    755755    DEBDECLEVEL(CERR,"newfactoras");
    756     return myUnion(newfactoras(Fgcd,as,success) , newfactoras(Ggcd,as,success));
     756    return UnionCFFL(newfactoras(Fgcd,as,success) , newfactoras(Ggcd,as,success));
    757757  }
    758758  if ( getCharacteristic() > 0 ){
     
    823823    output=newfactoras(i.getItem().factor(),as, success);
    824824    for ( CFFListIterator j=output; j.hasItem(); j++)
    825       Output = myappend(Output,CFFactor(j.getItem().factor(),j.getItem().exp()*i.getItem().exp()));
     825      Output = appendCFFL(Output,CFFactor(j.getItem().factor(),j.getItem().exp()*i.getItem().exp()));
    826826  }
    827827  return Output;
     
    830830/*
    831831$Log: not supported by cvs2svn $
     832Revision 1.17  2007/05/15 14:46:48  Singular
     833*hannes: factorize in Zp(a)[x...]
     834
    832835Revision 1.16  2006/05/16 14:46:48  Singular
    833836*hannes: gcc 4.1 fixes
  • libfac/charset/algfactor.cc

    r35cfa3 rb429551  
    33// emacs edit mode for this file is -*- C++ -*-
    44////////////////////////////////////////////////////////////
    5 static char * rcsid = "$Id: algfactor.cc,v 1.8 2006-06-19 13:37:46 Singular Exp $";
     5static char * rcsid = "$Id: algfactor.cc,v 1.9 2008-01-22 09:51:37 Singular Exp $";
    66////////////////////////////////////////////////////////////
    77// FACTORY - Includes
     
    429429    success= min(success,csuccess);
    430430    for ( CFFListIterator j=CERR; j.hasItem(); j++)
    431       Output = myappend(Output,CFFactor(j.getItem().factor(),j.getItem().exp()*i.getItem().exp()));
     431      Output = appendCFFL(Output,CFFactor(j.getItem().factor(),j.getItem().exp()*i.getItem().exp()));
    432432  }
    433433  return Output;
     
    450450/*
    451451$Log: not supported by cvs2svn $
     452Revision 1.8  2006/06/19 13:37:46  Singular
     453*hannes: more CS renamed
     454
    452455Revision 1.7  2006/05/16 14:46:48  Singular
    453456*hannes: gcc 4.1 fixes
  • libfac/factor/Factor.cc

    r35cfa3 rb429551  
    11/* Copyright 1996 Michael Messollen. All rights reserved. */
    22///////////////////////////////////////////////////////////////////////////////
    3 static char * rcsid = "$Id: Factor.cc,v 1.38 2008-01-07 13:34:56 Singular Exp $ ";
     3static char * rcsid = "$Id: Factor.cc,v 1.39 2008-01-22 09:51:37 Singular Exp $ ";
    44static char * errmsg = "\nYou found a bug!\nPlease inform (Michael Messollen) michael@math.uni-sb.de \nPlease include above information and your input (the ideal/polynomial and characteristic) in your bug-report.\nThank you.";
    55///////////////////////////////////////////////////////////////////////////////
     
    312312          // the multiplicity of the save_denumerator <-> lc
    313313          // the following will do what we want
    314           Returnlist= myUnion( CFFList(CFFactor(1/a,1)),Returnlist) ;
     314          Returnlist= UnionCFFL( CFFList(CFFactor(1/a,1)),Returnlist) ;
    315315        else
    316316        {
     
    719719      Outputlist_b = Factorized(ffuni,alpha);
    720720      DEBOUTLN(CERR, "Outputlist_b = ", Outputlist_b);
    721       Outputlist = myUnion(Outputlist_a, Outputlist_b);
     721      Outputlist = UnionCFFL(Outputlist_a, Outputlist_b);
    722722      // have to back-swapvar the factors....
    723723      for ( CFFListIterator i=Outputlist; i.hasItem(); i++ ){
     
    928928  {
    929929    TIMING_START(sqrfree_time);
    930     SqrFreeList = InternalSqrFree(F) ; // first sqrfree the polynomial
    931     // don't use sqrFree(F), factory's internal sqrFree for multiv.
    932     // Polynomials; it's wrong!! Ex.: char=p   f= x^p*(y+1);
     930    SqrFreeList = sqrFree(F,0,false) ; // first sqrfree the polynomial
     931    // Ex.: char=p   f= x^p*(y+1);
    933932    // InternalSqrFree(f)= ( y+1, (x)^p ), sqrFree(f)= ( y+1 ) .
    934933    TIMING_END(sqrfree_time);
     
    941940  else
    942941    SqrFreeList.append(CFFactor(F,1));
    943   DEBOUTLN(CERR, "InternalSqrFreeList= ", SqrFreeList);
     942  DEBOUTLN(CERR, "SqrFreeList= ", SqrFreeList);
    944943  for ( i=SqrFreeList; i.hasItem(); i++ )
    945944  {
     
    977976        for ( j=Intermediatelist; j.hasItem(); j++ )
    978977          //Normally j.getItem().exp() should be 1
    979           Outputlist= myappend( Outputlist, CFFactor(m(j.getItem().factor()),exp*j.getItem().exp()));
     978          Outputlist= appendCFFL( Outputlist, CFFactor(m(j.getItem().factor()),exp*j.getItem().exp()));
    980979      }
    981980  }
     
    11741173      {
    11751174        CFList as(minpoly);
    1176         CFFList sqF=sqrFree(F); // sqrFreeZ
     1175        CFFList sqF=sqrFree(F,0,false); // sqrFreeZ
    11771176        CFFList G,H;
    11781177        CanonicalForm fac;
     
    12281227  {
    12291228    TIMING_START(sqrfree_time);
    1230     SqrFreeList = InternalSqrFree(F, minpoly) ; // first sqrfree the polynomial
    1231     // don't use sqrFree(F), factory's internal sqrFree for multiv.
    1232     // Polynomials; it's wrong!! Ex.: char=p   f= x^p*(y+1);
     1229    SqrFreeList = sqrFree(F, minpoly) ; // first sqrfree the polynomial
     1230    // Ex.: char=p   f= x^p*(y+1);
    12331231    // InternalSqrFree(f)= ( y+1, (x)^p ), sqrFree(f)= ( y+1 ) .
    12341232    TIMING_END(sqrfree_time);
     
    12411239  else
    12421240    SqrFreeList.append(CFFactor(F,1));
    1243   DEBOUTLN(CERR, "InternalSqrFreeList= ", SqrFreeList);
     1241  DEBOUTLN(CERR, "SqrFreeList= ", SqrFreeList);
    12441242  for ( i=SqrFreeList; i.hasItem(); i++ )
    12451243  {
     
    12811279        for ( j=Intermediatelist; j.hasItem(); j++ )
    12821280          //Normally j.getItem().exp() should be 1
    1283           Outputlist= myappend( Outputlist, CFFactor(m(j.getItem().factor()),exp*j.getItem().exp()));
     1281          Outputlist= appendCFFL( Outputlist, CFFactor(m(j.getItem().factor()),exp*j.getItem().exp()));
    12841282      }
    12851283    }
     
    13311329/*
    13321330$Log: not supported by cvs2svn $
     1331Revision 1.38  2008/01/07 13:34:56  Singular
     1332*hannes: omse optiomzations(isOne)
     1333
    13331334Revision 1.37  2007/10/25 14:45:41  Singular
    13341335*hannes: homgfactor for alg.ext of Q
  • libfac/factor/MVMultiHensel.cc

    r35cfa3 rb429551  
    22///////////////////////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // static char * rcsid = "$Id: MVMultiHensel.cc,v 1.14 2007-06-14 14:16:35 Singular Exp $";
     4// static char * rcsid = "$Id: MVMultiHensel.cc,v 1.15 2008-01-22 09:51:37 Singular Exp $";
    55///////////////////////////////////////////////////////////////////////////////
    66// FACTORY - Includes
     
    334334{
    335335  CanonicalForm V,Fk=F,Gk=G,Rk,W,D,S;
    336   int  levelU=level(U), degU=subvardegree(U,levelU); // degree(U,{x_1,..,x_(level(U)-1)})
     336  int  levelU=level(U), degU=totaldegree(U,1,levelU); // degree(U,{x_1,..,x_(level(U)-1)})
    337337  DiophantForm Retvalue;
    338338  RememberArray A(degree(F,levelU)+degree(G,levelU)+1);
     
    520520/*
    521521$Log: not supported by cvs2svn $
     522Revision 1.14  2007/06/14 14:16:35  Singular
     523*hannes: Factorize2 etc.
     524
    522525Revision 1.13  2007/05/25 16:02:02  Singular
    523526*hannes: removed diophant_error, format
  • libfac/factor/SqrFree.cc

    r35cfa3 rb429551  
    22///////////////////////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 static char * rcsid = "$Id: SqrFree.cc,v 1.12 2008-01-07 13:34:56 Singular Exp $";
     4static char * rcsid = "$Id: SqrFree.cc,v 1.13 2008-01-22 09:51:37 Singular Exp $";
    55static char * errmsg = "\nYou found a bug!\nPlease inform (Michael Messollen) michael@math.uni-sb.de .\n Please include above information and your input (the ideal/polynomial and characteristic) in your bug-report.\nThank you.";
    66///////////////////////////////////////////////////////////////////////////////
     
    204204// needs not to be 1 !!!!!                                   //
    205205///////////////////////////////////////////////////////////////
    206 static CFFList
    207 SqrFreed( const CanonicalForm & r , const CanonicalForm &mipo=0){
    208   CanonicalForm h, g, f = r;
    209   CFFList Outputlist;
    210   int n = level(f);
    211 
    212   DEBINCLEVEL(CERR, "SqrFreed");
    213   DEBOUTLN(CERR, "Called with r= ", r);
    214   if (getNumVars(f)==0 ) { // just a constant; return it
    215     Outputlist= myappend(Outputlist,CFFactor(f,1));
    216     return Outputlist ;
    217   }
    218 
    219 // We look if we do have a content; if so, SqrFreed the content
    220 // and continue computations with pp(f)
    221   for (int k=1; k<=n; k++) {
    222     if ((mipo.level()==-1000000)||(k!=1))
    223     {
    224       g = swapvar(f,k,n); g = content(g);
    225       if ( ! (g.isOne() || (-g).isOne() || degree(g)==0 )) {
    226         g = swapvar(g,k,n);
    227         DEBOUTLN(CERR, "We have a content: ", g);
    228         Outputlist = myUnion(InternalSqrFree(g,mipo),Outputlist); // should we add a
    229                                                 // SqrFreeTest(g) first ?
    230         DEBOUTLN(CERR, "Outputlist is now: ", Outputlist);
    231         f /=g;
    232         DEBOUTLN(CERR, "f is now: ", f);
    233       }
    234     } 
    235   }
    236 
    237 // Now f is primitive; Let`s look if f is univariate
    238   if ( f.isUnivariate() ) {
    239     DEBOUTLN(CERR, "f is univariate: ", f);
    240     g = content(g);
    241     if ( ! (g.isOne() || (-g).isOne() ) ){
    242       Outputlist= myappend(Outputlist,CFFactor(g,1)) ;
    243       f /= g;
    244     }
    245     Outputlist = Union(sqrFree(f),Outputlist) ;
    246     DEBOUTLN(CERR, "Outputlist after univ. sqrFree(f) = ", Outputlist);
    247     DEBDECLEVEL(CERR, "SqrFreed");
    248     return Outputlist ;
    249   }
    250 
    251 // Linear?
    252   if ( totaldegree(f) <= 1 ) {
    253     Outputlist= myappend(Outputlist,CFFactor(f,1)) ;
    254     DEBDECLEVEL(CERR, "SqrFreed");
    255     return Outputlist ;
    256   }
    257 
    258 // is it Pth root?
    259   n=level(f); // maybe less indeterminants
    260   g= f.deriv();
    261   if ( getCharacteristic() > 0 && g.isZero() ){  // Pth roots only apply to char > 0
    262     for (int k=1; k<=n; k++)
    263     {
    264       if ((mipo.level()==-1000000)||(k!=1))
    265       {
    266         g=swapvar(f,k,n) ;
    267         g = g.deriv();
    268 
    269         if ( ! g.isZero() )
    270         { // can`t be Pth root
    271           CFFList Outputlist2= SqrFreed(swapvar(f,k,n));
    272           for (CFFListIterator inter=Outputlist2; inter.hasItem(); inter++){
    273             Outputlist= myappend(Outputlist, CFFactor(swapvar(inter.getItem().factor(),k,n), inter.getItem().exp()));
    274           }
    275           return Outputlist;
    276         }
    277       }
    278       if ( k==n )
    279       { // really is Pth power
    280         DEBOUTLN(CERR, "f is a p'th root: ", f);
    281         CFMap m;
    282         g = compress(f,m);
    283         if (mipo==0)
    284           f = m(PthRoot(g));
    285         else
    286           f = m(PthRoot(g,mipo));
    287         DEBOUTLN(CERR, "  that is       : ", f);
    288         // now : Outputlist union ( SqrFreed(f) )^getCharacteristic()
    289         Outputlist=myUnion(Powerup(InternalSqrFree(f),getCharacteristic()),Outputlist);
    290         DEBDECLEVEL(CERR, "SqrFreed");
    291         return Outputlist ;
    292       }
    293     }
    294   }
    295   g = f.deriv();
    296   DEBOUTLN(CERR, "calculating gcd of ", f);
    297   DEBOUTLN(CERR, "               and ", g);
    298   h = gcd(f,pp(g));  h /= lc(h);
    299   DEBOUTLN(CERR,"gcd(f,g)= ",h);
    300   if ( (h.isOne()) || ( h==f) || ((-h).isOne()) || getNumVars(h)==0 ) { // no common factor
    301     Outputlist= myappend(Outputlist,CFFactor(f,1)) ;
    302     DEBOUTLN(CERR, "Outputlist= ", Outputlist);
    303     DEBDECLEVEL(CERR, "SqrFreed");
    304     return Outputlist ;
    305   }
    306   else  // we can split into two nontrivial pieces
    307   {
    308     f /= h; // Now we have split the poly into f and h
    309     g = lc(f);
    310     //if ( g != f.genOne() && getNumVars(g) == 0 ){
    311     if ( (!g.isOne()) && getNumVars(g) == 0 )
    312     {
    313        Outputlist= myappend(Outputlist,CFFactor(g,1)) ;
    314        f /= g;
    315     }
    316     DEBOUTLN(CERR, "Split into f= ", f);
    317     DEBOUTLN(CERR, "       and h= ", h);
    318     // For char > 0 the polys f and h can have Pth roots; so we need a test
    319     // Test is disabled because timing is the same
    320    
    321 //    if ( SqrFreeTest(f,0) )
    322 //      Outputlist= myappend(Outputlist,CFFactor(f,1)) ;
    323 //    else
    324     Outputlist=myUnion(Outputlist, InternalSqrFree(f));
    325 //    if ( SqrFreeTest(h,0) )
    326 //      Outputlist= myappend(Outputlist,CFFactor(h,1)) ;
    327 //    else
    328     Outputlist=myUnion(Outputlist,InternalSqrFree(h));
    329     DEBOUTLN(CERR, "Returning list ", Outputlist);
    330     DEBDECLEVEL(CERR, "SqrFreed");
    331     return Outputlist ;
    332   }
    333 #ifdef HAVE_SINGULAR_ERROR
    334   WerrorS("libfac: ERROR: SqrFreed: we should never fall trough here!");
    335 #else
    336 #ifndef NOSTREAMIO
    337   CERR << "\nlibfac: ERROR: SqrFreed: we should never fall trough here!\n"
    338        << rcsid << errmsg << "\n";
    339 #endif
    340 #endif
    341   DEBDECLEVEL(CERR, "SqrFreed");
    342   return Outputlist; // for safety purpose
    343 }
    344 
    345 ///////////////////////////////////////////////////////////////
    346 // The user front-end for the SqrFreed routine.              //
    347 // Input can have a constant as content                      //
    348 ///////////////////////////////////////////////////////////////
    349 CFFList
    350 InternalSqrFree( const CanonicalForm & r , const CanonicalForm & mipo ){
    351   CanonicalForm g=icontent(r), f = r;
    352   CFFList Outputlist, Outputlist2;
    353 
    354   DEBINCLEVEL(CERR, "InternalSqrFree");
    355   DEBOUTMSG(CERR, rcsid);
    356   DEBOUTLN(CERR,"Called with f= ", f);
    357 
    358   // Take care of stupid users giving us constants
    359   if ( getNumVars(f) == 0 ) { // a constant ; Exp==1 even if f==0
    360       Outputlist= myappend(Outputlist,CFFactor(f,1));
    361   }
    362   else{
    363       // Now we are sure: we have a nonconstant polynomial
    364       g = lc(f);
    365       while ( getNumVars(g) != 0 ) g=content(g);
    366       if ( ! g.isOne() ) Outputlist= myappend(Outputlist,CFFactor(g,1)) ;
    367       f /= g;
    368       if ( getNumVars(f) != 0 ) // a real polynomial
    369       {
    370         if (mipo!=0)
    371           Outputlist=myUnion(SqrFreed(f,mipo),Outputlist) ;
    372         else 
    373           Outputlist=myUnion(SqrFreed(f),Outputlist) ;
    374       }
    375   }
    376   DEBOUTLN(CERR,"Outputlist = ", Outputlist);
    377   for ( CFFListIterator i=Outputlist; i.hasItem(); i++ )
    378     if ( getNumVars(i.getItem().factor()) > 0 )
    379       Outputlist2.append(i.getItem());
    380 
    381   DEBOUTLN(CERR,"Outputlist2 = ", Outputlist2);
    382   DEBDECLEVEL(CERR, "InternalSqrFree");
    383   return Outputlist2 ;
    384 }
    385206
    386207CFFList
    387208SqrFree(const CanonicalForm & r ){
    388   CFFList outputlist, sqrfreelist = InternalSqrFree(r);
     209  CFFList outputlist, sqrfreelist = sqrFree(r,0,false);
    389210  CFFListIterator i;
    390211  CanonicalForm elem;
     
    418239/*
    419240$Log: not supported by cvs2svn $
     241Revision 1.12  2008/01/07 13:34:56  Singular
     242*hannes: omse optiomzations(isOne)
     243
    420244Revision 1.11  2007/05/15 14:46:49  Singular
    421245*hannes: factorize in Zp(a)[x...]
  • libfac/factor/SqrFree.h

    r35cfa3 rb429551  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: SqrFree.h,v 1.4 2002-08-19 11:11:34 Singular Exp $
     4// $Id: SqrFree.h,v 1.5 2008-01-22 09:51:37 Singular Exp $
    55///////////////////////////////////////////////////////////////////////////////
    66#ifndef SQRFREE_H
     
    1010// CFFList SqrFree( const CanonicalForm & f ) ;
    1111/*ENDPUBLIC*/
    12 CFFList InternalSqrFree( const CanonicalForm & f , const CanonicalForm & mipo=0) ;
     12//CFFList InternalSqrFree( const CanonicalForm & f , const CanonicalForm & mipo=0) ;
    1313int     SqrFreeTest( const CanonicalForm & r, int opt=1) ;
    1414CFFList SqrFree( const CanonicalForm & f ) ;
     
    1818/*
    1919$Log: not supported by cvs2svn $
     20Revision 1.4  2002/08/19 11:11:34  Singular
     21* hannes/pfister: alg_gcd etc.
     22
    2023Revision 1.3  1997/09/12 07:19:51  Singular
    2124* hannes/michael: libfac-0.3.0
  • libfac/factor/Truefactor.cc

    r35cfa3 rb429551  
    22///////////////////////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 //static char * rcsid = "@(#) $Id: Truefactor.cc,v 1.11 2008-01-07 13:34:56 Singular Exp $";
     4//static char * rcsid = "@(#) $Id: Truefactor.cc,v 1.12 2008-01-22 09:51:37 Singular Exp $";
    55///////////////////////////////////////////////////////////////////////////////
    66// Factory - Includes
     
    229229  CFFactor factor;
    230230  CFFList L,FAC,E_all;
    231   int c,r = PiList.length(),degU, onemore,M, h = subvardegree(Ua,levelU) + 1;
     231  int c,r = PiList.length(),degU, onemore,M, h = totaldegree(Ua,1,levelU) + 1;
    232232  ListIterator<CFFactor> i;
    233233
     
    450450/*
    451451$Log: not supported by cvs2svn $
     452Revision 1.11  2008/01/07 13:34:56  Singular
     453*hannes: omse optiomzations(isOne)
     454
    452455Revision 1.10  2006/05/16 14:46:50  Singular
    453456*hannes: gcc 4.1 fixes
  • libfac/factor/helpstuff.cc

    r35cfa3 rb429551  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // static char * rcsid = "$Id: helpstuff.cc,v 1.5 2007-05-25 12:59:05 Singular Exp $";
     4// static char * rcsid = "$Id: helpstuff.cc,v 1.6 2008-01-22 09:51:37 Singular Exp $";
    55////////////////////////////////////////////////////////////
    66// FACTORY - Includes
     
    3232  if ( aa==bb ) { b=bb; }
    3333  else { b=aa; }
    34 }
    35 
    36 // Now some procedures used in SqrFree and in Factor
    37 ///////////////////////////////////////////////////////////////
    38 ///////////////////////////////////////////////////////////////
    39 // We have to include a version of <CFFList>.append(CFFactor)//
    40 // and Union( CFFList, CFFList)                              //
    41 // because we have to look for multiplicities in SqrFree.    //
    42 // e.g.: SqrFree( f^3 ) with char <> 3                       //
    43 ///////////////////////////////////////////////////////////////
    44 CFFList
    45 myappend( const CFFList & Inputlist, const CFFactor & TheFactor){
    46   CFFList Outputlist ;
    47   CFFactor copy;
    48   CFFListIterator i;
    49   int exp=0;
    50 
    51   for ( i=Inputlist ; i.hasItem() ; i++ ){
    52     copy = i.getItem();
    53     if ( copy.factor() == TheFactor.factor() )
    54       exp += copy.exp();
    55     else
    56       Outputlist.append(copy);
    57   }
    58   Outputlist.append( CFFactor(TheFactor.factor(), exp + TheFactor.exp()));
    59   return Outputlist;
    60 }
    61 
    62 CFFList
    63 myUnion(const CFFList & Inputlist1,const CFFList & Inputlist2){
    64   CFFList Outputlist;
    65   CFFListIterator i;
    66 
    67   for ( i=Inputlist1 ; i.hasItem() ; i++ )
    68     Outputlist = myappend(Outputlist, i.getItem() );
    69   for ( i=Inputlist2 ; i.hasItem() ; i++ )
    70     Outputlist = myappend(Outputlist, i.getItem() );
    71 
    72   return Outputlist;
    73 }
    74 
    75 int
    76 Powerup( const int base , const int exp){
    77   int retvalue=1;
    78   if ( exp == 0 )  return retvalue ;
    79   else for ( int i=1 ; i <= exp; i++ ) retvalue *= base ;
    80 
    81   return retvalue;
    8234}
    8335
     
    12880
    12981///////////////////////////////////////////////////////////////
    130 // Return the deg of F in the Variables x_1,..,x_(levelF-1)  //
    131 ///////////////////////////////////////////////////////////////
    132 int
    133 subvardegree( const CanonicalForm & F, int levelF ){
    134   int n=0,m=degree(F,levelF),newn=0;
    135 
    136   for ( int k=0; k<=m; k++ ){
    137     newn = totaldegree( F[k] );
    138     if ( newn > n ) n=newn;
    139   }
    140   return n;
    141 }
    142 
    143 ///////////////////////////////////////////////////////////////
    14482// Change poly:  x_i <- x_i +- a_i    for i= 1,..,level(f)-1 //
    14583///////////////////////////////////////////////////////////////
     
    177115/*
    178116$Log: not supported by cvs2svn $
     117Revision 1.5  2007/05/25 12:59:05  Singular
     118*hannes: fdivides2
     119
    179120Revision 1.4  2001/06/19 15:29:04  Singular
    180121*hannes: optim.
  • libfac/factor/helpstuff.h

    r35cfa3 rb429551  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 // $Id: helpstuff.h,v 1.4 2007-05-15 14:46:49 Singular Exp $
     4// $Id: helpstuff.h,v 1.5 2008-01-22 09:51:37 Singular Exp $
    55////////////////////////////////////////////////////////////
    66#ifndef HELPSTUFF_H
     
    1212///////////////////////////////////////////////////////////////
    1313CanonicalForm mod_power( const CanonicalForm & f, int k, int levelU);
    14 int subvardegree( const CanonicalForm & F, int levelF );
    1514CanonicalForm change_poly( const CanonicalForm & f , const SFormList & Substitutionlist, int directionback );
    1615
     
    1817// Now some procedures used in SqrFree and in Factor
    1918///////////////////////////////////////////////////////////////
    20 CFFList myappend( const CFFList & Inputlist, const CFFactor & TheFactor) ;
    21 CFFList myUnion(const CFFList & Inputlist1,const CFFList & Inputlist2);
    22 int Powerup( const int base , const int exp=1);
    23 inline int min ( const int a, const int b ){
     19inline int min ( const int a, const int b )
     20{
    2421  return (a<=b ? a:b);
    2522}
    26 inline int max ( const int a, const int b ){
     23inline int max ( const int a, const int b )
     24{
    2725  return (a>b ? a:b);
    2826}
     
    3230/*
    3331$Log: not supported by cvs2svn $
     32Revision 1.4  2007/05/15 14:46:49  Singular
     33*hannes: factorize in Zp(a)[x...]
     34
    3435Revision 1.3  1997/09/12 07:19:57  Singular
    3536* hannes/michael: libfac-0.3.0
Note: See TracChangeset for help on using the changeset viewer.