GiNaC 1.8.7
Classes | Namespaces | Macros | Typedefs | Functions
normal.cpp File Reference

This file implements several functions that work on univariate and multivariate polynomials and rational functions. More...

#include "normal.h"
#include "basic.h"
#include "ex.h"
#include "add.h"
#include "constant.h"
#include "expairseq.h"
#include "fail.h"
#include "inifcns.h"
#include "lst.h"
#include "mul.h"
#include "numeric.h"
#include "power.h"
#include "relational.h"
#include "operators.h"
#include "matrix.h"
#include "pseries.h"
#include "symbol.h"
#include "utils.h"
#include "polynomial/chinrem_gcd.h"
#include <algorithm>
#include <map>

Go to the source code of this file.

Classes

struct  GiNaC::sym_desc
 This structure holds information about the highest and lowest degrees in which a symbol appears in two multivariate polynomials "a" and "b". More...
 
class  GiNaC::gcdheu_failed
 Exception thrown by heur_gcd() to signal failure. More...
 
struct  GiNaC::normal_map_function
 Function object to be applied by basic::normal(). More...
 

Namespaces

namespace  GiNaC
 

Macros

#define FAST_COMPARE   1
 
#define USE_REMEMBER   0
 
#define USE_TRIAL_DIVISION   0
 
#define STATISTICS   0
 

Typedefs

typedef std::vector< sym_desc > GiNaC::sym_desc_vec
 

Functions

static bool GiNaC::get_first_symbol (const ex &e, ex &x)
 Return pointer to first symbol found in expression. More...
 
static void GiNaC::add_symbol (const ex &s, sym_desc_vec &v)
 
static void GiNaC::collect_symbols (const ex &e, sym_desc_vec &v)
 
static void GiNaC::get_symbol_stats (const ex &a, const ex &b, sym_desc_vec &v)
 Collect statistical information about symbols in polynomials. More...
 
static numeric GiNaC::lcmcoeff (const ex &e, const numeric &l)
 
static numeric GiNaC::lcm_of_coefficients_denominators (const ex &e)
 Compute LCM of denominators of coefficients of a polynomial. More...
 
static ex GiNaC::multiply_lcm (const ex &e, const numeric &lcm)
 Bring polynomial from Q[X] to Z[X] by multiplying in the previously determined LCM of the coefficient's denominators. More...
 
ex GiNaC::quo (const ex &a, const ex &b, const ex &x, bool check_args)
 Quotient q(x) of polynomials a(x) and b(x) in Q[x]. More...
 
ex GiNaC::rem (const ex &a, const ex &b, const ex &x, bool check_args)
 Remainder r(x) of polynomials a(x) and b(x) in Q[x]. More...
 
ex GiNaC::decomp_rational (const ex &a, const ex &x)
 Decompose rational function a(x)=N(x)/D(x) into P(x)+n(x)/D(x) with degree(n, x) < degree(D, x). More...
 
ex GiNaC::prem (const ex &a, const ex &b, const ex &x, bool check_args)
 Pseudo-remainder of polynomials a(x) and b(x) in Q[x]. More...
 
ex GiNaC::sprem (const ex &a, const ex &b, const ex &x, bool check_args)
 Sparse pseudo-remainder of polynomials a(x) and b(x) in Q[x]. More...
 
bool GiNaC::divide (const ex &a, const ex &b, ex &q, bool check_args)
 Exact polynomial division of a(X) by b(X) in Q[X]. More...
 
static bool GiNaC::divide_in_z (const ex &a, const ex &b, ex &q, sym_desc_vec::const_iterator var)
 Exact polynomial division of a(X) by b(X) in Z[X]. More...
 
static ex GiNaC::sr_gcd (const ex &a, const ex &b, sym_desc_vec::const_iterator var)
 Compute GCD of multivariate polynomials using the subresultant PRS algorithm. More...
 
static ex GiNaC::interpolate (const ex &gamma, const numeric &xi, const ex &x, int degree_hint=1)
 xi-adic polynomial interpolation More...
 
static bool GiNaC::heur_gcd_z (ex &res, const ex &a, const ex &b, ex *ca, ex *cb, sym_desc_vec::const_iterator var)
 Compute GCD of multivariate polynomials using the heuristic GCD algorithm. More...
 
static bool GiNaC::heur_gcd (ex &res, const ex &a, const ex &b, ex *ca, ex *cb, sym_desc_vec::const_iterator var)
 Compute GCD of multivariate polynomials using the heuristic GCD algorithm. More...
 
static ex GiNaC::gcd_pf_pow (const ex &a, const ex &b, ex *ca, ex *cb)
 
static ex GiNaC::gcd_pf_mul (const ex &a, const ex &b, ex *ca, ex *cb)
 
ex GiNaC::gcd (const ex &a, const ex &b, ex *ca, ex *cb, bool check_args, unsigned options)
 Compute GCD (Greatest Common Divisor) of multivariate polynomials a(X) and b(X) in Z[X]. More...
 
static ex GiNaC::gcd_pf_pow_pow (const ex &a, const ex &b, ex *ca, ex *cb)
 
ex GiNaC::lcm (const ex &a, const ex &b, bool check_args)
 Compute LCM (Least Common Multiple) of multivariate polynomials in Z[X]. More...
 
static epvector GiNaC::sqrfree_yun (const ex &a, const symbol &x)
 Compute square-free factorization of multivariate polynomial a(x) using Yun's algorithm. More...
 
ex GiNaC::sqrfree (const ex &a, const lst &l)
 Compute a square-free factorization of a multivariate polynomial in Q[X]. More...
 
ex GiNaC::sqrfree_parfrac (const ex &a, const symbol &x)
 Compute square-free partial fraction decomposition of rational function a(x). More...
 
static ex GiNaC::replace_with_symbol (const ex &e, exmap &repl, exmap &rev_lookup, lst &modifier)
 Create a symbol for replacing the expression "e" (or return a previously assigned symbol). More...
 
static ex GiNaC::replace_with_symbol (const ex &e, exmap &repl)
 Create a symbol for replacing the expression "e" (or return a previously assigned symbol). More...
 
static ex GiNaC::frac_cancel (const ex &n, const ex &d)
 Fraction cancellation. More...
 
static ex GiNaC::find_common_factor (const ex &e, ex &factor, exmap &repl)
 Remove the common factor in the terms of a sum 'e' by calculating the GCD, and multiply it into the expression 'factor' (which needs to be initialized to 1, unless you're accumulating factors). More...
 
ex GiNaC::collect_common_factors (const ex &e)
 Collect common factors in sums. More...
 
ex GiNaC::resultant (const ex &e1, const ex &e2, const ex &s)
 Resultant of two expressions e1,e2 with respect to symbol s. More...
 

Detailed Description

This file implements several functions that work on univariate and multivariate polynomials and rational functions.

These functions include polynomial quotient and remainder, GCD and LCM computation, square-free factorization and rational function normalization.

Definition in file normal.cpp.

Macro Definition Documentation

◆ FAST_COMPARE

#define FAST_COMPARE   1

Definition at line 54 of file normal.cpp.

◆ USE_REMEMBER

#define USE_REMEMBER   0

Definition at line 57 of file normal.cpp.

◆ USE_TRIAL_DIVISION

#define USE_TRIAL_DIVISION   0

Definition at line 62 of file normal.cpp.

◆ STATISTICS

#define STATISTICS   0

Definition at line 65 of file normal.cpp.


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