GiNaC  1.8.0
normal.h
Go to the documentation of this file.
1 
8 /*
9  * GiNaC Copyright (C) 1999-2020 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 
31 namespace GiNaC {
32 
37 {
38  enum {
61  use_sr_gcd = 8
62 
63  };
64 };
65 
66 class ex;
67 class 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)
70 extern 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)
73 extern 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)
76 extern ex decomp_rational(const ex &a, const ex &x);
77 
78 // Pseudo-remainder of polynomials a(x) and b(x) in Q[x]
79 extern 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]
82 extern 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
85 extern 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
88 extern 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]
92 extern ex lcm(const ex &a, const ex &b, bool check_args = true);
93 
94 // Square-free factorization of a polynomial a(x)
95 extern ex sqrfree(const ex &a, const lst &l = lst());
96 
97 // Square-free partial fraction decomposition of a rational function a(x)
98 extern ex sqrfree_parfrac(const ex & a, const symbol & x);
99 
100 // Collect common factors in sums.
101 extern ex collect_common_factors(const ex & e);
102 
103 // Resultant of two polynomials e1,e2 with respect to symbol s.
104 extern ex resultant(const ex & e1, const ex & e2, const ex & s);
105 
106 } // namespace GiNaC
107 
108 #endif // ndef GINAC_NORMAL_H
GiNaC::lst
container< std::list > lst
Definition: lst.h:32
GiNaC::quo
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
GiNaC::sqrfree
ex sqrfree(const ex &a, const lst &l)
Compute a square-free factorization of a multivariate polynomial in Q[X].
Definition: normal.cpp:1888
GiNaC::resultant
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:2848
options
unsigned options
Definition: factor.cpp:2480
GiNaC
Definition: add.cpp:38
GiNaC::gcd_options::no_heur_gcd
@ no_heur_gcd
Usually GiNaC tries heuristic GCD first, because typically it's much faster than anything else.
Definition: normal.h:47
GiNaC::gcd_options::no_part_factored
@ no_part_factored
GiNaC tries to avoid expanding expressions when computing GCDs.
Definition: normal.h:55
x
ex x
Definition: factor.cpp:1641
GiNaC::gcd
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
lst.h
Definition of GiNaC's lst.
GiNaC::rem
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
GiNaC::collect_common_factors
ex collect_common_factors(const ex &e)
Collect common factors in sums.
Definition: normal.cpp:2832
GiNaC::sqrfree_parfrac
ex sqrfree_parfrac(const ex &a, const symbol &x)
Compute square-free partial fraction decomposition of rational function a(x).
Definition: normal.cpp:1947
GiNaC::gcd_options
Flags to control the behavior of gcd() and friends.
Definition: normal.h:37
GiNaC::lcm
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
GiNaC::decomp_rational
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
GiNaC::divide
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
GiNaC::sprem
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
GiNaC::gcd_options::use_sr_gcd
@ use_sr_gcd
By default GiNaC uses modular GCD algorithm.
Definition: normal.h:61
GiNaC::prem
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

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