Changeset e2c181 in git


Ignore:
Timestamp:
Feb 22, 2012, 4:26:12 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c1c65551e4b3a0de0b13ddf30446f6e9569681b5')
Children:
ff3a4f4a8e655885eb376e551f47339a6de25bf0
Parents:
43bbd6d912fd61156de899f0e8aa1e830a90b6d7
Message:
chg: enable assertions instead of being lazy
Location:
factory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • factory/gfops.cc

    r43bbd6 re2c181  
    190190}
    191191
    192 //static bool gf_valid_combination ( int p, int n )
    193 //{
    194 //    int i = 0;
    195 //    while ( i < gf_primes_len && gf_primes[i] != p ) i++;
    196 //    if ( i == gf_primes_len )
    197 //        return false;
    198 //    else
    199 //    {
    200 //        i = n;
    201 //        int a = 1;
    202 //        while ( a < gf_maxtable && i > 0 )
    203 //        {
    204 //            a *= p;
    205 //            i--;
    206 //        }
    207 //        if ( i > 0 || a > gf_maxtable )
    208 //            return false;
    209 //        else
    210 //            return true;
    211 //    }
    212 //}
     192static bool gf_valid_combination ( int p, int n )
     193{
     194    int i = 0;
     195    while ( i < gf_primes_len && gf_primes[i] != p ) i++;
     196    if ( i == gf_primes_len )
     197        return false;
     198    else
     199    {
     200        i = n;
     201        int a = 1;
     202        while ( a < gf_maxtable && i > 0 )
     203        {
     204            a *= p;
     205            i--;
     206        }
     207        if ( i > 0 || a > gf_maxtable )
     208            return false;
     209        else
     210            return true;
     211    }
     212}
    213213
    214214void gf_setcharacteristic ( int p, int n, char name )
    215215{
    216     //ASSERT( gf_valid_combination( p, n ), "illegal immediate GF(q)" );
     216    ASSERT( gf_valid_combination( p, n ), "illegal immediate GF(q)" );
    217217    gf_name = name;
    218218    gf_get_table( p, n );
  • factory/variable.cc

    r43bbd6 re2c181  
    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 //}
    161 
    162153static CanonicalForm conv2mipo ( const CanonicalForm & mipo, const Variable alpha )
    163154{
     
    170161Variable rootOf( const CanonicalForm & mipo, char name )
    171162{
    172     //ASSERT( legal_mipo( mipo ), "not a legal extension" );
     163    ASSERT (mipo.inPolyDomain() && mipo.isUnivariate(), "not a legal extension");
    173164
    174165    int l;
Note: See TracChangeset for help on using the changeset viewer.