GiNaC 1.8.7
factor.cpp File Reference

Polynomial factorization (implementation). More...

#include "factor.h"
#include "ex.h"
#include "numeric.h"
#include "operators.h"
#include "inifcns.h"
#include "symbol.h"
#include "relational.h"
#include "power.h"
#include "mul.h"
#include "normal.h"
#include "add.h"
#include <type_traits>
#include <algorithm>
#include <limits>
#include <list>
#include <vector>
#include <stack>
#include <cln/cln.h>

Go to the source code of this file.

Namespaces

namespace  GiNaC

Macros

#define DCOUT(str)
#define DCOUTVAR(var)
#define DCOUT2(str, var)
#define USE_SAME_DEGREE_FACTOR

Functions

ex GiNaC::factor (const ex &poly, unsigned options)
 Interface function to the outside world.

Detailed Description

Polynomial factorization (implementation).

The interface function factor() at the end of this file is defined in the GiNaC namespace. All other utility functions and classes are defined in an additional anonymous namespace.

Factorization starts by doing a square free factorization and making the coefficients integer. Then, depending on the number of free variables it proceeds either in dedicated univariate or multivariate factorization code.

Univariate factorization does a modular factorization via Berlekamp's algorithm and distinct degree factorization. Hensel lifting is used at the end.

Multivariate factorization uses the univariate factorization (applying a evaluation homomorphism first) and Hensel lifting raises the answer to the multivariate domain. The Hensel lifting code is completely distinct from the code used by the univariate factorization.

Algorithms used can be found in [Wan] An Improved Multivariate Polynomial Factoring Algorithm, P.S.Wang, Mathematics of Computation, Vol. 32, No. 144 (1978) 1215–1231. [GCL] Algorithms for Computer Algebra, K.O.Geddes, S.R.Czapor, G.Labahn, Springer Verlag, 1992. [Mig] Some Useful Bounds, M.Mignotte, In "Computer Algebra, Symbolic and Algebraic Computation" (B.Buchberger et al., eds.), pp. 259-263, Springer-Verlag, New York, 1982.

Definition in file factor.cpp.

Macro Definition Documentation

◆ DCOUT

#define DCOUT ( str)

Definition at line 135 of file factor.cpp.

◆ DCOUTVAR

#define DCOUTVAR ( var)

Definition at line 136 of file factor.cpp.

◆ DCOUT2

#define DCOUT2 ( str,
var )

Definition at line 137 of file factor.cpp.

◆ USE_SAME_DEGREE_FACTOR

#define USE_SAME_DEGREE_FACTOR

Definition at line 1096 of file factor.cpp.


This page is part of the GiNaC developer's reference. It was generated automatically by doxygen. For an introduction, see the tutorial.