Changeset df497a in git


Ignore:
Timestamp:
Feb 17, 2006, 12:28:43 PM (18 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
e4e1c2a662f1cc939b50e44a501ff016ef4d1e16
Parents:
ad6ad248b17525d3c24a305a72c5bc48027f3a32
Message:
*hannes: tests restructured


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

Legend:

Unmodified
Added
Removed
  • factory/cf_gcd.cc

    rad6ad2 rdf497a  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: cf_gcd.cc,v 1.38 2006-02-01 09:37:07 pohl Exp $ */
     2/* $Id: cf_gcd.cc,v 1.39 2006-02-17 11:28:43 Singular Exp $ */
    33
    44#include <config.h>
     
    4444        lcg = LC( g, Variable(1) );
    4545    }
    46     while ( ( e( lcf ).isZero() || e( lcg ).isZero() ) && count < 100 ) {
     46    #define TEST_ONE_MAX 50
     47    while ( ( e( lcf ).isZero() || e( lcg ).isZero() ) && count < TEST_ONE_MAX )
     48    {
    4749        e.nextpoint();
    4850        count++;
    4951    }
    50     if ( count == 100 )
     52    if ( count == TEST_ONE_MAX )
    5153        return false;
    5254    CanonicalForm F, G;
     
    357359gcd_poly1( const CanonicalForm & f, const CanonicalForm & g, bool modularflag )
    358360{
    359     CanonicalForm C, Ci, Ci1, Hi, bi, pi, pi1, pi2;
     361    CanonicalForm pi, pi1;
     362    Variable v = f.mvar();
     363
     364    if ( f.degree( v ) >= g.degree( v ) )
     365    {
     366        pi = f; pi1 = g;
     367    }
     368    else
     369    {
     370        pi = g; pi1 = f;
     371    }
     372    CanonicalForm C, Ci, Ci1, Hi, bi, pi2;
    360373    int delta;
    361     Variable v = f.mvar();
    362 
    363     if ( f.degree( v ) >= g.degree( v ) ) {
    364         pi = f; pi1 = g;
    365     }
    366     else {
    367         pi = g; pi1 = f;
    368     }
    369374    Ci = content( pi ); Ci1 = content( pi1 );
     375    pi1 = pi1 / Ci1; pi = pi / Ci;
    370376    C = gcd( Ci, Ci1 );
    371     pi1 = pi1 / Ci1; pi = pi / Ci;
    372377    if ( pi.isUnivariate() && pi1.isUnivariate() )
    373378    {
    374379#ifdef HAVE_NTL
    375       if ((isOn(SW_USE_NTL_GCD_P)||isOn(SW_USE_NTL_GCD_0))
    376        && isPurePoly(pi) && isPurePoly(pi1))
    377          return gcd_poly_univar0(f, g, true);
    378 #endif
     380      if (( modularflag) ||
     381      ((isOn(SW_USE_NTL_GCD_P)||isOn(SW_USE_NTL_GCD_0))
     382       && isPurePoly(pi) && isPurePoly(pi1)))
     383         return gcd_poly_univar0(pi, pi1, true) * C;
     384#else
    379385      if ( modularflag)
    380386        return gcd_poly_univar0( pi, pi1, true ) * C;
     387#endif
    381388    }
    382389    else if ( gcd_test_one( pi1, pi, true ) )
     
    403410    if ( degree( pi1, v ) == 0 )
    404411        return C;
    405     else {
     412    else
    406413        return C * pp( pi );
    407     }
    408414}
    409415
Note: See TracChangeset for help on using the changeset viewer.