Changeset 76a7114 in git


Ignore:
Timestamp:
Jan 30, 2006, 10:06:18 AM (18 years ago)
Author:
Wilfred Pohl <pohl@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ae2e227aeba249ea683ac81f35b40451d859514e
Parents:
a725daea0d4b710813033cd5906ef1c1f3437cd3
Message:
without OPTIMALVAR


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

Legend:

Unmodified
Added
Removed
  • factory/fac_ezgcd.cc

    ra725dae r76a7114  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: fac_ezgcd.cc,v 1.25 2005-12-16 11:21:30 Singular Exp $ */
     2/* $Id: fac_ezgcd.cc,v 1.26 2006-01-30 09:06:18 pohl Exp $ */
    33
    44#include <config.h>
     
    1717#include "ftmpl_functions.h"
    1818
    19 //#define OPTIMALVAR 1
    20 
    2119static void findeval( const CanonicalForm & F, const CanonicalForm & G, CanonicalForm & Fb, CanonicalForm & Gb, CanonicalForm & Db, REvaluation & b, int delta, int degF, int degG );
    2220
     
    2927static modpk enlargeBound ( const CanonicalForm & F, const CanonicalForm & Lb, const CanonicalForm & Db, const modpk & pk );
    3028
    31 #ifdef OPTIMALVAR
    32 static Variable ezgcd_getOptimalVar( const CanonicalForm & FF, const CanonicalForm & GG );
    33 
    34 
    35 CanonicalForm ezgcd( const CanonicalForm & FF, const CanonicalForm & GG )
    36 {
    37   CanonicalForm F,G;
    38   REvaluation b;
    39   Variable Z=ezgcd_getOptimalVar(FF,GG);
    40 //Test:  return Z;
    41   if(Z==Variable(1))
    42      return ezgcd( FF, GG, b, false );
    43   F=swapvar(FF,Z,Variable(1));
    44   G=swapvar(GG,Z,Variable(1));
    45   return swapvar(ezgcd( F, G, b, false ),Z,Variable(1));
    46 }
    47 #else
    4829CanonicalForm
    4930ezgcd ( const CanonicalForm & FF, const CanonicalForm & GG )
     
    5233    return ezgcd( FF, GG, b, false );
    5334}
    54 #endif
    5535
    5636static CanonicalForm
     
    390370    return modpk( p, i );
    391371}
    392 
    393 #ifdef OPTIMALVAR
    394 static Variable ezgcd_getOptimalVar( const CanonicalForm & FF, const CanonicalForm & GG )
    395 {
    396   int ii,tt,d,s,dd,so;
    397   CanonicalForm F,G;
    398   Variable opt=Variable(1);
    399   tt=FF.level();
    400   if(GG.level()<tt)
    401     tt=GG.level();
    402   if(tt<3 /*(FF.level()<3)||(GG.level()<3)*/)
    403     return opt;
    404   REvaluation bz=REvaluation(2,tmax(FF.level(),GG.level()),IntRandom(1));
    405   CanonicalForm Fbz=bz(FF);
    406   CanonicalForm Gbz=bz(GG);
    407   CanonicalForm Dbz0=gcd(Fbz,Gbz);
    408   dd=degree(Dbz0);
    409   so=-1;
    410   for(ii=2;ii<=tt;ii++)
    411   {
    412     //bz.nextpoint();
    413     F=swapvar(FF,Variable(ii),Variable(1));
    414     G=swapvar(GG,Variable(ii),Variable(1));
    415     Fbz=bz(F);
    416     Gbz=bz(G);
    417     CanonicalForm Dbz=gcd(Fbz,Gbz);
    418     d=degree(Dbz);
    419     if(d==dd)
    420     {
    421       s=size(Dbz);
    422       if (so==-1)
    423       {
    424         so=size(Dbz0);
    425       }
    426       if(s>so)
    427       {
    428         so=s;
    429         opt=Variable(ii);
    430         Dbz0=Dbz;
    431       }
    432     }
    433     else if(d>dd)
    434     {
    435       dd=d;
    436       so=-1;
    437       opt=Variable(ii);
    438       Dbz0=Dbz;
    439     }
    440   }
    441   return opt;
    442 }
    443 #endif
Note: See TracChangeset for help on using the changeset viewer.