Changeset 10b5cf in git


Ignore:
Timestamp:
Jan 9, 2014, 2:43:36 PM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
87b94594069607a5ab9e57ef4d0949d46cd26b64
Parents:
581ac1cf5cb5c2dd89cdcbcef7426758e27c3a60
git-author:
Martin Lee <martinlee84@web.de>2014-01-09 14:43:36+01:00
git-committer:
Martin Lee <martinlee84@web.de>2014-01-27 16:12:23+01:00
Message:
chg: removed/disable dead code
Location:
factory
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • factory/NTLconvert.cc

    r581ac1 r10b5cf  
    88#include "canonicalform.h"
    99#include "cf_iter.h"
    10 #include "fac_berlekamp.h"
    11 #include "fac_cantzass.h"
    12 #include "fac_univar.h"
    13 #include "fac_multivar.h"
    1410#include "fac_sqrfree.h"
    1511#include "cf_algorithm.h"
  • factory/NTLconvert.h

    r581ac1 r10b5cf  
    99#include "canonicalform.h"
    1010#include "cf_iter.h"
    11 #include "fac_berlekamp.h"
    12 #include "fac_cantzass.h"
    13 #include "fac_univar.h"
    14 #include "fac_multivar.h"
    1511#include "fac_sqrfree.h"
    1612#include "cf_algorithm.h"
  • factory/canonicalform.cc

    r581ac1 r10b5cf  
    1616#include "imm.h"
    1717#include "gfops.h"
    18 #include "cf_binom.h"
    1918
    2019#include <factory/cf_gmp.h>
     
    4241
    4342        (void)initializeCharacteristic();
    44         initPT();
    4543        initialized = true;
    4644    }
  • factory/cf_char.cc

    r581ac1 r10b5cf  
    1212#include "int_pp.h"
    1313#include "cf_primes.h"
    14 #include "cf_binom.h"
    1514#include "cf_util.h"
    1615
     
    4140        if (c > 536870909) factoryError("characteristic is too large(max is 2^29)");
    4241        ff_setprime( c );
    43         resetFPT();
    4442    }
    4543}
  • factory/facFqBivar.h

    r581ac1 r10b5cf  
    2727#include "cf_map.h"
    2828#include "cfNewtonPolygon.h"
     29#include "fac_util.h"
    2930
    3031TIMING_DEFINE_PRINT(fac_fq_bi_sqrf)
  • factory/fac_util.cc

    r581ac1 r10b5cf  
    9696
    9797CanonicalForm
    98 remainder( const CanonicalForm & f, const CanonicalForm & g, const modpk & pk )
    99 {
    100     ASSERT( (f.inCoeffDomain() || f.isUnivariate()) && (g.inCoeffDomain() || g.isUnivariate()) && (f.inCoeffDomain() || g.inCoeffDomain() || f.mvar() == g.mvar()), "can not build remainder" );
    101     if ( f.inCoeffDomain() )
    102         if ( g.inCoeffDomain() )
    103             return pk( f % g );
    104         else
    105             return pk( f );
    106     else {
    107         Variable x = f.mvar();
    108         CanonicalForm result = f;
    109         int degg = g.degree();
    110         CanonicalForm invlcg = pk.inverse( g.lc() );
    111         CanonicalForm gg = pk( g*invlcg );
    112         if((gg.lc().isOne()))
    113         {
    114           while ( result.degree() >= degg )
    115           {
    116             result -= pk(lc( result ) * gg) * power( x, result.degree() - degg );
    117             result=pk(result);
    118           }
    119         }
    120         else
    121         // no inverse found
    122         {
    123           CanonicalForm ic=icontent(g);
    124           if (!ic.isOne())
    125           {
    126             gg=g/ic;
    127             return remainder(f,gg,pk);
    128           }
    129           while ( result.degree() >= degg )
    130           {
    131             if (gg.lc().isZero()) return result;
    132             CanonicalForm lcgf = result.lc() / gg.lc();
    133             if (lcgf.inZ())
    134               gg = pk( g*lcgf );
    135             else
    136             {
    137               //printf("!\n\n");
    138               return result;
    139             }
    140             result -=  gg * power( x, result.degree() - degg );
    141             result=pk(result);
    142           }
    143         }
    144         return result;
    145     }
    146 }
    147 
    148 void
    149 divremainder( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & quot, CanonicalForm & rem, const modpk & pk )
    150 {
    151     ASSERT( (f.inCoeffDomain() || f.isUnivariate()) && (g.inCoeffDomain() || g.isUnivariate()) && (f.inCoeffDomain() || g.inCoeffDomain() || f.mvar() == g.mvar()), "can not build remainder" );
    152     if ( f.inCoeffDomain() )
    153         if ( g.inCoeffDomain() ) {
    154             divrem( f, g, quot, rem );
    155             quot = pk( quot );
    156             rem = pk( rem );
    157         }
    158         else {
    159             quot = 0;
    160             rem = pk( f );
    161         }
    162     else {
    163         Variable x = f.mvar();
    164         CanonicalForm invlcg = pk.inverse( g.lc() );
    165         rem = f;
    166         int degg = g.degree();
    167         while ( rem.degree() >= degg ) {
    168             quot += pk( lc( rem ) * invlcg ) * power( x, rem.degree() - degg );
    169             rem = pk( rem - lc( rem ) * invlcg * g * power( x, rem.degree() - degg ) );
    170         }
    171     }
    172 }
    173 
    174 CanonicalForm
    17598mappksymmetric ( const CanonicalForm & f )
    17699{
     
    188111}
    189112
    190 void
    191 extgcd ( const CanonicalForm & a, const CanonicalForm & b, CanonicalForm & S, CanonicalForm & T, const modpk & pk )
    192 {
    193     int p = pk.getp(), k = pk.getk(), j;
    194     CanonicalForm amodp, bmodp, smodp, tmodp, s, t, sigma, tau, e;
    195     CanonicalForm modulus = p, sigmat, taut, q;
    196 
    197     setCharacteristic( p );
    198     {
    199         amodp = mapinto( a ); bmodp = mapinto( b );
    200         (void)extgcd( amodp, bmodp, smodp, tmodp );
    201     }
    202     setCharacteristic( 0 );
    203     s = mapinto( smodp ); t = mapinto( tmodp );
    204 
    205     for ( j = 1; j < k; j++ ) {
    206         e = ( 1 - s * a - t * b ) / modulus;
    207         setCharacteristic( p );
    208         {
    209             e = mapinto( e );
    210             sigmat = smodp * e;
    211             taut = tmodp * e;
    212             divrem( sigmat, bmodp, q, sigma );
    213             tau = taut + q * amodp;
    214         }
    215         setCharacteristic( 0 );
    216         s += mapinto( sigma ) * modulus;
    217         t += mapinto( tau ) * modulus;
    218         modulus *= p;
    219     }
    220     S = s; T = t;
    221 }
    222 
    223 CanonicalForm
    224 sum ( const CFArray & a, int f, int l )
    225 {
    226     if ( f < a.min() ) f = a.min();
    227     if ( l > a.max() ) l = a.max();
    228     CanonicalForm s = 0;
    229     for ( int i = f; i <= l; i++ )
    230         s += a[i];
    231     return s;
    232 }
    233 
    234 CanonicalForm
    235 prod ( const CFArray & a, int f, int l )
    236 {
    237     if ( f < a.min() ) f = a.min();
    238     if ( l > a.max() ) l = a.max();
    239     CanonicalForm p = 1;
    240     for ( int i = f; i <= l; i++ )
    241         p *= a[i];
    242     return p;
    243 }
    244 
    245 CanonicalForm
    246 sum ( const CFArray & a )
    247 {
    248     return sum( a, a.min(), a.max() );
    249 }
    250 
    251 CanonicalForm
    252 prod ( const CFArray & a )
    253 {
    254     return prod( a, a.min(), a.max() );
    255 }
    256 
    257 CanonicalForm
    258 crossprod ( const CFArray & a, const CFArray & b )
    259 {
    260     ASSERT( a.size() == b.size(), "array size mismatch" );
    261     CanonicalForm s = 0;
    262     int fa = a.min();
    263     int fb = b.min();
    264     int n = a.max();
    265     for ( ; fa <= n; fa++, fb++ )
    266         s += a[fa] * b[fb];
    267     return s;
    268 }
  • factory/fac_util.h

    r581ac1 r10b5cf  
    3434CanonicalForm replaceLc( const CanonicalForm & f, const CanonicalForm & c );
    3535
    36 CanonicalForm remainder( const CanonicalForm & f, const CanonicalForm & g, const modpk & pk );
    37 
    38 void divremainder( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & quot, CanonicalForm & rem, const modpk & pk );
    39 
    40 bool Hensel ( const CanonicalForm & U, CFArray & G, const CFArray & lcG, const Evaluation & A, const modpk & bound, const Variable & x );
    41 
    42 /* some special array functions */
    43 
    44 CanonicalForm sum ( const CFArray & a, int f, int l );
    45 
    46 CanonicalForm prod ( const CFArray & a, int f, int l );
    47 
    48 CanonicalForm sum ( const CFArray & a );
    49 
    50 CanonicalForm prod ( const CFArray & a );
    51 
    52 CanonicalForm crossprod ( const CFArray & a, const CFArray & b );
    53 
    5436/*ENDPUBLIC*/
    5537
  • factory/factory.template

    r581ac1 r10b5cf  
    6060
    6161/*MAKEHEADER PUBLIC ONLY*/
    62 #include "cf_binom.h"
    63 
    64 /*MAKEHEADER PUBLIC ONLY*/
    6562#include "cf_algorithm.h"
    6663
Note: See TracChangeset for help on using the changeset viewer.