GiNaC 1.8.10
normal.h
Go to the documentation of this file.
1
8/*
9 * GiNaC Copyright (C) 1999-2026 Johannes Gutenberg University Mainz, Germany
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 */
24
25#ifndef GINAC_NORMAL_H
26#define GINAC_NORMAL_H
27
28#include "lst.h"
29
30namespace GiNaC {
31
36{
37 enum {
60 use_sr_gcd = 8
61
62 };
63};
64
65class ex;
66class symbol;
67
68// Quotient q(x) of polynomials a(x) and b(x) in Q[x], so that a(x)=b(x)*q(x)+r(x)
69extern ex quo(const ex &a, const ex &b, const ex &x, bool check_args = true);
70
71// Remainder r(x) of polynomials a(x) and b(x) in Q[x], so that a(x)=b(x)*q(x)+r(x)
72extern ex rem(const ex &a, const ex &b, const ex &x, bool check_args = true);
73
74// Decompose rational function a(x)=N(x)/D(x) into Q(x)+R(x)/D(x) with degree(R, x) < degree(D, x)
75extern ex decomp_rational(const ex &a, const ex &x);
76
77// Pseudo-remainder of polynomials a(x) and b(x) in Q[x]
78extern ex prem(const ex &a, const ex &b, const ex &x, bool check_args = true);
79
80// Pseudo-remainder of polynomials a(x) and b(x) in Q[x]
81extern ex sprem(const ex &a, const ex &b, const ex &x, bool check_args = true);
82
83// Exact polynomial division of a(X) by b(X) in Q[X] (quotient returned in q), returns false when exact division fails
84extern bool divide(const ex &a, const ex &b, ex &q, bool check_args = true);
85
86// Polynomial GCD in Z[X], cofactors are returned in ca and cb, if desired
87extern ex gcd(const ex &a, const ex &b, ex *ca = nullptr, ex *cb = nullptr,
88 bool check_args = true, unsigned options = 0);
89
90// Polynomial LCM in Z[X]
91extern ex lcm(const ex &a, const ex &b, bool check_args = true);
92
93// Square-free factorization of a polynomial a(x)
94extern ex sqrfree(const ex &a, const lst &l = lst());
95
96// Square-free partial fraction decomposition of a rational function a(x)
97extern ex sqrfree_parfrac(const ex & a, const symbol & x);
98
99// Collect common factors in sums.
100extern ex collect_common_factors(const ex & e);
101
102// Resultant of two polynomials e1,e2 with respect to symbol s.
103extern ex resultant(const ex & e1, const ex & e2, const ex & s);
104
105} // namespace GiNaC
106
107#endif // ndef GINAC_NORMAL_H
unsigned options
Definition factor.cpp:2473
ex x
Definition factor.cpp:1609
Definition of GiNaC's lst.
Definition add.cpp:35
container< std::list > lst
Definition lst.h:31
ex sqrfree(const ex &a, const lst &l)
Compute a square-free factorization of a multivariate polynomial in Q[X].
Definition normal.cpp:1888
ex resultant(const ex &e1, const ex &e2, const ex &s)
Resultant of two expressions e1,e2 with respect to symbol s.
Definition normal.cpp:2877
ex 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].
Definition normal.cpp:1432
ex 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].
Definition normal.cpp:491
ex 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].
Definition normal.cpp:372
ex sqrfree_parfrac(const ex &a, const symbol &x)
Compute square-free partial fraction decomposition of rational function a(x).
Definition normal.cpp:1947
ex lcm(const ex &a, const ex &b, bool check_args)
Compute LCM (Least Common Multiple) of multivariate polynomials in Z[X].
Definition normal.cpp:1774
ex 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,...
Definition normal.cpp:471
ex collect_common_factors(const ex &e)
Collect common factors in sums.
Definition normal.cpp:2861
ex 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].
Definition normal.cpp:422
ex 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].
Definition normal.cpp:543
bool divide(const ex &a, const ex &b, ex &q, bool check_args)
Exact polynomial division of a(X) by b(X) in Q[X].
Definition normal.cpp:594
Flags to control the behavior of gcd() and friends.
Definition normal.h:36
@ use_sr_gcd
By default GiNaC uses modular GCD algorithm.
Definition normal.h:60
@ no_part_factored
GiNaC tries to avoid expanding expressions when computing GCDs.
Definition normal.h:54
@ no_heur_gcd
Usually GiNaC tries heuristic GCD first, because typically it's much faster than anything else.
Definition normal.h:46

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