Namespaces | Defines | Functions

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 <algorithm>
#include <cmath>
#include <limits>
#include <list>
#include <vector>
#include <cln/cln.h>

Go to the source code of this file.

Namespaces

namespace  GiNaC
 

CRC32 hash function.


Defines

#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.


Define Documentation

#define DCOUT (   str  ) 

Definition at line 130 of file factor.cpp.

#define DCOUTVAR (   var  ) 

Definition at line 131 of file factor.cpp.

#define DCOUT2 (   str,
  var 
)

Definition at line 132 of file factor.cpp.

#define USE_SAME_DEGREE_FACTOR

Definition at line 1118 of file factor.cpp.


Variable Documentation

const bool value = false [static]

Definition at line 230 of file factor.cpp.

Referenced by GiNaC::GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(), and GiNaC::matrix::set().

size_t r
size_t c
mvec m
umodpoly lr[2]

Definition at line 1471 of file factor.cpp.

vector< vector<umodpoly> > cache

Definition at line 1472 of file factor.cpp.

upvec factors

Definition at line 1473 of file factor.cpp.

Referenced by GiNaC::ncmul::count_factors(), and GiNaC::ncmul::eval().

umodpoly one

Definition at line 1474 of file factor.cpp.

size_t n
size_t len

Definition at line 1476 of file factor.cpp.

size_t last
vector<int> k
upoly poly

Definition at line 1486 of file factor.cpp.

Referenced by GiNaC::matrix::charpoly().

ex x
int evalpoint

Definition at line 1645 of file factor.cpp.

cl_modint_ring R

Definition at line 1827 of file factor.cpp.

exset syms

Definition at line 2452 of file factor.cpp.

unsigned options

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