Changeset d6c703 in git for factory


Ignore:
Timestamp:
Feb 9, 1998, 4:58:20 PM (26 years ago)
Author:
Rüdiger Stobbe <stobbe@…>
Branches:
(u'spielwiese', '2fa36c576e6a4ddbb1093b43c7f8e9835e17e52a')
Children:
abc625ea7218c401cfe020a534d5f30c28d85f75
Parents:
57f656bdccad12e113db494c2a92c284f8130044
Message:
	* cf_factor.cc (factorize): factorize now handles characteristic
	  0 correct, e.g. rational coefficients and SW_RATIONAL = ON.


git-svn-id: file:///usr/local/Singular/svn/trunk@1137 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_factor.cc

    r57f656b rd6c703  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: cf_factor.cc,v 1.8 1997-12-08 18:24:23 schmidt Exp $ */
     2/* $Id: cf_factor.cc,v 1.9 1998-02-09 15:58:20 stobbe Exp $ */
    33
    44//{{{ docu
     
    2626#include "fac_multivar.h"
    2727#include "fac_sqrfree.h"
     28#include "cf_algorithm.h"
    2829
    2930static bool isUnivariateBaseDomain( const CanonicalForm & f )
     
    4849    }
    4950    else {
     51        CanonicalForm cd = common_den( f );
     52        CanonicalForm fz = f * cd;
     53        CFFList F;
     54        bool on_rational = isOn(SW_RATIONAL);
     55        Off(SW_RATIONAL);
    5056        if ( f.isUnivariate() )
    51             return ZFactorizeUnivariate( f, issqrfree );
     57            F = ZFactorizeUnivariate( fz, issqrfree );
    5258        else
    53             return ZFactorizeMultivariate( f, issqrfree );
     59            F = ZFactorizeMultivariate( fz, issqrfree );
     60        if ( on_rational )
     61            On(SW_RATIONAL);
     62        if ( ! cd.isOne() ) {
     63            if ( F.getFirst().factor().inCoeffDomain() ) {
     64                CFFactor new_first( F.getFirst().factor() / cd );
     65                F.removeFirst();
     66                F.insert( new_first );
     67            }
     68            else {
     69                F.insert( CFFactor( 1/cd ) );
     70            }
     71        }
     72        return F;
    5473    }
    5574}
Note: See TracChangeset for help on using the changeset viewer.