Changeset 13be01 in git for factory


Ignore:
Timestamp:
Jul 3, 2008, 12:02:17 PM (16 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
Children:
84acfb6c0595b6d484ac13d1c4749d9828283c0e
Parents:
cf315c3c3d6ea2b0b48d53abb5830ae445c6e822
Message:
*hannes: fieldGCD -> gcd in recursion


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

Legend:

Unmodified
Added
Removed
  • factory/fieldGCD.cc

    rcf315c r13be01  
    1313#include "cf_generator.h"
    1414
     15void out_cf(char *s1,const CanonicalForm &f,char *s2);
     16
     17
    1518CanonicalForm fieldGCD( const CanonicalForm & F, const CanonicalForm & G );
    1619void CRA(const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew);
     
    2427{// this is the modular method by Brown
    2528 // assume F,G are multivariate polys over Z/p for big prime p
    26  if(F.isZero())
     29  if(F.isZero())
    2730  {
    2831    if(G.isZero())
     
    4043  if(F.inCoeffDomain() || G.inCoeffDomain())
    4144    return CanonicalForm(1);
     45  //out_cf("F=",F,"\n");
     46  //out_cf("G=",G,"\n");
    4247  CFMap MM,NN;
    4348  CFArray ps(1,2);
     
    6267  g/=cg;
    6368  if(f.inCoeffDomain() || g.inCoeffDomain())
     69  {
     70    //printf("=============== inCoeffDomain\n");
    6471    return NN(c);
     72  }
    6573  int *L = new int[mv+1]; // L is addressed by i from 2 to mv
    6674  int *M = new int[mv+1];
     
    8795    if(gamma_image.isZero()) // skip lc-bad points var(1)-alpha
    8896      continue;
    89     g_image = fieldGCD( f(alpha, Variable(1)), g(alpha, Variable(1)) ); // recursive call with one var less
     97    g_image = gcd( f(alpha, Variable(1)), g(alpha, Variable(1)) ); // recursive call with one var less
    9098    if(g_image.inCoeffDomain()) // early termination
     99    {
     100      //printf("================== inCoeffDomain\n");
    91101      return NN(c);
     102    }
    92103    for(int i=2; i<=mv; i++)
    93104      dg_im[i] = 0; // reset (this is necessary, because some entries may not be updated by call to leadDeg)
     
    105116      {
    106117        g_image = gm / vcontent(gm, Variable(2));
     118        //out_cf("=========== try ",g_image,"\n");
    107119        if(fdivides(g_image,f) && fdivides(g_image,g)) // trial division
     120        {
     121          //printf("=========== okay\n");
    108122          return NN(c*g_image);
     123        }
    109124      }
    110125      gm = gnew;
     
    117132    if(isLess(dg_im, L, 2, mv)) // dg_im < L --> all previous points were unlucky
    118133    {
     134      //printf("=========== reset\n");
    119135      m = CanonicalForm(1); // reset
    120136      gm = 0; // reset
Note: See TracChangeset for help on using the changeset viewer.