Changeset 9b25e7e in git for libfac/charset/alg_factor.cc


Ignore:
Timestamp:
Oct 24, 2002, 7:22:22 PM (21 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
616214197b0dbd8973606076355c2d6ccde48f2f
Parents:
e44bd88b22a2439b301aba30f2adc6bb930bbefc
Message:
* hannes: factoring in alg.ext., alg_gcd, NTL stuff


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

Legend:

Unmodified
Added
Removed
  • libfac/charset/alg_factor.cc

    re44bd88 r9b25e7e  
    33// emacs edit mode for this file is -*- C++ -*-
    44////////////////////////////////////////////////////////////
    5 static char * rcsid = "$Id: alg_factor.cc,v 1.10 2002-08-19 11:11:29 Singular Exp $";
     5static char * rcsid = "$Id: alg_factor.cc,v 1.11 2002-10-24 17:22:21 Singular Exp $";
    66////////////////////////////////////////////////////////////
    77// FACTORY - Includes
     
    2020#include "alg_factor.h"
    2121
    22 //void out_cf(char *s1,const CanonicalForm &f,char *s2);
     22void out_cf(char *s1,const CanonicalForm &f,char *s2);
    2323
    2424#ifdef ALGFACTORDEBUG
     
    198198      Variable X;
    199199      if (getAlgVar(R,X))
    200       { 
     200      {
    201201        if (R.isUnivariate())
    202           testlist=factorize( R, X );
    203         else 
     202          testlist=factorize( R, X );
     203        else
    204204          testlist= Factorize(R, X, 0);
    205205      }
    206       else 
     206      else
    207207        testlist= Factorize(R);
    208208      DEBOUTLN(cout, "testlist= ", testlist);
     
    369369    return alg_lc(f.LC());
    370370  }
    371 } 
     371}
    372372
    373373// the heart of the algorithm: the one from Trager
     
    400400//cout << "alg: "<< X << " mipo=" << getMipo(X,Variable('X')) <<endl;
    401401    if (R.isUnivariate())
     402    {
     403      DEBOUTLN(cout, "alg_factor: factorize( ", R);
    402404      Factorlist =  factorize( R, X );
     405    }
    403406    else
    404407    {
     
    407410      CanonicalForm mipo=getMipo(X,XX);
    408411      CFList as(mipo);
     412      DEBOUTLN(cout, "alg_factor: newfactoras( ", R);
    409413      Factorlist = newfactoras(R, as , 1);
    410414      #else
    411415      // factor R over k
     416      DEBOUTLN(cout, "alg_factor: Factorize( ", R);
    412417      Factorlist = Factorize(R);
    413418      #endif
     
    417422  {
    418423    // factor R over k
     424    DEBOUTLN(cout, "alg_factor: Factorize( ", R);
    419425    Factorlist = Factorize(R);
    420426  }
     
    444450        // undo linear transformation!!!! and then gcd!
    445451        //cout << "algcd(" << g << "," << fnew << ",as" << as << ")" << endl;
    446         //out_cf("algcd g=",g,"\n");
    447         //out_cf("algcd fnew=",fnew,"\n");
     452        //out_cf("algcd g=",g,"\n");
     453        //out_cf("algcd fnew=",fnew,"\n");
    448454        //h= algcd(g,fnew, as, oldord);
    449         //if (as.length() >1)
     455        //if (as.length() >1)
    450456        //  h= algcd(g,fnew, as, oldord);
    451         //else
    452           h=alg_gcd(g,fnew,as);
    453         //out_cf(" -> algcd=",algcd(g,fnew, as, oldord),"\n");
    454         //out_cf(" -> alg_gcd=",alg_gcd(g,fnew,as),"\n");
     457        //else
     458          h=alg_gcd(g,fnew,as);
     459        //out_cf(" -> algcd=",algcd(g,fnew, as, oldord),"\n");
     460        //out_cf(" -> alg_gcd=",alg_gcd(g,fnew,as),"\n");
    455461        //cout << "algcd result:" << h << endl;
    456462        DEBOUTLN(cout, "  alg_factor: h= ", h);
     
    647653  //CanonicalForm Fgcd= algcd(f,f.deriv(),Astar,gcdord);
    648654  CanonicalForm Fgcd;
    649         //if (Astar.length() >1)
     655        //if (Astar.length() >1)
    650656        //  Fgcd= algcd(f,f.deriv(),Astar,gcdord);
    651         //else
    652           Fgcd= alg_gcd(f,f.deriv(),Astar);
    653         //out_cf("algcd:",algcd(f,f.deriv(),Astar,gcdord),"\n");
    654         //out_cf("alg_gcd:",alg_gcd(f,f.deriv(),Astar),"\n");
     657        //else
     658          Fgcd= alg_gcd(f,f.deriv(),Astar);
     659        //out_cf("algcd:",algcd(f,f.deriv(),Astar,gcdord),"\n");
     660        //out_cf("alg_gcd:",alg_gcd(f,f.deriv(),Astar),"\n");
    655661 // cout << "algcd result:"  << Fgcd << endl;
    656662  if ( Fgcd == 0 ) DEBOUTMSG(cerr, "WARNING: p'th root ?");
     
    738744/*
    739745$Log: not supported by cvs2svn $
     746Revision 1.10  2002/08/19 11:11:29  Singular
     747* hannes/pfister: alg_gcd etc.
     748
    740749Revision 1.9  2002/07/30 15:16:19  Singular
    741750*hannes: fix for alg. extension
Note: See TracChangeset for help on using the changeset viewer.