Changeset 6e12a45 in git for factory/cf_factor.cc


Ignore:
Timestamp:
Jun 17, 2020, 6:16:48 PM (4 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
Children:
cac0f8a0c0c0b22b71b76c3b44841f5cc1fec229
Parents:
ed6f2bb0876535189130e32d71be46f776012a36
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2020-06-17 18:16:48+02:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2020-06-17 18:17:49+02:00
Message:
univariate factorization over Z via FLINT
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_factor.cc

    red6f2b r6e12a45  
    536536    }
    537537  }
    538   else
     538  else // char 0
    539539  {
    540540    bool on_rational = isOn(SW_RATIONAL);
     
    575575        }
    576576      }
    577       #else
    578       factoryError ("univariate factorization over Z depends on NTL(missing)");
     577      if(isOn(SW_USE_NTL_SORT)) F.sort(cmpCF);
     578      return F;
     579      #endif
     580      #if defined(HAVE_FLINT) && (__FLINT_RELEASE>=20504)
     581      // use FLINT
     582      fmpz_poly_t f1;
     583      convertFacCF2Fmpz_poly_t (f1, f);
     584      fmpz_poly_factor_t result;
     585      fmpz_poly_factor_init (result);
     586      fmpz_poly_factor_zassenhaus(result, f1);
     587      F= convertFLINTfmpz_poly_factor2FacCFFList (result, f.mvar());
     588      fmpz_poly_factor_clear (result);
     589      fmpz_poly_clear (f1);
     590      if(isOn(SW_USE_NTL_SORT)) F.sort(cmpCF);
     591      return F;
     592      #endif
     593      #if !defined(AHE_NTL) && !defined(HAVE_FLINT)
     594      factoryError ("univariate factorization over Z depends on NTL/FLINT(missing)");
    579595      return CFFList (CFFactor (f, 1));
    580596      #endif
    581597    }
    582     else
     598    else // not univariate,  char 0
    583599    {
    584600      On (SW_RATIONAL);
     
    586602      {
    587603        CFList factors;
     604        #ifdef HAVE_NTL
    588605        factors= ratSqrfFactorize (fz);
    589606        for (CFListIterator i= factors; i.hasItem(); i++)
    590607          F.append (CFFactor (i.getItem(), 1));
     608        #else
     609        factoryError ("multivariate factorization over Z depends on NTL(missing)");
     610        return CFFList (CFFactor (f, 1));
     611        #endif
    591612      }
    592613      else
Note: See TracChangeset for help on using the changeset viewer.