Changeset fb4f62e in git for libfac


Ignore:
Timestamp:
May 28, 2003, 1:52:52 PM (21 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
1d0a65e915b1365133778207056d192650c400c7
Parents:
c4c47d46b439a8001801a504cdd936a60ebbf6de
Message:
*pfister/hannes: newfactoras, alg_gcd, divide (see bug_33)


git-svn-id: file:///usr/local/Singular/svn/trunk@6761 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
libfac
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libfac/charset/csutil.cc

    rc4c47d rfb4f62e  
    22////////////////////////////////////////////////////////////
    33// emacs edit mode for this file is -*- C++ -*-
    4 static char * rcsid = "$Id: csutil.cc,v 1.8 2002-10-24 17:22:22 Singular Exp $";
     4static char * rcsid = "$Id: csutil.cc,v 1.9 2003-05-28 11:52:52 Singular Exp $";
    55/////////////////////////////////////////////////////////////
    66// FACTORY - Includes
     
    205205  CanonicalForm r,m,q;
    206206
    207   r= Sprem(ff,f,m,q);
     207  //out_cf("divide f=",ff,"\n");
     208  //out_cf("divide g=",f,"\n");
     209  if (f.inCoeffDomain())
     210  {
     211    bool b=false;         
     212    if (!isOn(SW_RATIONAL)) { b=true;On(SW_RATIONAL); }
     213    q=ff/f;
     214    if (b) Off(SW_RATIONAL);
     215  } 
     216  else
     217    r= Sprem(ff,f,m,q); //result in q, ignore r,m
    208218  //cout << "r= " << r << "  , m= " << m << "  , q= " << q << endl;
    209219  r= Prem(q,as);
    210220  //cout << "r= " << r << endl;
     221  //out_cf(" ->",r,"\n");
    211222  return r;
    212223}
     
    762773  }
    763774
    764   f/=c_gcd;
    765   g/=c_gcd;
     775  //f/=c_gcd;
     776  //g/=c_gcd;
     777  if (!c_gcd.isOne())
     778  {       
     779    f=divide(f,c_gcd,as);
     780    g=divide(g,c_gcd,as);
     781  }
    766782
    767783  CFList gg;
     
    786802          i++;
    787803        } 
    788         f/=f_gcd; 
    789         return f*c_gcd;
     804        //out_cf("g=0 -> f:",f,"\n");
     805        //out_cf("f_gcd:",f_gcd,"\n");
     806        //out_cf("c_gcd:",c_gcd,"\n");
     807        //f/=f_gcd; 
     808        f=divide(f,f_gcd,as);
     809        //out_cf("f/f_gcd:",f,"\n");
     810        f*=c_gcd;
     811        //out_cf("f*c_gcd:",f,"\n");
     812        CanonicalForm r_lc=alg_lc(f);
     813        //out_cf("r_lc:",r_lc,"\n");
     814        //f/=r_lc;
     815        f=divide(f,r_lc,as);
     816        //out_cf(" -> gcd:",f,"\n");
     817        return f;
    790818      }
    791819      else { //printf("c\n");
     
    845873/*
    846874$Log: not supported by cvs2svn $
     875Revision 1.8  2002/10/24 17:22:22  Singular
     876* hannes: factoring in alg.ext., alg_gcd, NTL stuff
     877
    847878Revision 1.7  2002/08/19 11:11:31  Singular
    848879* hannes/pfister: alg_gcd etc.
  • libfac/factor.h

    rc4c47d rfb4f62e  
    2020CFFList Factorize( const CanonicalForm & F, const CanonicalForm & mipo, int is_SqrFree=0 ) ;
    2121CFFList newfactoras( const CanonicalForm & f, const CFList & as, int success);
     22CFFList factorize2 ( const CanonicalForm & f,
     23                     const Variable & alpha, const CanonicalForm & mipo );
     24
    2225
    2326//// Note: InternalSqrFree does only the work needed for factorization.
  • libfac/factor/Factor.cc

    rc4c47d rfb4f62e  
    11/* Copyright 1996 Michael Messollen. All rights reserved. */
    22///////////////////////////////////////////////////////////////////////////////
    3 static char * rcsid = "$Id: Factor.cc,v 1.15 2003-02-14 15:51:15 Singular Exp $ ";
     3static char * rcsid = "$Id: Factor.cc,v 1.16 2003-05-28 11:52:52 Singular Exp $ ";
    44static char * errmsg = "\nYou found a bug!\nPlease inform (Michael Messollen) michael@math.uni-sb.de \nPlease include above information and your input (the ideal/polynomial and characteristic) in your bug-report.\nThank you.";
    55///////////////////////////////////////////////////////////////////////////////
     
    5858{
    5959  if (alpha.level() <0)
    60     return factorize(f,alpha);
     60  {
     61    if (f.isUnivariate())
     62      return factorize(f,alpha);
     63    else
     64    {
     65      return Factorize(f,mipo);
     66    }
     67  } 
    6168  else
    6269  {
     
    10701077/*
    10711078$Log: not supported by cvs2svn $
     1079Revision 1.15  2003/02/14 15:51:15  Singular
     1080* hannes: bugfix
     1081          could not factorize x2+xy+y2 in Fp(a)[x,y], a2+a+1=0
     1082          (factorize2 does nor sanity checks)
     1083
    10721084Revision 1.14  2002/08/19 11:11:32  Singular
    10731085* hannes/pfister: alg_gcd etc.
Note: See TracChangeset for help on using the changeset viewer.