GiNaC 1.8.7
normal.h
Go to the documentation of this file.
1
8/*
9 * GiNaC Copyright (C) 1999-2023 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, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25
26#ifndef GINAC_NORMAL_H
27#define GINAC_NORMAL_H
28
29#include "lst.h"
30
31namespace GiNaC {
32
37{
38 enum {
61 use_sr_gcd = 8
62
63 };
64};
65
66class ex;
67class symbol;
68
69// Quotient q(x) of polynomials a(x) and b(x) in Q[x], so that a(x)=b(x)*q(x)+r(x)
70extern ex quo(const ex &a, const ex &b, const ex &x, bool check_args = true);
71
72// Remainder r(x) of polynomials a(x) and b(x) in Q[x], so that a(x)=b(x)*q(x)+r(x)
73extern ex rem(const ex &a, const ex &b, const ex &x, bool check_args = true);
74
75// Decompose rational function a(x)=N(x)/D(x) into Q(x)+R(x)/D(x) with degree(R, x) < degree(D, x)
76extern ex decomp_rational(const ex &a, const ex &x);
77
78// Pseudo-remainder of polynomials a(x) and b(x) in Q[x]
79extern ex prem(const ex &a, const ex &b, const ex &x, bool check_args = true);
80
81// Pseudo-remainder of polynomials a(x) and b(x) in Q[x]
82extern ex sprem(const ex &a, const ex &b, const ex &x, bool check_args = true);
83
84// Exact polynomial division of a(X) by b(X) in Q[X] (quotient returned in q), returns false when exact division fails
85extern bool divide(const ex &a, const ex &b, ex &q, bool check_args = true);
86
87// Polynomial GCD in Z[X], cofactors are returned in ca and cb, if desired
88extern ex gcd(const ex &a, const ex &b, ex *ca = nullptr, ex *cb = nullptr,
89 bool check_args = true, unsigned options = 0);
90
91// Polynomial LCM in Z[X]
92extern ex lcm(const ex &a, const ex &b, bool check_args = true);
93
94// Square-free factorization of a polynomial a(x)
95extern ex sqrfree(const ex &a, const lst &l = lst());
96
97// Square-free partial fraction decomposition of a rational function a(x)
98extern ex sqrfree_parfrac(const ex & a, const symbol & x);
99
100// Collect common factors in sums.
101extern ex collect_common_factors(const ex & e);
102
103// Resultant of two polynomials e1,e2 with respect to symbol s.
104extern ex resultant(const ex & e1, const ex & e2, const ex & s);
105
106} // namespace GiNaC
107
108#endif // ndef GINAC_NORMAL_H
unsigned options
Definition: factor.cpp:2475
ex x
Definition: factor.cpp:1610
Definition of GiNaC's lst.
Definition: add.cpp:38
container< std::list > lst
Definition: lst.h:32
ex sqrfree(const ex &a, const lst &l)
Compute a square-free factorization of a multivariate polynomial in Q[X].
Definition: normal.cpp:1889
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:2878
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:1433
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:492
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:373
ex sqrfree_parfrac(const ex &a, const symbol &x)
Compute square-free partial fraction decomposition of rational function a(x).
Definition: normal.cpp:1948
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:1775
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:472
ex collect_common_factors(const ex &e)
Collect common factors in sums.
Definition: normal.cpp:2862
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:423
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:544
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:595
Flags to control the behavior of gcd() and friends.
Definition: normal.h:37
@ use_sr_gcd
By default GiNaC uses modular GCD algorithm.
Definition: normal.h:61
@ no_part_factored
GiNaC tries to avoid expanding expressions when computing GCDs.
Definition: normal.h:55
@ no_heur_gcd
Usually GiNaC tries heuristic GCD first, because typically it's much faster than anything else.
Definition: normal.h:47

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