Changeset 01e8874 in git


Ignore:
Timestamp:
Jun 4, 2009, 7:54:59 PM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
Children:
51d7f7bf9e26957b6f4bfed8b88ec964eb69f77a
Parents:
ca4d0e6c613744c68c30ffd7c388dc69dcc0a538
Message:
*hannes: code cleanup


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

Legend:

Unmodified
Added
Removed
  • factory/NTLconvert.cc

    rca4d0e6 r01e8874  
    1 /* $Id: NTLconvert.cc,v 1.25 2008-08-20 13:35:55 Singular Exp $ */
     1/* $Id: NTLconvert.cc,v 1.26 2009-06-04 17:50:49 Singular Exp $ */
    22#include <config.h>
    33
     
    113113  i=f;
    114114
    115   int j=0;
    116115  int NTLcurrentExp=i.exp();
    117116  int largestExp=i.exp();
     
    172171  i=f;
    173172
    174   int j=0;
    175173  int NTLcurrentExp=i.exp();
    176174  int largestExp=i.exp();
     
    251249  i=f;
    252250
    253   int j=0;
    254251  int NTLcurrentExp=i.exp();
    255252  int largestExp=i.exp();
     
    464461  CFFList rueckgabe;
    465462  ZZ_pX polynom;
    466   long exponent;
    467463  CanonicalForm bigone;
    468464
     
    490486  CFFList rueckgabe;
    491487  zz_pX polynom;
    492   long exponent;
    493488  CanonicalForm bigone;
    494489
     
    699694    i=f;
    700695
    701     int j=0;
    702696    int NTLcurrentExp=i.exp();
    703697    int largestExp=i.exp();
     
    10311025  i=f;
    10321026
    1033   int j=0;
    10341027  int NTLcurrentExp=i.exp();
    10351028  int largestExp=i.exp();
     
    10621055  i=f;
    10631056
    1064   int j=0;
    10651057  int NTLcurrentExp=i.exp();
    10661058  int largestExp=i.exp();
     
    10901082  i=f;
    10911083
    1092   int j=0;
    10931084  int NTLcurrentExp=i.exp();
    10941085  int largestExp=i.exp();
  • factory/cf_factor.cc

    rca4d0e6 r01e8874  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: cf_factor.cc,v 1.42 2008-07-01 13:53:02 Singular Exp $ */
     2/* $Id: cf_factor.cc,v 1.43 2009-06-04 17:50:49 Singular Exp $ */
    33
    44//{{{ docu
     
    4040int getExp(); /* cf_char.cc */
    4141
    42 static bool isUnivariateBaseDomain( const CanonicalForm & f )
    43 {
    44     CFIterator i = f;
    45     bool ok = i.coeff().inBaseDomain();
    46     i++;
    47     while ( i.hasTerms() && ( ok = ok && i.coeff().inBaseDomain() ) ) i++;
    48     return ok;
    49 }
     42//static bool isUnivariateBaseDomain( const CanonicalForm & f )
     43//{
     44//    CFIterator i = f;
     45//    bool ok = i.coeff().inBaseDomain();
     46//    i++;
     47//    while ( i.hasTerms() && ( ok = ok && i.coeff().inBaseDomain() ) ) i++;
     48//    return ok;
     49//}
    5050
    5151void find_exp(const CanonicalForm & f, int * exp_f)
     
    168168void out_cff(CFFList &L)
    169169{
    170   int n = L.length();
     170  //int n = L.length();
    171171  CFFListIterator J=L;
    172172  int j=0;
     
    179179void test_cff(CFFList &L,const CanonicalForm & f)
    180180{
    181   int n = L.length();
     181  //int n = L.length();
    182182  CFFListIterator J=L;
    183183  CanonicalForm t=1;
  • factory/cf_gcd.cc

    rca4d0e6 r01e8874  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: cf_gcd.cc,v 1.68 2008-09-22 16:26:42 Singular Exp $ */
     2/* $Id: cf_gcd.cc,v 1.69 2009-06-04 17:50:49 Singular Exp $ */
    33
    44#include <config.h>
     
    239239//}}}
    240240
    241 static CanonicalForm
    242 gcd_poly_univar0( const CanonicalForm & F, const CanonicalForm & G, bool primitive )
     241static CanonicalForm gcd_poly_univar0( const CanonicalForm & F, const CanonicalForm & G, bool primitive )
    243242{
    244243  CanonicalForm f, g, c, cg, cl, BB, B, M, q, Dp, newD, D, newq;
    245   int p, i, n;
     244  int p, i;
    246245
    247246  if ( primitive )
     
    10881087CanonicalForm chinrem_gcd ( const CanonicalForm & FF, const CanonicalForm & GG )
    10891088{
    1090   CanonicalForm f, g, cg, cl, q, Dp, newD, D, newq;
    1091   int p, i, dp_deg, d_deg;;
    1092 
    1093   CanonicalForm cd = bCommonDen( FF );
     1089  CanonicalForm f, g, cg, cl, q(0), Dp, newD, D, newq;
     1090  int p, i, dp_deg, d_deg;
     1091
     1092  CanonicalForm cd ( bCommonDen( FF ));
    10941093  f=cd*FF;
    10951094  f /=vcontent(f,Variable(1));
     
    11031102  //g /=vcontent(g,Variable(1));
    11041103
    1105   q = 0;
    11061104  i = cf_getNumBigPrimes() - 1;
    11071105  cl =  f.lc()* g.lc();
  • factory/cf_gcd_charp.cc

    rca4d0e6 r01e8874  
    3030static int degWRT(CanonicalForm F, const int lev);
    3131static CanonicalForm lcoefWRT( const CanonicalForm & F, const int lev);
    32 static CanonicalForm newtonInterp(CFList &alpha, CFList &u, const Variable & x);
    3332static CanonicalForm simpleGCD(const CanonicalForm & A, const CanonicalForm & B);
    3433CanonicalForm newGCD(CanonicalForm A, CanonicalForm B);
     
    231230  CanonicalForm result = 0;
    232231  int i, j;
    233   int fieldSize = pow(getCharacteristic(), getGFDegree());
     232  int fieldSize = (int)pow(getCharacteristic(), getGFDegree());
    234233  CanonicalForm g;
    235234  for(i = 0; i <= degree(A); i++)
     
    301300// The current base domain must be GF(p^j), with j a multiple of k.
    302301{
    303   int p = getCharacteristic();
     302  //int p = getCharacteristic();
    304303  int expon = getGFDegree();
    305304  int extExp = expon / k;
     
    312311// The current base domain must be GF(p^j), with j a multiple of k.
    313312{
    314   int p = getCharacteristic();
     313  //int p = getCharacteristic();
    315314  int expon = getGFDegree();
    316315  //cout << "Expon: " << expon << endl;
     
    352351  {
    353352    k=getGFDegree();
    354     fieldSize = pow(p, k);
     353    fieldSize = (int)pow(p, k);
    355354  }
    356355
     
    392391  GFRandom genGF;
    393392  FFRandom genFF;
    394   int i, j;
     393  int i;
    395394  int used;
    396395
  • factory/fac_ezgcd.cc

    rca4d0e6 r01e8874  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: fac_ezgcd.cc,v 1.28 2007-09-27 16:06:59 Singular Exp $ */
     2/* $Id: fac_ezgcd.cc,v 1.29 2009-06-04 17:50:49 Singular Exp $ */
    33
    44#include <config.h>
     
    232232    DEBOUTLN( cerr, "ezgcdspec: (S1)" );
    233233    Ft = ezgcd( F, F.deriv( x ) );
    234     if ( Ft.isOne() ) {
     234    if ( Ft.isOne() )
     235    {
    235236        // In this case F is squarefree and we came here by bad chance
    236237        // (means: bad evaluation point).  Try again with another
     
    302303findeval( const CanonicalForm & F, const CanonicalForm & G, CanonicalForm & Fb, CanonicalForm & Gb, CanonicalForm & Db, REvaluation & b, int delta, int degF, int degG )
    303304{
    304     int i;
    305305    bool ok;
    306306    if ( delta != 0 )
  • factory/fac_multihensel.cc

    rca4d0e6 r01e8874  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: fac_multihensel.cc,v 1.10 2008-03-17 17:44:04 Singular Exp $ */
     2/* $Id: fac_multihensel.cc,v 1.11 2009-06-04 17:50:49 Singular Exp $ */
    33
    44#include <config.h>
     
    3737    CanonicalForm g, bb, b = mapinto( C );
    3838    int j;
    39     for ( j = 1; j < r; j++ ) {
     39    for ( j = 1; j < r; j++ )
     40    {
    4041        extgcdrest( mapinto( P[j] ), mapinto( Q[j] ), mapinto( S[j] ), mapinto( T[j] ), b, bb, a[j], pk );
    4142        b = bb;
     
    5152{
    5253    CanonicalForm pprod = 1, sum = 0;
    53     for ( int i = 1; i <= r; i++ ) {
     54    for ( int i = 1; i <= r; i++ )
     55    {
    5456        sum += pprod * A[i] * Q[i];
    5557        pprod *= P[i];
     
    6567    else if ( f.degree( x ) < n )
    6668        return 0;
    67     else {
     69    else
     70    {
    6871        CFIterator i;
    6972        CanonicalForm sum = 0, fact;
    7073        int min, j;
    7174        Variable v = Variable( f.level() + 1 );
    72         for ( i = swapvar( f, x, v); i.hasTerms() && i.exp() >= n; i++ ) {
     75        for ( i = swapvar( f, x, v); i.hasTerms() && i.exp() >= n; i++ )
     76        {
    7377            fact = 1;
    7478            min = i.exp() - n;
     
    107111}
    108112
    109 static CanonicalForm
    110 check_dummy( const CFArray &a, const CFArray & P, const CFArray & Q )
    111 {
    112     int i, r = a.size();
    113     CanonicalForm res, prod;
    114     res = 0;
    115     prod = 1;
    116     for ( i = 1; i <= r; i++ ) {
    117         res += prod * a[i] * Q[i];
    118         prod *= P[i];
    119     }
    120     return res;
    121 }
    122 
    123 static bool
    124 check_e( const IteratedFor & e, int k, int m, int * n )
     113//static CanonicalForm check_dummy( const CFArray &a, const CFArray & P, const CFArray & Q )
     114//{
     115//    int i, r = a.size();
     116//    CanonicalForm res, prod;
     117//    res = 0;
     118//    prod = 1;
     119//    for ( i = 1; i <= r; i++ )
     120//    {
     121//        res += prod * a[i] * Q[i];
     122//        prod *= P[i];
     123//    }
     124//    return res;
     125//}
     126
     127static bool check_e( const IteratedFor & e, int k, int m, int * n )
    125128{
    126129    int sum = 0;
    127     for ( int i = 2; i < k; i++ ) {
     130    for ( int i = 2; i < k; i++ )
     131    {
    128132        sum += e[i];
    129133        if ( e[i] > n[i] )
     
    133137}
    134138
    135 static CanonicalForm
    136 modDeltak ( const CanonicalForm & f, const Evaluation & A, int k, int * n )
     139static CanonicalForm modDeltak ( const CanonicalForm & f, const Evaluation & A, int k, int * n )
    137140{
    138141    CanonicalForm result = f;
    139     for ( int i = 2; i < k; i++ ) {
     142    for ( int i = 2; i < k; i++ )
     143    {
    140144        result.mod( binomialpower( Variable(i), -A[i], n[i]+1 ) );
    141145    }
     
    163167    DEBOUTLN( cerr, "the first approximation of the correction coefficients is " << A );
    164168#ifdef DEBUGOUTPUT
    165     if ( check_dummy( A, P, Q ) - C != 0 ) {
     169    if ( check_dummy( A, P, Q ) - C != 0 )
     170    {
    166171        DEBOUTLN( cerr, "there is an error detected, the correction coefficients do not" );
    167172        DEBOUTLN( cerr, "fulfill equation F(A)" );
     
    170175    }
    171176#endif
    172     for ( m = 0; m <= h && ( m == 0 || Dm != 0 ); m++ ) {
     177    for ( m = 0; m <= h && ( m == 0 || Dm != 0 ); m++ )
     178    {
    173179        Dm = pk( evalF( P, Q, A, r ) - C );
    174         if ( Dm != 0 ) {
    175             if ( k == 2 ) {
     180        if ( Dm != 0 )
     181        {
     182            if ( k == 2 )
     183            {
    176184                TIMING_START(fac_solve);
    177185                solveF( P0, Q0, S, T, Dm, pk, r, a );
     
    180188                    A[i] -= a[i];
    181189            }
    182             else {
     190            else
     191            {
    183192                IteratedFor e( 2, k-1, m+1 );
    184                 while ( e.iterations_left() ) {
    185                     if ( check_e( e, k, m, n ) ) {
     193                while ( e.iterations_left() )
     194                {
     195                    if ( check_e( e, k, m, n ) )
     196                    {
    186197                        g = pk( checkCombination( Dm, I, e, k ) );
    187                         if ( ! g.isZero() && ! (g.mvar() > Variable(1)) ) {
     198                        if ( ! g.isZero() && ! (g.mvar() > Variable(1)) )
     199                        {
    188200                            prodcomb = prodCombination( I, e, k );
    189201//                            Dm = Dm - g * prodcomb;
     
    191203                            solveF( P0, Q0, S, T, g, pk, r, a );
    192204                            TIMING_END(fac_solve);
    193                             for ( i = 1; i <= r; i++ ) {
     205                            for ( i = 1; i <= r; i++ )
     206                            {
    194207//                                A[i] -= a[i] * prodcomb;
    195208                                A[i] = pk( A[i] - a[i] * prodcomb );
     
    231244    DEBOUTLN( cerr, "modulus p^k= " << b.getpk() << "=" << b.getp() <<"^"<< b.getk() );
    232245
    233     for ( i = 1; i <= r; i++ ) {
     246    for ( i = 1; i <= r; i++ )
     247    {
    234248        Variable vm = Variable( t + 1 );
    235249        Variable v1 = Variable(1);
     
    243257    TIMING_START(fac_extgcd);
    244258    Q[r] = 1;
    245     for ( i = r; i > 1; i-- ) {
     259    for ( i = r; i > 1; i-- )
     260    {
    246261        Q[i-1] = Q[i] * P[i];
    247262        P0[i] = A( P[i], 2, k-1 );
     
    254269    TIMING_END(fac_extgcd);
    255270
    256     for ( m = 1; m <= n[k]+1; m++ ) {
     271    for ( m = 1; m <= n[k]+1; m++ )
     272    {
    257273        TIMING_START(fac_modpk);
    258274        Rm = modDeltak( prod( K ) - Uk, A, k, n );
    259275        TIMING_END(fac_modpk);
    260276#ifdef DEBUGOUTPUT
    261         if ( mod( Rm, xa1 ) != 0 ) {
     277        if ( mod( Rm, xa1 ) != 0 )
     278        {
    262279            DEBOUTLN( cerr, "something seems not to be ok with Rm which is " << Rm );
    263280            DEBOUTLN( cerr, "and should reduce to zero modulo " << xa1 );
    264281        }
    265282#endif
    266         if ( mod( Rm, xa2 ) != 0 ) {
     283        if ( mod( Rm, xa2 ) != 0 )
     284        {
    267285            C = derivAndEval( Rm, m, Variable( k ), A[k] );
    268286            D = 1;
     
    275293// #ifdef DEBUGOUTPUT
    276294//             dummy = check_dummy( alpha, P, Q );
    277 //             if ( b(modDeltak( dummy, A, k, n )) != b(modDeltak( C, A, k, n )) ) {
     295//             if ( b(modDeltak( dummy, A, k, n )) != b(modDeltak( C, A, k, n )) )
     296//             {
    278297//                 DEBOUTLN( cerr, "lift fault" );
    279298//                 DEBDECLEVEL( cerr, "liftStep" );
     
    290309    for ( i = 1; i <= r; i++ )
    291310        P[i] = K[i];
    292     if ( prod( K ) - Uk != 0 ) {
     311    if ( prod( K ) - Uk != 0 )
     312    {
    293313        DEBOUTLN( cerr, "the liftstep produced the wrong result" );
    294314        DEBOUTLN( cerr, "the product of the factors calculated so far is " << prod(K) );
     
    312332
    313333    Uk[t] = U;
    314     for ( k = t-1; k > 1; k-- ) {
     334    for ( k = t-1; k > 1; k-- )
     335    {
    315336        Uk[k] = Uk[k+1]( A[k+1], Variable( k+1 ) );
    316337        n[k] = degree( Uk[k], Variable( k ) );
    317338    }
    318     for ( k = A.min(); goodeval && (k <= t); k++ ) {
     339    for ( k = A.min(); goodeval && (k <= t); k++ )
     340    {
    319341        h = totaldegree( Uk[k], Variable(A.min()), Variable(k-1) );
    320342        for ( i = A.min(); i <= k; i++ )
  • factory/fac_multivar.cc

    rca4d0e6 r01e8874  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: fac_multivar.cc,v 1.14 2008-03-17 17:44:04 Singular Exp $ */
     2/* $Id: fac_multivar.cc,v 1.15 2009-06-04 17:50:49 Singular Exp $ */
    33
    44#include <config.h>
     
    151151  if (! f.inBaseDomain() )
    152152  {
    153     int l = f.level();
    154153    CFIterator i = f;
    155154    for(;;)
     
    206205    CFFListIterator I, J;
    207206    CFArray G, lcG, D;
    208     int i, j, k, m, r, maxdeg, h;
     207    int i, j, r, maxdeg;
    209208    REvaluation A( 2, t, IntRandom( 50 ) );
    210209    CanonicalForm U0;
     
    405404    CFFListIterator I, J;
    406405    CFArray G, lcG, D;
    407     int i, j, k, m, r, maxdeg, h;
     406    int i, j, r, maxdeg;
    408407    REvaluation A( 2, t, FFRandom() );
    409408    CanonicalForm U0;
  • factory/fac_univar.cc

    rca4d0e6 r01e8874  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: fac_univar.cc,v 1.22 2008-03-17 17:44:04 Singular Exp $ */
     2/* $Id: fac_univar.cc,v 1.23 2009-06-04 17:50:49 Singular Exp $ */
    33
    44#include <config.h>
     
    125125}
    126126
    127 static int
    128 cmpFactor( const CFFactor & a, const CFFactor & b )
     127static int cmpFactor( const CFFactor & a, const CFFactor & b )
    129128{
    130129    CFFactor A( a ), B( b );
     
    132131}
    133132
    134 static double
    135 cf2double ( const CanonicalForm & f )
    136 {
    137     CanonicalForm a = f, q, r;
    138     double m = 1, res = 0;
    139     if ( a.sign() < 0 ) a = -a;
    140     while ( ! a.isZero() ) {
    141         divrem( a, 10, q, r );
    142         res += m * (double)(r.intval());
    143         m *= 10;
    144         a = q;
    145     }
    146     if ( f.sign() < 0 ) res = -res;
    147     return res;
    148 }
     133//static double cf2double ( const CanonicalForm & f )
     134//{
     135//    CanonicalForm a = f, q, r;
     136//    double m = 1, res = 0;
     137//    if ( a.sign() < 0 ) a = -a;
     138//    while ( ! a.isZero() ) {
     139//      divrem( a, 10, q, r );
     140//      res += m * (double)(r.intval());
     141//      m *= 10;
     142//      a = q;
     143//    }
     144//    if ( f.sign() < 0 ) res = -res;
     145//    return res;
     146//}
    149147
    150148//{{{ static int kBound ( const CanonicalForm & f, int p )
  • factory/ffreval.cc

    rca4d0e6 r01e8874  
    6464static void solveF_P ( const CFArray & P, const CFArray & Q, const CFArray & S, const CFArray & T, const CanonicalForm & C, int r, CFArray & a );
    6565static CanonicalForm derivAndEval_P ( const CanonicalForm & f, int n, const Variable & x, const CanonicalForm & a );
    66 static CanonicalForm checkCombination_P ( const CanonicalForm & W, const Evaluation & a, const IteratedFor & e, int k );
     66//static CanonicalForm checkCombination_P ( const CanonicalForm & W, const Evaluation & a, const IteratedFor & e, int k );
    6767static CFArray findCorrCoeffs_P ( const CFArray & P, const CFArray & Q, const CFArray & P0, const CFArray & Q0, const CFArray & S, const CFArray & T, const CanonicalForm & C, const Evaluation & I, int r, int k, int h, int * n );
    6868static bool liftStep_P ( CFArray & P, int k, int r, int t, const Evaluation & A, const CFArray & lcG, const CanonicalForm & Uk, int * n, int h );
  • factory/gfops.cc

    rca4d0e6 r01e8874  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: gfops.cc,v 1.9 2008-12-17 15:06:24 Singular Exp $ */
     2/* $Id: gfops.cc,v 1.10 2009-06-04 17:50:50 Singular Exp $ */
    33
    44#include <config.h>
     
    3030
    3131const int gf_primes_len = 42;
    32 static unsigned short gf_primes [] =
    33 {
    34       2,   3,   5,   7,  11,  13,  17,  19,
    35      23,  29,  31,  37,  41,  43,  47,  53,
    36      59,  61,  67,  71,  73,  79,  83,  89,
    37      97, 101, 103, 107, 109, 113, 127, 131,
    38     137, 139, 149, 151, 157, 163, 167, 173,
    39     179, 181, 191, 193, 197, 199, 223, 211,
    40     227, 229, 233, 239, 241, 251
    41 };
     32//static unsigned short gf_primes [] =
     33//{
     34//      2,   3,   5,   7,  11,  13,  17,  19,
     35//     23,  29,  31,  37,  41,  43,  47,  53,
     36//     59,  61,  67,  71,  73,  79,  83,  89,
     37//     97, 101, 103, 107, 109, 113, 127, 131,
     38//    137, 139, 149, 151, 157, 163, 167, 173,
     39//    179, 181, 191, 193, 197, 199, 223, 211,
     40//    227, 229, 233, 239, 241, 251
     41//};
    4242
    4343int gf_q = 0;
     
    5050unsigned short * gf_table = 0;
    5151
    52 CanonicalForm gf_mipo = 0;
    53 
    54 static CanonicalForm
    55 intVec2CF ( int degree, int * coeffs, int level )
     52CanonicalForm gf_mipo(0);
     53
     54static CanonicalForm intVec2CF ( int degree, int * coeffs, int level )
    5655{
    5756    int i;
     
    6463}
    6564
    66 static void
    67 gf_get_table ( int p, int n )
     65static void gf_get_table ( int p, int n )
    6866{
    6967    char buffer[gf_maxbuffer];
     
    162160}
    163161
    164 static bool
    165 gf_valid_combination ( int p, int n )
    166 {
    167     int i = 0;
    168     while ( i < gf_primes_len && gf_primes[i] != p ) i++;
    169     if ( i == gf_primes_len )
    170         return false;
    171     else
    172     {
    173         i = n;
    174         int a = 1;
    175         while ( a < gf_maxtable && i > 0 )
    176         {
    177             a *= p;
    178             i--;
    179         }
    180         if ( i > 0 || a > gf_maxtable )
    181             return false;
    182         else
    183             return true;
    184     }
    185 }
    186 
    187 void
    188 gf_setcharacteristic ( int p, int n, char name )
     162//static bool gf_valid_combination ( int p, int n )
     163//{
     164//    int i = 0;
     165//    while ( i < gf_primes_len && gf_primes[i] != p ) i++;
     166//    if ( i == gf_primes_len )
     167//        return false;
     168//    else
     169//    {
     170//        i = n;
     171//        int a = 1;
     172//        while ( a < gf_maxtable && i > 0 )
     173//        {
     174//            a *= p;
     175//            i--;
     176//        }
     177//        if ( i > 0 || a > gf_maxtable )
     178//            return false;
     179//        else
     180//            return true;
     181//    }
     182//}
     183
     184void gf_setcharacteristic ( int p, int n, char name )
    189185{
    190186    ASSERT( gf_valid_combination( p, n ), "illegal immediate GF(q)" );
     
    193189}
    194190
    195 int
    196 gf_gf2ff ( int a )
     191int gf_gf2ff ( int a )
    197192{
    198193    if ( gf_iszero( a ) )
     
    216211}
    217212
    218 bool
    219 gf_isff ( int a )
     213bool gf_isff ( int a )
    220214{
    221215    if ( gf_iszero( a ) )
  • factory/variable.cc

    rca4d0e6 r01e8874  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: variable.cc,v 1.7 2008-07-01 14:17:49 Singular Exp $ */
     2/* $Id: variable.cc,v 1.8 2009-06-04 17:50:50 Singular Exp $ */
    33
    44#include <config.h>
     
    151151#endif /* NOSTREAMIO */
    152152
    153 static bool legal_mipo( const CanonicalForm & mipo )
    154 {
    155     ASSERT( mipo.inPolyDomain(), "not a legal extension" );
    156     bool ok = true;
    157     for ( CFIterator i = mipo; ok && i.hasTerms(); i++ )
    158         ok = i.coeff().inBaseDomain();
    159     return ok;
    160 }
     153//static bool legal_mipo( const CanonicalForm & mipo )
     154//{
     155//    ASSERT( mipo.inPolyDomain(), "not a legal extension" );
     156//    bool ok = true;
     157//    for ( CFIterator i = mipo; ok && i.hasTerms(); i++ )
     158//      ok = i.coeff().inBaseDomain();
     159//    return ok;
     160//}
    161161
    162162static CanonicalForm conv2mipo ( const CanonicalForm & mipo, const Variable alpha )
  • libfac/charset/alg_factor.cc

    rca4d0e6 r01e8874  
    22// emacs edit mode for this file is -*- C++ -*-
    33////////////////////////////////////////////////////////////
    4 /* $Id: alg_factor.cc,v 1.26 2008-11-06 14:47:03 Singular Exp $ */
     4/* $Id: alg_factor.cc,v 1.27 2009-06-04 17:54:59 Singular Exp $ */
    55////////////////////////////////////////////////////////////
    66// FACTORY - Includes
     
    1111#include <SqrFree.h>
    1212#include <helpstuff.h>
     13#include <assert.h>
    1314// Charset - Includes
    1415#include "csutil.h"
     
    155156// sqr-free routine for algebraic extensions
    156157// we need it! Ex.: f=c^2+2*a*c-1; as=[a^2+1]; f=(c+a)^2
    157 static CFFList
    158 alg_sqrfree( const CanonicalForm & f ){
    159   CFFList L;
    160 
    161   L.append(CFFactor(f,1));
    162   return L;
    163 }
     158//static CFFList alg_sqrfree( const CanonicalForm & f )
     159//{
     160//  CFFList L;
     161//
     162//  L.append(CFFactor(f,1));
     163//  return L;
     164//}
    164165
    165166// Calculates a square free norm
     
    438439CanonicalForm alg_lc(const CanonicalForm &f)
    439440{
    440   if (f.inCoeffDomain()) return f;
    441441  if (f.level()>0)
    442442  {
    443443    return alg_lc(f.LC());
    444444  }
     445  assert(f.inCoeffDomain());
     446  return f;
    445447}
    446448
     
    829831/*
    830832$Log: not supported by cvs2svn $
     833Revision 1.26  2008/11/06 14:47:03  Singular
     834*hannes: newfactoras
     835
    831836Revision 1.25  2008/11/06 14:05:51  Singular
    832837*hannes: newfactoras
Note: See TracChangeset for help on using the changeset viewer.