Changeset 10697c in git for libfac/factor


Ignore:
Timestamp:
May 15, 2007, 5:50:42 PM (17 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
1591a873ae939d12cc28f2fbb1408a9e8fdad9b8
Parents:
38e7b3ea67100d6b56716b967237bef70ac6adce
Message:
*hannes: Factorize2


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

Legend:

Unmodified
Added
Removed
  • libfac/factor/Factor.cc

    r38e7b3 r10697c  
    11/* Copyright 1996 Michael Messollen. All rights reserved. */
    22///////////////////////////////////////////////////////////////////////////////
    3 static char * rcsid = "$Id: Factor.cc,v 1.24 2007-05-15 14:46:48 Singular Exp $ ";
     3static char * rcsid = "$Id: Factor.cc,v 1.25 2007-05-15 15:50:42 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///////////////////////////////////////////////////////////////////////////////
     
    993993//           * ensuring poly is sqrfree (n.y.i.)             //
    994994///////////////////////////////////////////////////////////////
     995CFFList Factorize2(const CanonicalForm & F, const CanonicalForm & minpoly )
     996{
     997  CFFList iF=Factorize(F);
     998  CFFList G,H;
     999  CanonicalForm fac;
     1000  int d;
     1001  ListIterator<CFFactor> i,k;
     1002  for ( i = iF; i.hasItem(); ++i )
     1003  {
     1004    d = i.getItem().exp();
     1005    fac = i.getItem().factor();
     1006    G = Factorize( fac, minpoly);
     1007    for ( k = G; k.hasItem(); ++k )
     1008    {
     1009      fac = k.getItem().factor();
     1010      int dd = k.getItem().exp();
     1011      H.append( CFFactor( fac , d*dd ) );
     1012    }
     1013  }
     1014  //Outputlist = newfactoras( F, as, 1);
     1015  return H;
     1016}
    9951017CFFList
    9961018Factorize(const CanonicalForm & F, const CanonicalForm & minpoly, int is_SqrFree )
     
    10701092  ///////
    10711093  //  if ( ! SqrFreeTest(F) ){
    1072   if ( ! is_SqrFree ){
     1094  if ( ! is_SqrFree )
     1095  {
    10731096    TIMING_START(sqrfree_time);
    10741097    SqrFreeList = InternalSqrFree(F, minpoly) ; // first sqrfree the polynomial
     
    10861109    SqrFreeList.append(CFFactor(F,1));
    10871110  DEBOUTLN(CERR, "InternalSqrFreeList= ", SqrFreeList);
    1088   for ( i=SqrFreeList; i.hasItem(); i++ ){
     1111  for ( i=SqrFreeList; i.hasItem(); i++ )
     1112  {
    10891113    DEBOUTLN(CERR, "Factor under consideration: ", i.getItem().factor());
    10901114    // We need a compress on each list item ! Maybe we have less variables!
     
    10941118      Outputlist.append( CFFactor(g,1) ) ;
    10951119    else// a real polynomial
    1096       if ( g.isUnivariate() ){
     1120      if ( g.isUnivariate() )
     1121      {
    10971122        Variable alpha=rootOf(minpoly);
    10981123        Intermediatelist=factorize2(g,alpha,minpoly); // poly is sqr-free!
     
    11031128             exp*j.getItem().exp()));
    11041129      }
    1105       else{ // multivariate polynomial
    1106         if ( g.isHomogeneous() ){
     1130      else // multivariate polynomial
     1131      {
     1132        if ( g.isHomogeneous() )
     1133        {
    11071134          DEBOUTLN(CERR, "Poly is homogeneous! : ", g);
    11081135          // Now we can substitute one variable to 1, factorize and then
     
    11681195/*
    11691196$Log: not supported by cvs2svn $
     1197Revision 1.24  2007/05/15 14:46:48  Singular
     1198*hannes: factorize in Zp(a)[x...]
     1199
    11701200Revision 1.23  2006/05/16 14:46:49  Singular
    11711201*hannes: gcc 4.1 fixes
Note: See TracChangeset for help on using the changeset viewer.