Changeset b1a453 in git


Ignore:
Timestamp:
Feb 19, 2014, 2:49:08 PM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ace936d6dc5d51a34013b39f57841e36db382b01
Parents:
607d8449052875a7ec694f015644148d54da45b5
git-author:
Martin Lee <martinlee84@web.de>2014-02-19 14:49:08+01:00
git-committer:
Martin Lee <martinlee84@web.de>2014-03-06 11:04:13+01:00
Message:
removed isSqrFree
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    r607d84 rb1a453  
    26792679//       }
    26802680//       else
    2681   /*==================== isSqrFree =============================*/
    2682       if(strcmp(sys_cmd,"isSqrFree")==0)
    2683       {
    2684         if ((h!=NULL) &&(h->Typ()==POLY_CMD))
    2685         {
    2686           res->rtyp=INT_CMD;
    2687           res->data=(void *)(long) singclap_isSqrFree((poly)h->Data(), currRing);
    2688           return FALSE;
    2689         }
    2690         else
    2691           WerrorS("poly expected");
    2692       }
    2693       else
    26942681  /*==================== pDivStat =============================*/
    26952682  #if defined(PDEBUG) || defined(PDIV_DEBUG)
  • factory/cf_algorithm.h

    r607d84 rb1a453  
    7171CFFList sqrFree ( const CanonicalForm & f, bool sort= false );
    7272
    73 bool isSqrFree ( const CanonicalForm & f );
    74 
    7573CanonicalForm homogenize( const CanonicalForm & f, const Variable & x);
    7674CanonicalForm homogenize( const CanonicalForm & f, const Variable & x,
  • factory/cf_factor.cc

    r607d84 rb1a453  
    780780}
    781781
    782 bool isSqrFree ( const CanonicalForm & f )
    783 {
    784 //    ASSERT( f.isUnivariate(), "multivariate factorization not implemented" );
    785     if ( getCharacteristic() == 0 )
    786         return isSqrFreeZ( f );
    787     else
    788         return isSqrFreeFp( f );
    789 }
    790 
  • factory/fac_sqrfree.cc

    r607d84 rb1a453  
    1111#include "cf_map.h"
    1212#include "cf_algorithm.h"
    13 
    14 static int divexp = 1;
    15 
    16 static void divexpfunc ( CanonicalForm &, int & e )
    17 {
    18     e /= divexp;
    19 }
    2013
    2114static int
     
    4942    return result;
    5043}
    51 
    52 CFFList sqrFreeFp ( const CanonicalForm & f )
    53 {
    54     CanonicalForm t0 = f, t, v, w, h;
    55     CanonicalForm leadcf = t0.lc();
    56     Variable x = f.mvar();
    57     CFFList F;
    58     int p = getCharacteristic();
    59     int k, e = 1;
    60 
    61     if ( ! leadcf.isOne() )
    62         t0 /= leadcf;
    63 
    64     divexp = p;
    65     while ( t0.degree(x) > 0 )
    66     {
    67         t = gcd( t0, t0.deriv() );
    68         v = t0 / t;
    69         k = 0;
    70         while ( v.degree(x) > 0 )
    71         {
    72             k = k+1;
    73             if ( k % p == 0 )
    74             {
    75                 t /= v;
    76                 k = k+1;
    77             }
    78             w = gcd( t, v );
    79             h = v / w;
    80             v = w;
    81             t /= v;
    82             if ( h.degree(x) > 0 )
    83                 F.append( CFFactor( h/h.lc(), e*k ) );
    84         }
    85         t0 = apply( t, divexpfunc );
    86         e = p * e;
    87     }
    88     if ( ! leadcf.isOne() )
    89     {
    90         if ( !F.isEmpty() && (F.getFirst().exp() == 1) )
    91         {
    92             leadcf = F.getFirst().factor() * leadcf;
    93             F.removeFirst();
    94         }
    95         F.insert( CFFactor( leadcf, 1 ) );
    96     }
    97     return F;
    98 }
    99 
    100 bool isSqrFreeFp( const CanonicalForm & f )
    101 {
    102   CFFList F = sqrFreeFp( f );
    103   return ( F.length() == 1 && F.getFirst().exp() == 1 );
    104 }
    105 
    106 bool isSqrFreeZ ( const CanonicalForm & f )
    107 {
    108     return gcd( f, f.deriv() ).degree() == 0;
    109 }
    110 
    111 /*
    112 
    113 CFFList sqrFreeZ ( const CanonicalForm & a )
    114 {
    115     CanonicalForm b = a.deriv(), c = gcd( a, b );
    116     CanonicalForm y, z, w = a / c;
    117     int i = 1;
    118     CFFList F;
    119 
    120     while ( ! c.degree() == 0 )
    121     {
    122         y = gcd( w, c ); z = w / y;
    123         if ( degree( z ) > 0 )
    124             if ( lc( z ).sign() < 0 )
    125                 F.append( CFFactor( -z, i ) );
    126             else
    127                 F.append( CFFactor( z, i ) );
    128         i++;
    129         w = y; c = c / y;
    130     }
    131     if ( degree( w ) > 0 )
    132         if ( lc( w ).sign() < 0 )
    133             F.append( CFFactor( -w, i ) );
    134         else
    135             F.append( CFFactor( w, i ) );
    136     return F;
    137 }
    138 */
    13944
    14045CFFList sqrFreeZ ( const CanonicalForm & a )
  • factory/fac_sqrfree.h

    r607d84 rb1a453  
    1010CFFList sortCFFList ( CFFList & F );
    1111
    12 CFFList sqrFreeFp ( const CanonicalForm & f );
    13 
    14 bool isSqrFreeFp ( const CanonicalForm & f );
    15 
    1612CFFList sqrFreeZ ( const CanonicalForm & f );
    17 
    18 bool isSqrFreeZ ( const CanonicalForm & f );
    1913
    2014/// squarefree part of a poly
  • libpolys/polys/clapsing.cc

    r607d84 rb1a453  
    15501550}
    15511551
    1552 BOOLEAN singclap_isSqrFree(poly f, const ring r)
    1553 {
    1554   BOOLEAN b=FALSE;
    1555   CanonicalForm F( convSingPFactoryP( f,r ) );
    1556   if((r->cf->type==n_Zp)&&(!F.isUnivariate()))
    1557       goto err;
    1558   b=(BOOLEAN)isSqrFree(F);
    1559   Off(SW_RATIONAL);
    1560   return b;
    1561 err:
    1562   WerrorS( feNotImplemented );
    1563   return 0;
    1564 }
    1565 
    15661552poly singclap_det( const matrix m, const ring s )
    15671553{
  • libpolys/polys/clapsing.h

    r607d84 rb1a453  
    6060# endif
    6161
    62 BOOLEAN singclap_isSqrFree(poly f, const ring r);
    63 
    6462 matrix singclap_irrCharSeries ( ideal I, const ring r);
    6563 char* singclap_neworder ( ideal I, const ring r);
Note: See TracChangeset for help on using the changeset viewer.