Changeset 6e12a45 in git


Ignore:
Timestamp:
Jun 17, 2020, 6:16:48 PM (4 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '0bc2210f8055033868008a3836878db65ec6f89e')
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
Location:
factory
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • factory/FLINTconvert.cc

    red6f2b r6e12a45  
    291291  return result;
    292292}
     293
     294#if __FLINT_RELEASE >= 20503
     295CFFList
     296convertFLINTfmpz_poly_factor2FacCFFList (
     297                   const fmpz_poly_factor_t fac, ///< [in] a nmod_poly_factor_t
     298                   const Variable& x       ///< [in] variable the result should
     299                                           ///< have
     300                                        )
     301
     302{
     303  CFFList result;
     304  long i;
     305
     306  for (i = 0; i < fac->num; i++)
     307    result.append (CFFactor (convertFmpz_poly_t2FacCF (
     308                             (fmpz_poly_t &)fac->p[i],x),
     309                             fac->exp[i]));
     310  return result;
     311}
     312#endif
    293313
    294314#if __FLINT_RELEASE >= 20400
  • factory/FLINTconvert.h

    red6f2b r6e12a45  
    120120                                        );
    121121
     122/// conversion of a FLINT factorization over Z to a CFFList
     123CFFList
     124convertFLINTfmpz_poly_factor2FacCFFList (
     125                   const fmpz_poly_factor_t fac, ///< [in] a fmpz_poly_factor_t
     126                   const Variable& x       ///< [in] variable the result should
     127                                           ///< have
     128                                        );
     129
    122130/// conversion of a factory univariate poly over Z to a FLINT poly over
    123131/// Z/p (for non word size p)
  • 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.