Changeset f4b180 in git for factory/cf_gcd.cc


Ignore:
Timestamp:
Sep 26, 2007, 5:07:16 PM (16 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'e7cc1ebecb61be8b9ca6c18016352af89940b21a')
Children:
a094d6f29cc607482d3c6933b8425c059b4136fe
Parents:
08a6ebb93a83d74ddbebc285cfd635bbda6ce13c
Message:
*hanne: fix test for unlucky primes


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

Legend:

Unmodified
Added
Removed
  • factory/cf_gcd.cc

    r08a6ebb rf4b180  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: cf_gcd.cc,v 1.51 2007-09-26 14:31:12 Singular Exp $ */
     2/* $Id: cf_gcd.cc,v 1.52 2007-09-26 15:07:16 Singular Exp $ */
    33
    44#include <config.h>
     
    3333CanonicalForm
    3434chinrem_gcd ( const CanonicalForm & FF, const CanonicalForm & GG );
    35  
     35
    3636bool
    3737gcd_test_one ( const CanonicalForm & f, const CanonicalForm & g, bool swap )
     
    706706#else
    707707                while(1)
    708                 { 
    709                   d = gcd_poly( f, g ); 
     708                {
     709                  d = gcd_poly( f, g );
    710710                  if ((fdivides(d,f)) && (fdivides(d,g))) break;
    711711                  printf("g"); fflush(stdout);
     
    930930    for ( i = n-1; i > 0; i-- )
    931931    {
    932         if ( degsf[i] == 0 )
     932        if ( degsf[i] == 0 )
    933933        {
    934934            if ( degsg[i] != 0 )
     
    953953    if ( ( pe != 1 ) && ( degsf[1] != 0 ) )
    954954        pe = -pe;
    955    
     955
    956956    delete [] degsf;
    957957    delete [] degsg;
     
    976976            result += power( x, i.exp() ) * c;
    977977        }
    978         else 
     978        else
    979979          result += power( x, i.exp() ) * balance_p(c,q);
    980980    }
     
    10361036        D = newD;
    10371037      }
    1038       else if ( dp_deg > d_deg )
     1038      else if ( dp_deg < d_deg )
    10391039      {
    10401040        n=GCD_CHINES_MIN_TRIES;
     
    10441044        d_deg=dp_deg;
    10451045      }
    1046       //else dp_deg < d_deg: bad prime
     1046      //else dp_deg > d_deg: bad prime
    10471047    }
    10481048    if ( i >= 0 )
     
    10511051      {
    10521052        CanonicalForm Dn= Farey(D,q);
    1053         int is_rat=isOn(SW_RATIONAL);
    1054         On(SW_RATIONAL);
     1053        int is_rat=isOn(SW_RATIONAL);
     1054        On(SW_RATIONAL);
    10551055        CanonicalForm cd = bCommonDen( Dn ); // we need On(SW_RATIONAL)
    1056         if (!is_rat) Off(SW_RATIONAL);
     1056        if (!is_rat) Off(SW_RATIONAL);
    10571057        Dn *=cd;
    10581058        //Dn /=vcontent(Dn,Variable(1));
Note: See TracChangeset for help on using the changeset viewer.