Changeset 0349c20 in git


Ignore:
Timestamp:
Sep 1, 2011, 3:40:30 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
Children:
38ffb7aa68530ae0bcc0c2bb95142f15951ff00c
Parents:
380a9b6e945b3b23b3197f3b6692bf955b0c0301
Message:
deleted unused cf_gcd_charp.cc, cfGEval.*, ffreval.*
deleted factorization over Fp from fac_multivar.cc
deleted some unused parameters


git-svn-id: file:///usr/local/Singular/svn/trunk@14377 2c84dea3-7e68-4137-9b89-c4e89433aadc
Files:
5 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • Singular/misc_ip.cc

    r380a9b6 r0349c20  
    10761076// factory default settings: -----------------------------------------------
    10771077  On(SW_USE_NTL);
    1078   Off(SW_USE_GCD_P);
    10791078  On(SW_USE_NTL_GCD_0); // On -> seg11 in Old/algnorm, Old/factor...
    10801079  On(SW_USE_NTL_GCD_P); // On -> cyle in Short/brnoeth_s: fixed
  • factory/GNUmakefile.in

    r380a9b6 r0349c20  
    139139                cf_factory.cc \
    140140                cf_gcd.cc \
    141                 cf_gcd_charp.cc \
    142141                cf_gcd_smallp.cc \
    143142                cf_generator.cc \
    144                 cfGEval.cc \
    145143                cf_globals.cc \
    146144                cf_hnf.cc \
     
    186184                fieldGCD.cc \
    187185                ffops.cc \
    188                 ffreval.cc \
    189186                gf_tabutil.cc \
    190187                gfops.cc \
     
    235232                cf_factory.h \
    236233                cf_generator.h \
    237                 cfGEval.h \
    238234                cf_globals.h \
    239235                cf_gcd_smallp.h \
     
    273269                fieldGCD.h \
    274270                ffops.h \
    275                 ffreval.h \
    276271                ftmpl_list.h \
    277272                ftmpl_matrix.h \
  • factory/cf_defs.h

    r380a9b6 r0349c20  
    4141const int SW_USE_NTL_SORT=12;
    4242const int SW_USE_CHINREM_GCD=13;
    43 const int SW_USE_GCD_P=14;
    44 const int SW_USE_QGCD=15;
    45 const int SW_USE_fieldGCD=16;
    46 const int SW_USE_FF_MOD_GCD=17;
     43const int SW_USE_QGCD=14;
     44const int SW_USE_fieldGCD=15;
     45const int SW_USE_FF_MOD_GCD=16;
    4746//}}}
    4847
  • factory/cf_gcd.cc

    r380a9b6 r0349c20  
    1616#include "fac_util.h"
    1717#include "templates/ftmpl_functions.h"
    18 #include "ffreval.h"
    1918#include "algext.h"
    2019#include "fieldGCD.h"
     
    3231
    3332static CanonicalForm cf_content ( const CanonicalForm &, const CanonicalForm & );
    34 static bool gcd_avoid_mtaildegree ( CanonicalForm &, CanonicalForm &, CanonicalForm & );
    3533static void cf_prepgcd( const CanonicalForm &, const CanonicalForm &, int &, int &, int & );
    3634
     
    3836
    3937CanonicalForm chinrem_gcd(const CanonicalForm & FF,const CanonicalForm & GG);
    40 CanonicalForm newGCD(CanonicalForm A, CanonicalForm B);
    4138
    4239bool
     
    534531    if ( !( pi.isUnivariate() && pi1.isUnivariate() ) )
    535532    {
    536         //out_cf("F:",f,"\n");
    537         //out_cf("G:",g,"\n");
    538         //out_cf("newGCD:",newGCD(f,g),"\n");
    539         if (isOn(SW_USE_GCD_P) && (getCharacteristic()>0))
    540         {
    541           return newGCD(f,g);
    542         }
    543533        if ( gcd_test_one( pi1, pi, true ) )
    544534        {
     
    714704      fc= EZGCD_P (fc, gc);
    715705    }
    716     #endif
    717     else if (isOn(SW_USE_GCD_P))
    718     {
    719       fc=newGCD(fc,gc);
    720     }
    721     #ifdef HAVE_NTL
    722706    else if (isOn(SW_USE_FF_MOD_GCD) && !fc_and_gc_Univariate)
    723707    {
     
    10571041#endif
    10581042
    1059 static bool
    1060 gcd_avoid_mtaildegree ( CanonicalForm & f1, CanonicalForm & g1, CanonicalForm & d1 )
    1061 {
    1062     bool rdy = true;
    1063     int df = f1.taildegree();
    1064     int dg = g1.taildegree();
    1065 
    1066     d1 = d1.genOne();
    1067     if ( dg == 0 )
    1068     {
    1069         if ( df == 0 )
    1070             return false;
    1071         else
    1072         {
    1073             if ( f1.degree() == df )
    1074                 d1 = cf_content( g1, LC( f1 ) );
    1075             else
    1076             {
    1077                 f1 /= power( f1.mvar(), df );
    1078                 rdy = false;
    1079             }
    1080         }
    1081     }
    1082     else
    1083     {
    1084         if ( df == 0)
    1085         {
    1086             if ( g1.degree() == dg )
    1087                 d1 = cf_content( f1, LC( g1 ) );
    1088             else
    1089             {
    1090                 g1 /= power( g1.mvar(), dg );
    1091                 rdy = false;
    1092             }
    1093         }
    1094         else
    1095         {
    1096             if ( df > dg )
    1097                 d1 = power( f1.mvar(), dg );
    1098             else
    1099                 d1 = power( f1.mvar(), df );
    1100             if ( f1.degree() == df )
    1101             {
    1102                 if (g1.degree() == dg)
    1103                     d1 *= gcd( LC( f1 ), LC( g1 ) );
    1104                 else
    1105                 {
    1106                     g1 /= power( g1.mvar(), dg);
    1107                     d1 *= cf_content( g1, LC( f1 ) );
    1108                 }
    1109             }
    1110             else
    1111             {
    1112                 f1 /= power( f1.mvar(), df );
    1113                 if ( g1.degree() == dg )
    1114                     d1 *= cf_content( f1, LC( g1 ) );
    1115                 else
    1116                 {
    1117                     g1 /= power( g1.mvar(), dg );
    1118                     rdy = false;
    1119                 }
    1120             }
    1121         }
    1122     }
    1123     return rdy;
    1124 }
    1125 
    11261043/*
    11271044*  compute positions p1 and pe of optimal variables:
  • factory/cf_gcd_smallp.cc

    r380a9b6 r0349c20  
    3030#include "templates/ftmpl_functions.h"
    3131#include "cf_random.h"
    32 #include "ffreval.h"
     32#include "cf_reval.h"
    3333#include "facHensel.h"
    3434
     
    39963996static inline
    39973997int Hensel_P (const CanonicalForm & UU, CFArray & G, const Evaluation & AA,
    3998                 const Variable & x, const CFArray& LeadCoeffs )
     3998              const CFArray& LeadCoeffs )
    39993999{
    40004000  CFList factors;
     
    45104510      }
    45114511
    4512       gcdfound= Hensel_P (B*lcD, DD, b, x, lcDD);
     4512      gcdfound= Hensel_P (B*lcD, DD, b, lcDD);
    45134513
    45144514      if (gcdfound == -1)
  • factory/cf_switches.h

    r380a9b6 r0349c20  
    1919//
    2020//}}}
    21 const int CFSwitchesMax = 18;
     21const int CFSwitchesMax = 17;
    2222//}}}
    2323
  • factory/facFqBivar.cc

    r380a9b6 r0349c20  
    20032003CFList
    20042004increasePrecision (CanonicalForm& F, CFList& factors, int factorsFound,
    2005                    int oldNumCols, int oldL, const Variable& alpha,
     2005                   int oldNumCols, int oldL, const Variable&,
    20062006                   int precision
    20072007                  )
  • factory/facFqSquarefree.cc

    r380a9b6 r0349c20  
    7272static inline
    7373CFFList
    74 sqrfPosDer (const CanonicalForm & F, const Variable & x, const int & k,
    75             const Variable & alpha, CanonicalForm & c)
    76 {
    77   Variable buf= alpha;
     74sqrfPosDer (const CanonicalForm & F, const Variable & x,
     75            CanonicalForm & c)
     76{
    7877  CanonicalForm b= deriv (F, x);
    7978  c= gcd (F, b);
     
    131130    if (degree (deriv (A, buf)) >= 0)
    132131    {
    133       if (GF)
    134         tmp1= sqrfPosDer (A, buf, k, alpha, tmp);
    135       else if (GF == false && alpha.level() != 1)
    136         tmp1= sqrfPosDer (A, buf, k, alpha, tmp);
    137       else
    138         tmp1= sqrfPosDer (A, buf, 1, alpha, tmp);
     132      tmp1= sqrfPosDer (A, buf, tmp);
    139133      A= tmp;
    140134      for (CFFListIterator j= tmp1; j.hasItem(); j++)
  • factory/fac_ezgcd.cc

    r380a9b6 r0349c20  
    237237        // (means: bad evaluation point).  Try again with another
    238238        // evaluation point.  Bug fix (?) by JS.  The bad example was
    239         // gcd.debug -ocr /+USE_EZGCD/@12/CB \
    240         //     '(16*B^8-208*B^6*C+927*B^4*C^2-1512*B^2*C^3+432*C^4)' \
     239        // gcd.debug -ocr /+USE_EZGCD/@12/CB
     240        //     '(16*B^8-208*B^6*C+927*B^4*C^2-1512*B^2*C^3+432*C^4)'
    241241        //     '(4*B^7*C^2-50*B^5*C^3+208*B^3*C^4-288*B*C^5)'
    242242        b.nextpoint();
  • factory/fac_multivar.cc

    r380a9b6 r0349c20  
    401401    return R;
    402402}
    403 
    404 static CFArray FpFactorizeMulti ( const CanonicalForm & arg )
    405 {
    406     DEBINCLEVEL( cerr, "FpFactorizeMulti" );
    407     CFMap M;
    408     CanonicalForm UU, U = compress( arg, M );
    409     CanonicalForm delta, omega, V = LC( U, 1 );
    410     int t = U.level();
    411     CFFList F = factorize( V );
    412     CFFListIterator I, J;
    413     CFArray G, lcG, D;
    414     int i, j, r, maxdeg;
    415     REvaluation A( 2, t, FFRandom() );
    416     CanonicalForm U0;
    417     CanonicalForm ft, ut, gt, d;
    418     modpk b;
    419     bool negate = false;
    420 
    421     DEBOUTLN( cerr, "-----------------------------------------------------" );
    422     DEBOUTLN( cerr, "trying to factorize U = " << U );
    423     DEBOUTLN( cerr, "U is a polynomial of level = " << arg.level() );
    424     DEBOUTLN( cerr, "U will be factorized with respect to variable " << Variable(1) );
    425     DEBOUTLN( cerr, "the leading coefficient of U with respect to that variable is " << V );
    426     DEBOUTLN( cerr, "which is factorized as " << F );
    427 
    428     maxdeg = 0;
    429     for ( i = 2; i <= t; i++ )
    430     {
    431         j = U.degree( Variable( i ) );
    432         if ( j > maxdeg ) maxdeg = j;
    433     }
    434 
    435     if ( F.getFirst().factor().inCoeffDomain() )
    436     {
    437         omega = F.getFirst().factor();
    438         F.removeFirst();
    439         if ( omega < 0 )
    440         {
    441             negate = true;
    442             omega = -omega;
    443             U = -U;
    444         }
    445     }
    446     else
    447         omega = 1;
    448 
    449     bool goodeval = false;
    450     r = 0;
    451 
    452 //    for ( i = 0; i < 10*t; i++ )
    453 //        A.nextpoint();
    454 
    455     while ( ! goodeval )
    456     {
    457         TIMING_START(fac_findeval);
    458         findEvaluation( U, V, omega, F, A, U0, delta, D, r );
    459         TIMING_END(fac_findeval);
    460         DEBOUTLN( cerr, "the evaluation point to reduce to an univariate problem is " << A );
    461         DEBOUTLN( cerr, "corresponding delta = " << delta );
    462         DEBOUTLN( cerr, "              omega = " << omega );
    463         DEBOUTLN( cerr, "              D     = " << D );
    464         DEBOUTLN( cerr, "now factorize the univariate polynomial " << U0 );
    465         G = conv_to_factor_array( factorize( U0, false ) );
    466         printf("conv_to_factor_array\n");
    467         DEBOUTLN( cerr, "which factorizes into " << G );
    468 
    469         r = G.size();
    470         lcG = CFArray( 1, r );
    471         UU = U;
    472         //if ( goodeval )
    473         {
    474             printf("start hensel\n");
    475             TIMING_START(fac_hensel);
    476             goodeval = Hensel( UU, G, lcG, A, b, Variable(1) );
    477             TIMING_END(fac_hensel);
    478         }
    479     }
    480     for ( i = 1; i <= r; i++ )
    481     {
    482         G[i] /= icontent( G[i] );
    483         G[i] = M(G[i]);
    484     }
    485     // negate noch beachten !
    486     if ( negate )
    487         G[1] = -G[1];
    488     DEBDECLEVEL( cerr, "ZFactorMulti" );
    489     return G;
    490 }
    491 CFFList FpFactorizeMultivariate ( const CanonicalForm & f, bool issqrfree )
    492 {
    493     CFFList G, F, R;
    494     CFArray GG;
    495     CFFListIterator i, j;
    496     CFMap M;
    497     CanonicalForm g, cont;
    498     Variable v1, vm;
    499     int k, m, n;
    500 
    501     v1 = Variable(1);
    502     if ( issqrfree )
    503         F = CFFactor( f, 1 );
    504     else
    505         F = sqrFree( f );
    506 
    507     for ( i = F; i.hasItem(); i++ )
    508     {
    509         if ( i.getItem().factor().inCoeffDomain() )
    510         {
    511             if ( ! i.getItem().factor().isOne() )
    512                 R.append( CFFactor( i.getItem().factor(), i.getItem().exp() ) );
    513         }
    514         else
    515         {
    516             TIMING_START(fac_content);
    517             g = compress( i.getItem().factor(), M );
    518             // now after compress g contains Variable(1)
    519             vm = g.mvar();
    520             g = swapvar( g, v1, vm );
    521             cont = content( g );
    522             g = swapvar( g / cont, v1, vm );
    523             cont = swapvar( cont, v1, vm );
    524             n = i.getItem().exp();
    525             TIMING_END(fac_content);
    526             DEBOUTLN( cerr, "now after content ..." );
    527             if ( g.isUnivariate() )
    528             {
    529                 G = factorize( g, true );
    530                 for ( j = G; j.hasItem(); j++ )
    531                     if ( ! j.getItem().factor().isOne() )
    532                         R.append( CFFactor( M( j.getItem().factor() ), n ) );
    533             }
    534             else
    535             {
    536                 GG = FpFactorizeMulti( g );
    537                 m = GG.max();
    538                 for ( k = GG.min(); k <= m; k++ )
    539                     if ( ! GG[k].isOne() )
    540                         R.append( CFFactor( M( GG[k] ), n ) );
    541             }
    542             G = factorize( cont, true );
    543             for ( j = G; j.hasItem(); j++ )
    544                 if ( ! j.getItem().factor().isOne() )
    545                     R.append( CFFactor( M( j.getItem().factor() ), n ) );
    546         }
    547     }
    548     return R;
    549 }
  • factory/int_cf.cc

    r380a9b6 r0349c20  
    175175
    176176InternalCF*
    177 InternalCF::tryMulsame( InternalCF* F, const CanonicalForm& M)
     177InternalCF::tryMulsame( InternalCF*, const CanonicalForm&)
    178178{
    179179    ASSERT1( 0, "tryMulsame() not implemented for class %s", this->classname() );
     
    182182
    183183InternalCF*
    184 InternalCF::tryInvert ( const CanonicalForm& M, bool& fail)
     184InternalCF::tryInvert ( const CanonicalForm&, bool&)
    185185{
    186186    ASSERT1( 0, "tryInvert() not implemented for class %s", this->classname() );
     
    189189
    190190bool
    191 InternalCF::tryDivremsamet ( InternalCF* F, InternalCF*& S, InternalCF*& T, const CanonicalForm& M, bool& fail)
     191InternalCF::tryDivremsamet ( InternalCF*, InternalCF*&, InternalCF*&, const CanonicalForm&, bool&)
    192192{
    193193    ASSERT1( 0, "tryDivremsamet() not implemented for class %s", this->classname() );
     
    196196
    197197bool
    198 InternalCF::tryDivremcoefft ( InternalCF* F, InternalCF*& S, InternalCF*& T, bool invert, const CanonicalForm& M, bool& fail)
     198InternalCF::tryDivremcoefft ( InternalCF*, InternalCF*&, InternalCF*&, bool, const CanonicalForm&, bool&)
    199199{
    200200    ASSERT1( 0, "tryDivremcoefft() not implemented for class %s", this->classname() );
     
    203203
    204204InternalCF*
    205 InternalCF::tryDivsame ( InternalCF* F, const CanonicalForm& M, bool& fail)
     205InternalCF::tryDivsame ( InternalCF*, const CanonicalForm&, bool&)
    206206{
    207207    ASSERT1( 0, "tryDivsame() not implemented for class %s", this->classname() );
     
    210210
    211211InternalCF*
    212 InternalCF::tryDivcoeff ( InternalCF* F, bool invert, const CanonicalForm& M, bool& fail)
     212InternalCF::tryDivcoeff ( InternalCF*, bool, const CanonicalForm&, bool&)
    213213{
    214214    ASSERT1( 0, "tryDivcoeff() not implemented for class %s", this->classname() );
     
    217217
    218218InternalCF*
    219 InternalCF::tryDividecoeff ( InternalCF* F, bool invert, const CanonicalForm& M, bool& fail)
     219InternalCF::tryDividecoeff ( InternalCF*, bool, const CanonicalForm&, bool&)
    220220{
    221221    ASSERT1( 0, "tryDividecoeff() not implemented for class %s", this->classname() );
  • factory/int_int.h

    r380a9b6 r0349c20  
    4646public:
    4747#ifdef HAVE_OMALLOC
    48   void* operator new(size_t size)
     48  void* operator new(size_t)
    4949    {
    5050      void* addr;
     
    5252      return addr;
    5353    }
    54   void operator delete(void* addr, size_t size)
     54  void operator delete(void* addr, size_t)
    5555    {
    5656      omFreeBin(addr, InternalInteger_bin);
  • factory/int_poly.h

    r380a9b6 r0349c20  
    4141    friend class CFIterator;
    4242#ifdef HAVE_OMALLOC
    43   void* operator new(size_t size)
     43  void* operator new(size_t)
    4444    {
    4545      void* addr;
     
    4747      return addr;
    4848    }
    49   void operator delete(void* addr, size_t size)
     49  void operator delete(void* addr, size_t)
    5050    {
    5151      omFreeBin(addr, term_bin);
     
    142142#ifdef HAVE_OMALLOC
    143143  static const omBin InternalPoly_bin;
    144   void* operator new(size_t size)
     144  void* operator new(size_t)
    145145    {
    146146      void* addr;
     
    148148      return addr;
    149149    }
    150   void operator delete(void* addr, size_t size)
     150  void operator delete(void* addr, size_t)
    151151    {
    152152      omFreeBin(addr, InternalPoly_bin);
Note: See TracChangeset for help on using the changeset viewer.