Changeset a81073 in git for factory


Ignore:
Timestamp:
Jan 22, 2008, 10:29:08 AM (16 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
c6d3744af7f072c74673ab0aef31dfe80c1c9ae9
Parents:
af0ef61c8831698375f12ed2c1c9a817c7370ae9
Message:
*hannes: format


git-svn-id: file:///usr/local/Singular/svn/trunk@10516 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
factory
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_factor.cc

    raf0ef6 ra81073  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: cf_factor.cc,v 1.37 2008-01-15 12:36:50 Singular Exp $ */
     2/* $Id: cf_factor.cc,v 1.38 2008-01-22 09:28:22 Singular Exp $ */
    33
    44//{{{ docu
     
    481481    {
    482482        // char p, not univariate
    483         printf("factorize char p, not univariate\n");
    484     }
    485   }
    486   else
     483        //printf("factorize char p, not univariate\n");
     484        F = FpFactorizeMultivariate( f, issqrfree );
     485    }
     486  }
     487  else // char 0
    487488  {
    488489    bool on_rational = isOn(SW_RATIONAL);
     
    701702}
    702703
    703 CFFList sqrFree ( const CanonicalForm & f, bool sort )
    704 {
    705 //    ASSERT( f.isUnivariate(), "multivariate factorization not implemented" );
     704CFFList sqrFree ( const CanonicalForm & f, const CanonicalForm & mipo, bool sort )
     705{
     706    if ( getNumVars(f) == 0 )
     707      return CFFactor(f,1);
     708
    706709    CFFList result;
     710    CanonicalForm c;
     711    if (getCharacteristic() == 0 ) c=icontent(f);
     712    else                           c=f.lc();
     713    CanonicalForm g=f;
     714    if (!c.isOne())
     715    {
     716       result=CFFactor(c,1);
     717       g/=c;
     718    }
    707719
    708720    if ( getCharacteristic() == 0 )
    709         result = sqrFreeZ( f );
     721        result=Union(result,sqrFreeZ( g, mipo ));
    710722    else
    711         result = sqrFreeFp( f );
     723        result=Union(result,sqrFreeFp( g, mipo ));
    712724
    713725    return ( sort ? sortCFFList( result ) : result );
  • factory/fac_distrib.cc

    raf0ef6 ra81073  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: fac_distrib.cc,v 1.8 2006-05-16 13:43:18 Singular Exp $ */
     2/* $Id: fac_distrib.cc,v 1.9 2008-01-22 09:28:39 Singular Exp $ */
    33
    44#include <config.h>
     
    6969        lcG[j] = 1;
    7070
    71     for ( I = F, i = 1; I.hasItem(); I++, i++ ) {
     71    for ( I = F, i = 1; I.hasItem(); I++, i++ )
     72    {
    7273        ft = I.getItem().factor();
    7374        m = I.getItem().exp();
     
    7677        DEBOUTLN( cerr, "and contained to the power of " << m );
    7778        j = 1;
    78         while ( m > 0 && j <= r ) {
     79        while ( m > 0 && j <= r )
     80        {
    7981            ut = lc( G[j] );
    8082            DEBOUTLN( cerr, "checking with " << ut );
    81             while ( m > 0 && fdivides( D[i], ut ) ) {
     83            while ( m > 0 && fdivides( D[i], ut ) )
     84            {
    8285                DEBOUTLN( cerr, "match found" );
    8386                m--; ut /= D[i];
     
    8689            j++;
    8790        }
    88         if (m != 0) {
     91        if (m != 0)
     92        {
    8993            DEBDECLEVEL( cerr, "distributeLeadingCoeffs" );
    9094            return false;
     
    9296    }
    9397    DEBOUTLN( cerr, "the leading coeffs before omega and delta correction: " << lcG );
    94     if ( omega != 1 ) {
    95         for ( j = 1; j <= r; j++ ) {
     98    if ( omega != 1 )
     99    {
     100        for ( j = 1; j <= r; j++ )
     101        {
    96102//            G[j] *= omega;
    97103            lcG[j] *= omega;
     
    100106        U *= power( omega, r-1 );
    101107    }
    102     if ( delta != 1 ) {
    103         for ( j = 1; j <= r; j++ ) {
     108    if ( delta != 1 )
     109    {
     110        for ( j = 1; j <= r; j++ )
     111        {
    104112            lcG[j] *= delta;
    105113            G[j] = G[j] * ( A( lcG[j] ) / lc( G[j] ) );
  • factory/fac_multihensel.cc

    raf0ef6 ra81073  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: fac_multihensel.cc,v 1.8 2002-10-10 17:43:40 Singular Exp $ */
     2/* $Id: fac_multihensel.cc,v 1.9 2008-01-22 09:29:08 Singular Exp $ */
    33
    44#include <config.h>
     
    312312
    313313    Uk[t] = U;
    314     for ( k = t-1; k > 1; k-- ) {
     314    for ( k = t-1; k > 1; k-- )
     315    {
    315316        Uk[k] = Uk[k+1]( A[k+1], Variable( k+1 ) );
    316317        n[k] = degree( Uk[k], Variable( k ) );
    317318    }
    318     for ( k = A.min(); goodeval && (k <= t); k++ ) {
     319    for ( k = A.min(); goodeval && (k <= t); k++ )
     320    {
    319321        h = totaldegree( Uk[k], Variable(A.min()), Variable(k-1) );
    320322        for ( i = A.min(); i <= k; i++ )
Note: See TracChangeset for help on using the changeset viewer.