Changeset 4553b1 in git for factory


Ignore:
Timestamp:
Apr 19, 2013, 3:56:48 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
809d634e3370e14c61f7b1ee234231400c570c0f
Parents:
f7ed7dc2ce876bee21478ae1bf88e2734992bcd8
git-author:
Martin Lee <martinlee84@web.de>2013-04-19 15:56:48+02:00
git-committer:
Martin Lee <martinlee84@web.de>2013-05-02 11:42:39+02:00
Message:
fix: univariate abs. factorization
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facAbsFact.h

    rf7ed7d r4553b1  
    3737  CFFListIterator i= rationalFactors;
    3838  i++;
    39   CanonicalForm mipo;
     39  Variable alpha;
    4040  CFAFList result;
     41  CFFList QaFactors;
     42  CFFListIterator iter;
    4143  for (; i.hasItem(); i++)
    4244  {
    43     mipo= rootOf (i.getItem().factor());
    44     result.append (CFAFactor (i.getItem().factor(), mipo, i.getItem().exp()));
     45    if (degree (i.getItem().factor()) == 1)
     46    {
     47      alpha= rootOf (Variable (1));
     48      result.append (CFAFactor (i.getItem().factor(), getMipo (alpha),
     49                                i.getItem().exp()));
     50      continue;
     51    }
     52    alpha= rootOf (i.getItem().factor());
     53    QaFactors= factorize (i.getItem().factor(), alpha);
     54    iter= QaFactors;
     55    if (iter.getItem().factor().inCoeffDomain())
     56      iter++;
     57    for (;iter.hasItem(); iter++)
     58    {
     59      if (degree (iter.getItem().factor()) == 1)
     60      {
     61        result.append (CFAFactor (iter.getItem().factor(), getMipo (alpha),
     62                                  i.getItem().exp()));
     63        break;
     64      }
     65    }
    4566  }
    4667  result.insert (CFAFactor (rationalFactors.getFirst().factor(), 1, 1));
     
    5879  //TODO handle homogeneous input
    5980  ASSERT (getNumVars (F) == 2, "expected bivariate input");
    60   ASSERT (getCharacteristic() == 0 && isOn (SW_RATIONAL), "expected poly over Q");
     81  ASSERT (getCharacteristic() == 0 && isOn (SW_RATIONAL),
     82          "expected poly over Q");
    6183
    6284  CFMap N;
     
    6486  bool isRat= isOn (SW_RATIONAL);
    6587  if (isRat)
    66   {
    6788    F *= bCommonDen (F);
    68     Off (SW_RATIONAL);
    69   }
     89
     90  Off (SW_RATIONAL);
    7091  F /= icontent (F);
    7192  if (isRat)
     
    112133  }
    113134
    114 
    115135  for (CFAFListIterator i= result; i.hasItem(); i++)
    116136    i.getItem()= CFAFactor (N (i.getItem().factor()), i.getItem().minpoly(),
     
    124144  normalize (result);
    125145  result.insert (CFAFactor (Lc(G), 1, 1));
     146
    126147  return result;
    127148}
Note: See TracChangeset for help on using the changeset viewer.