|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Univariate polynomial over a generic coefficient ring. More...
#include <tpl_polynomial.H>
Classes | |
| struct | SfdTerm |
| Square-free decomposition term: factor and multiplicity. More... | |
| struct | Xgcd_Result |
| Extended GCD: computes g, s, t such that \(sa + tb = g\). More... | |
Public Types | |
| using | Coeff = Coefficient |
Public Member Functions | |
| Gen_Polynomial ()=default | |
| Default constructor: the zero polynomial. | |
| Gen_Polynomial (const Coefficient &c) | |
| Constant polynomial \(p(x) = c\). | |
| Gen_Polynomial (const Coefficient &c, size_t exp) | |
| Monomial \(c \cdot x^e\). | |
| Gen_Polynomial (std::initializer_list< Coefficient > il) | |
| Dense construction from initializer list. | |
| Gen_Polynomial (const DynList< Coefficient > &l) | |
| Dense construction from DynList. | |
| Gen_Polynomial (const DynList< std::pair< size_t, Coefficient > > &term_list) | |
| Sparse construction from a list of (exponent, coefficient) pairs. | |
| bool | is_zero () const noexcept |
| True if this is the zero polynomial. | |
| size_t | degree () const noexcept |
| Degree of the polynomial. | |
| size_t | num_terms () const noexcept |
| Number of non-zero terms. | |
| bool | is_constant () const noexcept |
| True if constant or zero. | |
| bool | is_monomial () const noexcept |
| True if exactly one non-zero term. | |
| bool | is_monic () const noexcept |
| True if leading coefficient equals 1. | |
| Coefficient | operator[] (size_t exp) const |
Coefficient at exponent exp (0 if absent). | |
| Coefficient | leading_coeff () const noexcept |
| Leading coefficient (of the highest-degree term). | |
| bool | has_term (size_t exp) const noexcept |
True if there is a non-zero coefficient at exp. | |
| Coefficient | horner_eval (const Coefficient &x) const |
| Evaluate \(p(x)\) using gap-aware Horner's method. | |
| Coefficient | sparse_eval (const Coefficient &x) const |
| Evaluate \(p(x)\) using sparse evaluation. | |
| Coefficient | eval (const Coefficient &x) const |
| Evaluate \(p(x)\) with adaptive strategy. | |
| Coefficient | operator() (const Coefficient &x) const |
Syntactic sugar: p(x) calls eval. | |
| DynList< Coefficient > | multi_eval (const DynList< Coefficient > &points) const |
| Evaluate at multiple points. | |
| Gen_Polynomial | operator- () const |
| Unary negation. | |
| Gen_Polynomial | operator+ (const Gen_Polynomial &q) const |
| Polynomial addition. | |
| Gen_Polynomial & | operator+= (const Gen_Polynomial &q) |
| In-place addition. | |
| Gen_Polynomial | operator+ (const Coefficient &c) const |
| Add a scalar constant term. | |
| Gen_Polynomial & | operator+= (const Coefficient &c) |
| In-place addition of a scalar constant term. | |
| Gen_Polynomial | operator- (const Gen_Polynomial &q) const |
| Polynomial subtraction. | |
| Gen_Polynomial & | operator-= (const Gen_Polynomial &q) |
| In-place subtraction. | |
| Gen_Polynomial | operator- (const Coefficient &c) const |
| Subtract a scalar constant term. | |
| Gen_Polynomial & | operator-= (const Coefficient &c) |
| In-place subtraction of a scalar constant term. | |
| Gen_Polynomial | operator* (const Gen_Polynomial &q) const |
| Polynomial multiplication. | |
| Gen_Polynomial & | operator*= (const Gen_Polynomial &q) |
| In-place multiplication. | |
| Gen_Polynomial | operator* (const Coefficient &s) const |
| Multiply by a scalar. | |
| Gen_Polynomial & | operator*= (const Coefficient &s) |
| In-place scalar multiplication. | |
| Gen_Polynomial | operator/ (const Coefficient &s) const |
| Divide by a scalar. | |
| Gen_Polynomial & | operator/= (const Coefficient &s) |
| In-place scalar division. | |
| std::pair< Gen_Polynomial, Gen_Polynomial > | divmod (const Gen_Polynomial &d) const |
| Polynomial long division: returns (quotient, remainder). | |
| Gen_Polynomial | operator/ (const Gen_Polynomial &d) const |
| Polynomial quotient. | |
| Gen_Polynomial | operator% (const Gen_Polynomial &d) const |
| Polynomial remainder. | |
| Gen_Polynomial & | operator/= (const Gen_Polynomial &d) |
| In-place polynomial quotient. | |
| Gen_Polynomial & | operator%= (const Gen_Polynomial &d) |
| In-place polynomial remainder. | |
| Gen_Polynomial | derivative () const |
| Formal derivative \(p'(x)\). | |
| Gen_Polynomial | nth_derivative (size_t n) const |
| \(n\)-th derivative \(p^{(n)}(x)\). | |
| Gen_Polynomial | integral (const Coefficient &C=Coefficient{}) const |
| Formal indefinite integral with constant of integration. | |
| Coefficient | definite_integral (const Coefficient &a, const Coefficient &b) const |
| Definite integral \(\int_a^b p(x)\,dx\). | |
| Gen_Polynomial | compose (const Gen_Polynomial &q) const |
| Composition \(p(q(x))\). | |
| Gen_Polynomial | pow (size_t n) const |
| Exponentiation \(p(x)^n\) by repeated squaring. | |
| std::pair< Gen_Polynomial, Gen_Polynomial > | pseudo_divmod (const Gen_Polynomial &d) const |
| Pseudo-division for non-field coefficient types. | |
| Gen_Polynomial | to_monic () const |
| Make monic: divide by leading coefficient. | |
| Gen_Polynomial | reverse () const |
| Reciprocal polynomial: \(x^d \cdot p(1/x)\). | |
| Gen_Polynomial | negate_arg () const |
| Argument negation: \(p(-x)\). | |
| Gen_Polynomial | shift (const Coefficient &k) const |
| Taylor shift: \(p(x + k)\). | |
| Gen_Polynomial | shift_up (size_t k) const |
| Multiply by \(x^k\) (shift exponents up). | |
| Gen_Polynomial | shift_down (size_t k) const |
| Divide by \(x^k\) (shift exponents down). | |
| Gen_Polynomial | truncate (size_t n) const |
Truncate to degree less than n. | |
| Array< Coefficient > | to_dense () const |
| Dense coefficient vector. | |
| Gen_Polynomial | square_free () const |
| Square-free part: \(p / \gcd(p, p')\). | |
| Coefficient | cauchy_bound () const |
| Cauchy upper bound on absolute value of roots. | |
| size_t | sign_variations () const |
| Count sign changes in the coefficient sequence. | |
| DynList< Gen_Polynomial > | sturm_chain () const |
| Sturm sequence of this polynomial. | |
| size_t | count_real_roots (const Coefficient &a, const Coefficient &b) const |
| Count distinct real roots in \([a, b]\) via Sturm's theorem. | |
| size_t | count_all_real_roots () const |
| Total number of distinct real roots. | |
| Coefficient | bisect_root (Coefficient a, Coefficient b, Coefficient tol=Coefficient(1e-12), size_t max_iter=200) const |
| Find a root by bisection in \([a, b]\). | |
| Coefficient | newton_root (Coefficient x0, Coefficient tol=Coefficient(1e-12), size_t max_iter=100) const |
| Find a root by Newton-Raphson iteration. | |
| bool | operator== (const Gen_Polynomial &q) const noexcept |
| Equality comparison. | |
| bool | operator!= (const Gen_Polynomial &q) const noexcept |
| Inequality comparison. | |
| template<class Op > | |
| void | for_each_term (Op &&op) const |
| Iterate over non-zero terms in ascending exponent order. | |
| DynList< std::pair< size_t, Coefficient > > | terms_list () const |
| All non-zero terms as a sorted list of (exponent, coefficient). | |
| DynList< size_t > | exponents () const |
| All exponents with non-zero coefficients (sorted ascending). | |
| DynList< Coefficient > | coefficients () const |
| All non-zero coefficients in ascending exponent order. | |
| std::string | to_str (const std::string &var="x") const |
| Human-readable string representation. | |
| Coefficient | get_coeff (size_t exp) const noexcept |
| Coefficient accessor (read-only at exponent). | |
| void | set_coeff (size_t exp, const Coefficient &c) |
| Set coefficient at exponent; removes entry if zero. | |
| Coefficient | content () const |
| Content: GCD of all coefficients. | |
| Gen_Polynomial | primitive_part () const |
| Primitive part: polynomial divided by its content. | |
| DynList< SfdTerm > | yun_sfd () const |
| Yun's square-free decomposition (SFD). | |
| double | mignotte_bound () const |
| Mignotte bound on integer roots. | |
| DynList< SfdTerm > | factorize () const |
| Main factorization over integers. | |
Private Types | |
| using | Term = std::pair< size_t, Coefficient > |
Private Member Functions | |
| void | remove_zeros () |
| Remove all entries whose coefficient is (approximately) zero. | |
| Coefficient | coeff_at (size_t exp) const |
| Read coefficient at exponent (0 if absent). | |
| Coefficient * | coeff_ptr (size_t exp) noexcept |
| Pointer to stored coefficient, or null if absent. | |
| const Coefficient * | coeff_ptr (size_t exp) const noexcept |
| Pointer to stored coefficient, or null if absent. | |
| void | add_to_coeff (size_t exp, const Coefficient &delta) |
| Add a delta to one coefficient, erasing the term if it cancels. | |
| void | add_scaled_shifted (const Gen_Polynomial &src, const Coefficient &scale, size_t shift=0) |
Add scale times src shifted by shift to this polynomial. | |
| void | scale_inplace (const Coefficient &s) |
| Multiply every coefficient in place by a scalar. | |
| void | divide_scalar_inplace (const Coefficient &s) |
| Divide every coefficient in place by a scalar. | |
| template<class Op > | |
| void | for_each_term_desc (Op &&op) const |
| Iterate over non-zero terms in descending exponent order. | |
| Gen_Polynomial | multiply_by_monic_linear (const Coefficient &c) const |
| Specialized multiplication by a monic linear factor \(x + c\). | |
Static Private Member Functions | |
| static constexpr Coefficient | epsilon () noexcept |
| Tolerance threshold for floating-point zero detection. | |
| static bool | coeff_is_zero (const Coefficient &c) noexcept |
| Test whether a coefficient is (approximately) zero. | |
Private Attributes | |
| DynMapTree< size_t, Coefficient > | coeffs |
Univariate polynomial over a generic coefficient ring.
Internally stores only non-zero coefficients in a DynMapTree<size_t, Coefficient> mapping exponents to coefficients. The zero polynomial is represented by an empty map.
For floating-point coefficient types, an epsilon-based zero test is used automatically to prevent accumulation of near-zero terms.
| Coefficient | Coefficient ring (default double). |
Definition at line 166 of file tpl_polynomial.H.
| using Aleph::Gen_Polynomial< Coefficient >::Coeff = Coefficient |
Definition at line 169 of file tpl_polynomial.H.
|
private |
Definition at line 172 of file tpl_polynomial.H.
|
default |
Default constructor: the zero polynomial.
Referenced by Aleph::Gen_Polynomial< Coefficient >::compose(), Aleph::Gen_Polynomial< Coefficient >::divmod(), Aleph::Gen_Polynomial< Coefficient >::factorize(), Aleph::Gen_Polynomial< Coefficient >::lcm(), Aleph::Gen_Polynomial< Coefficient >::multiply_by_monic_linear(), Aleph::Gen_Polynomial< Coefficient >::one(), Aleph::Gen_Polynomial< Coefficient >::operator*(), Aleph::Gen_Polynomial< Coefficient >::operator*(), Aleph::Gen_Polynomial< Coefficient >::primitive_part(), Aleph::Gen_Polynomial< Coefficient >::pseudo_divmod(), Aleph::Gen_Polynomial< Coefficient >::reverse(), Aleph::Gen_Polynomial< Coefficient >::shift(), Aleph::Gen_Polynomial< Coefficient >::try_divide_by_linear_factor(), Aleph::Gen_Polynomial< Coefficient >::try_extract_rational_linear_factor(), Aleph::Gen_Polynomial< Coefficient >::x_to(), and Aleph::Gen_Polynomial< Coefficient >::zero().
|
inlineexplicit |
Constant polynomial \(p(x) = c\).
| [in] | c | The constant value. |
Definition at line 369 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeffs, and Aleph::divide_and_conquer_partition_dp().
|
inline |
Monomial \(c \cdot x^e\).
| [in] | c | Coefficient. |
| [in] | exp | Exponent. |
Definition at line 379 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), and exp().
|
inline |
Dense construction from initializer list.
The list \(\{a_0, a_1, \ldots, a_n\}\) yields \(a_0 + a_1 x + \cdots + a_n x^n\).
| [in] | il | Coefficients in ascending exponent order. |
Definition at line 392 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), and exp().
|
inlineexplicit |
Dense construction from DynList.
Same semantics as the initializer_list constructor.
| [in] | l | Coefficients in ascending exponent order. |
Definition at line 409 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), exp(), FunctionalMethods< Container, T >::for_each(), and l.
|
inlineexplicit |
Sparse construction from a list of (exponent, coefficient) pairs.
Repeated exponents are accumulated, so the resulting polynomial is normalized even if the input list is not.
| [in] | term_list | Pairs of (exponent, coefficient). |
Definition at line 427 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::add_to_coeff(), Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), and Aleph::divide_and_conquer_partition_dp().
|
inlinestatic |
Integer-safe exact quotient using pseudo-division.
Computes \(a / b\) for integer polynomials where b is known to divide a. Uses pseudo-division and normalizes the result.
| [in] | a | Dividend. |
| [in] | b | Divisor (must divide a exactly). |
| std::domain_error | if b is zero or does not divide a exactly. |
Definition at line 2111 of file tpl_polynomial.H.
References ah_domain_error_if, Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::leading_coeff(), and r.
Referenced by TEST(), TEST(), TEST(), TEST(), and Aleph::Gen_Polynomial< Coefficient >::yun_sfd().
|
inlineprivate |
Add scale times src shifted by shift to this polynomial.
Definition at line 257 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::add_to_coeff(), Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::divide_and_conquer_partition_dp(), exp(), Aleph::Gen_Polynomial< Coefficient >::for_each_term(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), and Aleph::Gen_Polynomial< Coefficient >::shift().
Referenced by Aleph::Gen_Polynomial< Coefficient >::interpolate().
|
inlineprivate |
Add a delta to one coefficient, erasing the term if it cancels.
Definition at line 241 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeff_ptr(), Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), and exp().
Referenced by Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::add_scaled_shifted(), Aleph::Gen_Polynomial< Coefficient >::compose(), Aleph::Gen_Polynomial< Coefficient >::divmod(), Aleph::Gen_Polynomial< Coefficient >::multiply_by_monic_linear(), Aleph::Gen_Polynomial< Coefficient >::operator*(), Aleph::Gen_Polynomial< Coefficient >::operator+=(), Aleph::Gen_Polynomial< Coefficient >::operator+=(), Aleph::Gen_Polynomial< Coefficient >::operator-=(), Aleph::Gen_Polynomial< Coefficient >::operator-=(), and Aleph::Gen_Polynomial< Coefficient >::pseudo_divmod().
|
inline |
Find a root by bisection in \([a, b]\).
Requires \(p(a)\) and \(p(b)\) to have opposite signs.
| [in] | a | Lower bound (must satisfy \(p(a) \cdot p(b) < 0\)). |
| [in] | b | Upper bound. |
| [in] | tol | Convergence tolerance (default \(10^{-12}\)). |
| [in] | max_iter | Maximum iterations (default 200). |
| std::domain_error | if same sign at endpoints. |
If a > b, the endpoints are swapped.
Definition at line 1661 of file tpl_polynomial.H.
References ah_domain_error_if, Aleph::and, Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::divide_and_conquer_partition_dp(), and Aleph::Gen_Polynomial< Coefficient >::eval().
Referenced by root_analysis(), TEST(), and TEST().
|
inline |
Cauchy upper bound on absolute value of roots.
For \(p(x) = a_d x^d + \ldots + a_0\), all roots \(|r|\) satisfy \(|r| \le 1 + \max_i |a_i / a_d|\).
| std::domain_error | if zero polynomial. |
Definition at line 1457 of file tpl_polynomial.H.
References ah_domain_error_if, Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::Gen_Polynomial< Coefficient >::degree(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::is_constant(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), and Aleph::Gen_Polynomial< Coefficient >::leading_coeff().
Referenced by Aleph::Gen_Polynomial< Coefficient >::count_all_real_roots(), root_analysis(), TEST(), TEST(), TEST(), and TEST().
|
inlineprivate |
Read coefficient at exponent (0 if absent).
Definition at line 220 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), and exp().
Referenced by Aleph::Gen_Polynomial< Coefficient >::eval(), Aleph::Gen_Polynomial< Coefficient >::get_coeff(), Aleph::Gen_Polynomial< Coefficient >::horner_eval(), and Aleph::Gen_Polynomial< Coefficient >::operator[]().
|
inlinestaticprivatenoexcept |
Test whether a coefficient is (approximately) zero.
For floating-point types, uses std::abs(c) <= epsilon(). For exact types, uses c == Coefficient{}.
Definition at line 195 of file tpl_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::Gen_Polynomial< Coefficient >::epsilon().
Referenced by Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::_integer_exact_quot(), Aleph::Gen_Polynomial< Coefficient >::add_scaled_shifted(), Aleph::Gen_Polynomial< Coefficient >::add_to_coeff(), Aleph::Gen_Polynomial< Coefficient >::bisect_root(), Aleph::Gen_Polynomial< Coefficient >::count_real_roots(), Aleph::Gen_Polynomial< Coefficient >::definite_integral(), Aleph::Gen_Polynomial< Coefficient >::derivative(), Aleph::Gen_Polynomial< Coefficient >::divide_scalar_inplace(), Aleph::Gen_Polynomial< Coefficient >::divmod(), Aleph::Gen_Polynomial< Coefficient >::interpolate(), Aleph::Gen_Polynomial< Coefficient >::is_monic(), Aleph::Gen_Polynomial< Coefficient >::newton_root(), Aleph::Gen_Polynomial< Coefficient >::operator*(), Aleph::Gen_Polynomial< Coefficient >::operator/(), Aleph::Gen_Polynomial< Coefficient >::operator==(), Aleph::Gen_Polynomial< Coefficient >::remove_zeros(), Aleph::Gen_Polynomial< Coefficient >::scale_inplace(), Aleph::Gen_Polynomial< Coefficient >::set_coeff(), and Aleph::Gen_Polynomial< Coefficient >::sturm_sign_changes().
|
inlineprivatenoexcept |
Pointer to stored coefficient, or null if absent.
Definition at line 234 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs, and exp().
|
inlineprivatenoexcept |
Pointer to stored coefficient, or null if absent.
Definition at line 227 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs, and exp().
Referenced by Aleph::Gen_Polynomial< Coefficient >::add_to_coeff(), and Aleph::Gen_Polynomial< Coefficient >::set_coeff().
|
inline |
All non-zero coefficients in ascending exponent order.
Definition at line 1845 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs.
|
inline |
Composition \(p(q(x))\).
Evaluates this polynomial at q using a sparse-aware Horner scheme over non-zero coefficients, so large exponent gaps do not force repeated multiplication by q for zero coefficients.
Definition at line 1082 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::add_to_coeff(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::eval(), exp(), Aleph::Gen_Polynomial< Coefficient >::for_each_term_desc(), Aleph::Gen_Polynomial< Coefficient >::is_constant(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), and Aleph::Gen_Polynomial< Coefficient >::pow().
Referenced by Aleph::Gen_Polynomial< Coefficient >::shift(), sparse_polynomials(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Content: GCD of all coefficients.
For an integer polynomial \(p(x) = a_d x^d + \ldots + a_0\), the content is \(\gcd(a_d, \ldots, a_0)\).
For the zero polynomial, returns zero. For a non-zero polynomial, the sign follows the leading coefficient.
Definition at line 1958 of file tpl_polynomial.H.
References Aleph::and, Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), and Aleph::Gen_Polynomial< Coefficient >::leading_coeff().
Referenced by Aleph::Gen_Polynomial< Coefficient >::factorize(), Aleph::Gen_Polynomial< Coefficient >::primitive_part(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Total number of distinct real roots.
Counts all distinct real roots using Sturm's theorem with the Cauchy bound.
Definition at line 1640 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::cauchy_bound(), Aleph::Gen_Polynomial< Coefficient >::count_real_roots(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::is_constant(), and Aleph::Gen_Polynomial< Coefficient >::is_zero().
Referenced by root_analysis(), and TEST().
|
inline |
Count distinct real roots in \([a, b]\) via Sturm's theorem.
| [in] | a | Lower bound of interval. |
| [in] | b | Upper bound of interval. |
a > b, the endpoints are swapped. The zero polynomial is treated as having 0 countable distinct roots.Definition at line 1615 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::count(), Aleph::Gen_Polynomial< Coefficient >::count_real_roots(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), Aleph::Gen_Polynomial< Coefficient >::sturm_chain(), and Aleph::Gen_Polynomial< Coefficient >::sturm_sign_changes().
Referenced by Aleph::Gen_Polynomial< Coefficient >::count_all_real_roots(), Aleph::Gen_Polynomial< Coefficient >::count_real_roots(), root_analysis(), TEST(), and TEST().
|
inline |
Definite integral \(\int_a^b p(x)\,dx\).
Computes the integral term by term without materializing the full antiderivative polynomial.
| [in] | a | Lower bound. |
| [in] | b | Upper bound. |
Definition at line 1052 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), and Aleph::polynomial_detail::power().
|
inlinenoexcept |
Degree of the polynomial.
Returns 0 for the zero polynomial. Use is_zero() to distinguish the zero polynomial from a non-zero constant.
Definition at line 552 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs.
Referenced by algebraic_transformations(), Aleph::Gen_Polynomial< Coefficient >::cauchy_bound(), Aleph::Gen_Polynomial< Coefficient >::divide_by_monic_linear_mod(), Aleph::Gen_Polynomial< Coefficient >::divmod(), Aleph::Gen_Polynomial< Coefficient >::factor_mod_p(), Aleph::Gen_Polynomial< Coefficient >::factorize(), Aleph::Gen_Polynomial< Coefficient >::hensel_lift(), Aleph::Gen_Polynomial< Coefficient >::mignotte_bound(), Aleph::Gen_Polynomial< Coefficient >::pseudo_divmod(), Aleph::Gen_Polynomial< Coefficient >::reverse(), root_analysis(), sparse_polynomials(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), Aleph::Gen_Polynomial< Coefficient >::to_dense(), and Aleph::Gen_Polynomial< Coefficient >::try_divide_by_linear_factor().
|
inline |
Formal derivative \(p'(x)\).
\(\frac{d}{dx}\bigl[\sum c_i x^{e_i}\bigr] = \sum e_i \cdot c_i \cdot x^{e_i - 1}\).
Definition at line 984 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeffs, and Aleph::divide_and_conquer_partition_dp().
Referenced by calculus_example(), Aleph::Gen_Polynomial< Coefficient >::hensel_lift(), Aleph::Gen_Polynomial< Coefficient >::newton_root(), Aleph::Gen_Polynomial< Coefficient >::nth_derivative(), sparse_polynomials(), Aleph::Gen_Polynomial< Coefficient >::square_free(), Aleph::Gen_Polynomial< Coefficient >::sturm_chain(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and Aleph::Gen_Polynomial< Coefficient >::yun_sfd().
|
inlinestatic |
Definition at line 2167 of file tpl_polynomial.H.
References ah_domain_error_if, Aleph::Gen_Polynomial< Coefficient >::degree(), Aleph::divide_and_conquer_partition_dp(), exp(), Aleph::next(), root(), and Aleph::Gen_Polynomial< Coefficient >::set_coeff().
Referenced by Aleph::Gen_Polynomial< Coefficient >::factor_mod_p().
|
inlineprivate |
Divide every coefficient in place by a scalar.
Definition at line 299 of file tpl_polynomial.H.
References ah_domain_error_if, Aleph::DynList< T >::append(), Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), exp(), and FunctionalMethods< Container, T >::for_each().
Referenced by Aleph::Gen_Polynomial< Coefficient >::operator/=().
|
inline |
Polynomial long division: returns (quotient, remainder).
Computes \(q\) and \(r\) such that \(\text{this} = q \cdot d + r\) with \(\deg(r) < \deg(d)\) or \(r = 0\).
| [in] | d | Divisor (must not be zero). |
| std::domain_error | if d is zero. |
Definition at line 917 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::add_to_coeff(), ah_domain_error_if, Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::degree(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), Aleph::Gen_Polynomial< Coefficient >::leading_coeff(), r, and Aleph::Gen_Polynomial< Coefficient >::shift().
Referenced by basic_arithmetic(), Aleph::Gen_Polynomial< Coefficient >::operator%(), Aleph::Gen_Polynomial< Coefficient >::operator%=(), Aleph::Gen_Polynomial< Coefficient >::operator/(), Aleph::Gen_Polynomial< Coefficient >::operator/=(), TEST(), TEST(), TEST(), TEST(), TEST(), and Aleph::Gen_Polynomial< Coefficient >::xgcd().
|
inlinestaticconstexprprivatenoexcept |
Tolerance threshold for floating-point zero detection.
Returns \(128 \cdot \varepsilon\) for floating-point types and the additive identity for all others.
Definition at line 182 of file tpl_polynomial.H.
References Aleph::divide_and_conquer_partition_dp().
Referenced by Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), and Aleph::Gen_Polynomial< Coefficient >::sign_variations().
|
inline |
Evaluate \(p(x)\) with adaptive strategy.
Uses direct term evaluation for ultra-sparse polynomials and the gap-aware Horner path otherwise.
| [in] | x | Evaluation point. |
Definition at line 682 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeff_at(), Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::horner_eval(), Aleph::Gen_Polynomial< Coefficient >::num_terms(), and Aleph::Gen_Polynomial< Coefficient >::sparse_eval().
Referenced by Aleph::Gen_Polynomial< Coefficient >::bisect_root(), Aleph::Gen_Polynomial< Coefficient >::compose(), Aleph::Gen_Polynomial< Coefficient >::multi_eval(), Aleph::Gen_Polynomial< Coefficient >::newton_root(), Aleph::Gen_Polynomial< Coefficient >::operator()(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinestatic |
Definition at line 2150 of file tpl_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), exp(), Aleph::Gen_Polynomial< Coefficient >::for_each_term(), Aleph::mod_exp(), Aleph::mod_mul(), and Aleph::polynomial_detail::normalize_mod_u64().
Referenced by Aleph::Gen_Polynomial< Coefficient >::factor_mod_p(), and Aleph::Gen_Polynomial< Coefficient >::hensel_lift().
|
inline |
All exponents with non-zero coefficients (sorted ascending).
Definition at line 1839 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs, and GenericItems< Container, T >::keys().
Referenced by TEST().
|
inlinestatic |
Factorization over integers mod p (trial method).
Finds all linear factors over \(\mathbb{Z}/p\mathbb{Z}\) by exhaustive root search and repeated extraction. Any unfactored residual polynomial is appended as the final element.
| [in] | f | Polynomial to factor. |
| [in] | p | The prime modulus. |
| std::domain_error | if p <= 1. |
Definition at line 2523 of file tpl_polynomial.H.
References Aleph::polynomial_detail::abs_to_u64(), ah_domain_error_if, Aleph::and, Aleph::DynList< T >::append(), Aleph::Gen_Polynomial< Coefficient >::degree(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::divide_by_monic_linear_mod(), Aleph::Gen_Polynomial< Coefficient >::eval_mod_u64(), Aleph::Gen_Polynomial< Coefficient >::is_constant(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), Aleph::polynomial_detail::normalize_mod_u64(), r, Aleph::Gen_Polynomial< Coefficient >::reduce_coeffs_mod(), and Aleph::Gen_Polynomial< Coefficient >::set_coeff().
Referenced by Aleph::Gen_Polynomial< Coefficient >::factorize(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Main factorization over integers.
Combines square-free decomposition (SFD), exact extraction of rational linear factors, and modular root search / Hensel lifting heuristics for any remaining square-free blocks.
Algorithm outline:
Definition at line 2744 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::and, Aleph::DynList< T >::append(), Aleph::Gen_Polynomial< Coefficient >::content(), Aleph::Gen_Polynomial< Coefficient >::degree(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::factor_mod_p(), Aleph::Gen_Polynomial< Coefficient >::get_coeff(), Aleph::Gen_Polynomial< Coefficient >::hensel_lift(), Aleph::Gen_Polynomial< Coefficient >::is_constant(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), Aleph::Gen_Polynomial< Coefficient >::leading_coeff(), Aleph::Gen_Polynomial< Coefficient >::primitive_part(), Aleph::Gen_Polynomial< Coefficient >::try_divide_by_linear_factor(), Aleph::Gen_Polynomial< Coefficient >::try_extract_primitive_cubic_factor(), Aleph::Gen_Polynomial< Coefficient >::try_extract_primitive_quadratic_factor(), and Aleph::Gen_Polynomial< Coefficient >::try_extract_rational_linear_factor().
Referenced by algebraic_transformations(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Iterate over non-zero terms in ascending exponent order.
The callable op receives (size_t exponent, const Coefficient &).
Definition at line 1817 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs.
Referenced by Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_embed_univariate(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_factorize_as_univariate_in_var(), Aleph::Gen_Polynomial< Coefficient >::add_scaled_shifted(), Aleph::Gen_Polynomial< Coefficient >::eval_mod_u64(), Aleph::Gen_Polynomial< Coefficient >::hensel_lift(), Aleph::Gen_Polynomial< Coefficient >::reduce_coeffs_mod(), TEST(), and transfer_function().
|
inlineprivate |
Iterate over non-zero terms in descending exponent order.
Definition at line 326 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs, and Aleph::divide_and_conquer_partition_dp().
Referenced by Aleph::Gen_Polynomial< Coefficient >::compose(), Aleph::Gen_Polynomial< Coefficient >::horner_eval(), and Aleph::Gen_Polynomial< Coefficient >::to_str().
|
inlinestatic |
Build polynomial from its roots: \(\prod (x - r_i)\).
| [in] | roots | List of roots. |
roots (with multiplicity).Definition at line 469 of file tpl_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), FunctionalMethods< Container, T >::for_each(), Aleph::Gen_Polynomial< Coefficient >::multiply_by_monic_linear(), and r.
Referenced by root_analysis(), roots_and_interpolation(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinestatic |
Greatest common divisor (Euclidean algorithm).
Returns a monic GCD (leading coefficient 1) for field-like coefficient types. For integer coefficients, the result is normalized by dividing by its leading coefficient.
Definition at line 1154 of file tpl_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), Aleph::Gen_Polynomial< Coefficient >::leading_coeff(), and r.
Referenced by Aleph::Gen_Polynomial< Coefficient >::lcm(), Aleph::Gen_Polynomial< Coefficient >::square_free(), TEST(), and TEST().
|
inlinenoexcept |
Coefficient accessor (read-only at exponent).
Returns the coefficient at exp, or Coefficient{} (zero) if absent. This is equivalent to operator[].
Definition at line 1924 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeff_at(), and exp().
Referenced by Aleph::Gen_Polynomial< Coefficient >::factorize(), Aleph::Gen_Polynomial< Coefficient >::hensel_lift(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::homomorphic_eval(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
True if there is a non-zero coefficient at exp.
Definition at line 604 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs, and exp().
|
inlinestatic |
Hensel lifting of modular factors.
Given modular factors of \(f \pmod p \), lifts any monic linear factor corresponding to a simple root to modulus \(p^{2^\text{levels}}\) using repeated Hensel root lifting. Factors that are not monic linear simple-root factors are carried through reduced modulo the target modulus.
| [in] | f | Original polynomial. |
| [in] | factors | Factors mod p (must multiply to f mod p). |
| [in] | p | The prime modulus. |
| [in] | levels | Number of lifting iterations (quadratic). |
| std::domain_error | if p <= 1 or levels > 30. |
Definition at line 2616 of file tpl_polynomial.H.
References Aleph::polynomial_detail::abs_to_u64(), ah_domain_error_if, Aleph::and, Aleph::DynList< T >::append(), Aleph::Gen_Polynomial< Coefficient >::degree(), Aleph::Gen_Polynomial< Coefficient >::derivative(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::eval_mod_u64(), exp(), Aleph::Gen_Polynomial< Coefficient >::for_each_term(), Aleph::Gen_Polynomial< Coefficient >::get_coeff(), Aleph::mod_inv(), Aleph::mod_mul(), Aleph::polynomial_detail::normalize_mod_u64(), root(), and Aleph::Gen_Polynomial< Coefficient >::set_coeff().
Referenced by Aleph::Gen_Polynomial< Coefficient >::factorize(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Evaluate \(p(x)\) using gap-aware Horner's method.
Consecutive blocks of missing coefficients are collapsed into powers of x, so sparse high-degree polynomials do not pay a lookup per zero coefficient.
| [in] | x | Evaluation point. |
Definition at line 622 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeff_at(), Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), exp(), Aleph::Gen_Polynomial< Coefficient >::for_each_term_desc(), and Aleph::polynomial_detail::power().
Referenced by Aleph::Gen_Polynomial< Coefficient >::eval(), and TEST().
|
inlinestatic |
Polynomial GCD over integers (Euclidean algorithm with primitive parts).
Computes \(\gcd(a, b)\) for integer polynomials using the Euclidean algorithm, normalizing by primitive parts at each step.
| [in] | a | First polynomial. |
| [in] | b | Second polynomial. |
Definition at line 2029 of file tpl_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::primitive_part(), and Aleph::Gen_Polynomial< Coefficient >::pseudo_divmod().
Referenced by TEST(), TEST(), TEST(), TEST(), and Aleph::Gen_Polynomial< Coefficient >::yun_sfd().
|
inline |
Formal indefinite integral with constant of integration.
\(\int \sum c_i x^{e_i}\,dx = C + \sum \frac{c_i}{e_i + 1} x^{e_i + 1}\)
| [in] | C | Constant of integration (default 0). |
Definition at line 1028 of file tpl_polynomial.H.
Referenced by calculus_example(), TEST(), TEST(), and TEST().
|
inlinestatic |
Polynomial interpolation through a set of points.
Given \(n+1\) points \((x_i, y_i)\), returns the unique polynomial of degree at most \(n\) passing through all of them.
| [in] | points | List of (x, y) pairs. The x-values must be distinct. |
| std::domain_error | if fewer than 1 point or duplicate x-values. |
Definition at line 493 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::add_scaled_shifted(), ah_domain_error_if, Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::divide_and_conquer_partition_dp(), and Aleph::Array< T >::putn().
Referenced by roots_and_interpolation(), TEST(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
True if constant or zero.
Definition at line 566 of file tpl_polynomial.H.
References Aleph::and, Aleph::Gen_Polynomial< Coefficient >::coeffs, and Aleph::divide_and_conquer_partition_dp().
Referenced by Aleph::Gen_Polynomial< Coefficient >::cauchy_bound(), Aleph::Gen_Polynomial< Coefficient >::compose(), Aleph::Gen_Polynomial< Coefficient >::count_all_real_roots(), Aleph::Gen_Polynomial< Coefficient >::factor_mod_p(), Aleph::Gen_Polynomial< Coefficient >::factorize(), Aleph::Gen_Polynomial< Coefficient >::square_free(), Aleph::Gen_Polynomial< Coefficient >::sturm_chain(), TEST(), and Aleph::Gen_Polynomial< Coefficient >::yun_sfd().
|
inlinenoexcept |
True if leading coefficient equals 1.
Definition at line 578 of file tpl_polynomial.H.
References Aleph::and, Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeffs, and Aleph::divide_and_conquer_partition_dp().
|
inlinenoexcept |
True if exactly one non-zero term.
Definition at line 572 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs.
Referenced by TEST().
|
inlinenoexcept |
True if this is the zero polynomial.
Definition at line 542 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs.
Referenced by Aleph::Gen_Polynomial< Coefficient >::add_scaled_shifted(), Aleph::Gen_Polynomial< Coefficient >::cauchy_bound(), Aleph::Gen_Polynomial< Coefficient >::compose(), Aleph::Gen_Polynomial< Coefficient >::count_all_real_roots(), Aleph::Gen_Polynomial< Coefficient >::count_real_roots(), Aleph::Gen_Polynomial< Coefficient >::divmod(), Aleph::Gen_Polynomial< Coefficient >::factor_mod_p(), Aleph::Gen_Polynomial< Coefficient >::factorize(), Aleph::Gen_Polynomial< Coefficient >::gcd(), Aleph::Gen_Polynomial< Coefficient >::lcm(), Aleph::Gen_Polynomial< Coefficient >::mignotte_bound(), Aleph::Gen_Polynomial< Coefficient >::multiply_by_monic_linear(), Aleph::Gen_Polynomial< Coefficient >::nth_derivative(), Aleph::Gen_Polynomial< Coefficient >::operator*(), Aleph::Gen_Polynomial< Coefficient >::primitive_part(), Aleph::Gen_Polynomial< Coefficient >::pseudo_divmod(), Aleph::Gen_Polynomial< Coefficient >::reverse(), Aleph::Gen_Polynomial< Coefficient >::square_free(), Aleph::Gen_Polynomial< Coefficient >::sturm_chain(), TEST(), TEST(), TEST(), TEST(), TEST(), Aleph::Gen_Polynomial< Coefficient >::to_dense(), Aleph::Gen_Polynomial< Coefficient >::to_monic(), Aleph::Gen_Polynomial< Coefficient >::try_extract_primitive_cubic_factor(), Aleph::Gen_Polynomial< Coefficient >::try_extract_primitive_quadratic_factor(), and Aleph::Gen_Polynomial< Coefficient >::xgcd().
|
inlinestatic |
Least common multiple.
\(\text{lcm}(a, b) = \frac{a \cdot b}{\gcd(a, b)}\).
| [in] | a | First polynomial. |
| [in] | b | Second polynomial. |
Definition at line 1221 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::gcd(), and Aleph::Gen_Polynomial< Coefficient >::is_zero().
|
inlinenoexcept |
Leading coefficient (of the highest-degree term).
Definition at line 596 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs, and Aleph::divide_and_conquer_partition_dp().
Referenced by Aleph::Gen_Polynomial< Coefficient >::_integer_exact_quot(), Aleph::Gen_Polynomial< Coefficient >::cauchy_bound(), Aleph::Gen_Polynomial< Coefficient >::content(), Aleph::Gen_Polynomial< Coefficient >::divmod(), Aleph::Gen_Polynomial< Coefficient >::factorize(), Aleph::Gen_Polynomial< Coefficient >::gcd(), Aleph::Gen_Polynomial< Coefficient >::primitive_part(), Aleph::Gen_Polynomial< Coefficient >::pseudo_divmod(), TEST(), Aleph::Gen_Polynomial< Coefficient >::to_monic(), and Aleph::Gen_Polynomial< Coefficient >::xgcd().
|
inline |
Mignotte bound on integer roots.
For an integer polynomial of degree \(d\) with coefficients \(a_0, \ldots, a_d\), any rational root \(p/q\) with gcd(p,q)=1 satisfies:
\[ |p| \le \sqrt{d+1} \cdot 2^d \cdot \max_i |a_i| \]
Definition at line 2569 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::Gen_Polynomial< Coefficient >::degree(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), and Aleph::polynomial_detail::power().
|
inline |
Evaluate at multiple points.
| [in] | points | List of evaluation points. |
Definition at line 711 of file tpl_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::eval(), and FunctionalMethods< Container, T >::for_each().
|
inlineprivate |
Specialized multiplication by a monic linear factor \(x + c\).
Definition at line 343 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::add_to_coeff(), Aleph::Gen_Polynomial< Coefficient >::coeffs, and Aleph::Gen_Polynomial< Coefficient >::is_zero().
Referenced by Aleph::Gen_Polynomial< Coefficient >::from_roots().
|
inline |
Argument negation: \(p(-x)\).
Negates coefficients of odd-degree terms.
Definition at line 1321 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs.
Referenced by root_analysis(), TEST(), and TEST().
|
inline |
Find a root by Newton-Raphson iteration.
| [in] | x0 | Initial guess. |
| [in] | tol | Convergence tolerance (default \(10^{-12}\)). |
| [in] | max_iter | Maximum iterations (default 100). |
| std::domain_error | if derivative vanishes during iteration. |
Definition at line 1710 of file tpl_polynomial.H.
References ah_domain_error_if, Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::derivative(), Aleph::divide_and_conquer_partition_dp(), and Aleph::Gen_Polynomial< Coefficient >::eval().
Referenced by root_analysis(), TEST(), TEST(), and TEST().
|
inline |
\(n\)-th derivative \(p^{(n)}(x)\).
Applies the derivative operator n times. Returns the zero polynomial if \(n > \deg(p)\).
| [in] | n | Differentiation order. |
n-th derivative.Definition at line 1010 of file tpl_polynomial.H.
References Aleph::and, Aleph::Gen_Polynomial< Coefficient >::derivative(), Aleph::divide_and_conquer_partition_dp(), and Aleph::Gen_Polynomial< Coefficient >::is_zero().
Referenced by calculus_example(), and TEST().
|
inlinenoexcept |
Number of non-zero terms.
Definition at line 560 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs.
Referenced by Aleph::Gen_Polynomial< Coefficient >::eval(), Aleph::Gen_Polynomial< Coefficient >::operator*(), sparse_polynomials(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinestatic |
The constant polynomial 1.
Definition at line 447 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), and Aleph::divide_and_conquer_partition_dp().
Referenced by TEST().
|
inlinenoexcept |
Inequality comparison.
Definition at line 1803 of file tpl_polynomial.H.
References Aleph::divide_and_conquer_partition_dp().
|
inline |
Polynomial remainder.
Definition at line 956 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::divmod().
|
inline |
In-place polynomial remainder.
Definition at line 969 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::divmod().
|
inline |
Syntactic sugar: p(x) calls eval.
Definition at line 697 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::eval().
|
inline |
Multiply by a scalar.
Definition at line 857 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeffs, and Aleph::divide_and_conquer_partition_dp().
|
inline |
Polynomial multiplication.
Definition at line 822 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::add_to_coeff(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), and Aleph::Gen_Polynomial< Coefficient >::num_terms().
|
inline |
In-place scalar multiplication.
Definition at line 873 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::scale_inplace().
|
inline |
In-place multiplication.
Definition at line 850 of file tpl_polynomial.H.
|
inline |
Add a scalar constant term.
Definition at line 763 of file tpl_polynomial.H.
|
inline |
Polynomial addition.
Definition at line 738 of file tpl_polynomial.H.
|
inline |
In-place addition of a scalar constant term.
Definition at line 771 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::add_to_coeff().
|
inline |
In-place addition.
Definition at line 746 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::add_to_coeff(), Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), and Aleph::Gen_Polynomial< Coefficient >::scale_inplace().
|
inline |
Unary negation.
Definition at line 726 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs.
|
inline |
Subtract a scalar constant term.
Definition at line 803 of file tpl_polynomial.H.
|
inline |
Polynomial subtraction.
Definition at line 778 of file tpl_polynomial.H.
|
inline |
In-place subtraction of a scalar constant term.
Definition at line 811 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::add_to_coeff().
|
inline |
In-place subtraction.
Definition at line 786 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::add_to_coeff(), Aleph::Gen_Polynomial< Coefficient >::coeffs, and Aleph::divide_and_conquer_partition_dp().
|
inline |
Divide by a scalar.
| std::domain_error | if s is zero. |
Definition at line 882 of file tpl_polynomial.H.
References ah_domain_error_if, Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeffs, and Aleph::divide_and_conquer_partition_dp().
|
inline |
Polynomial quotient.
Definition at line 950 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::divmod().
|
inline |
In-place scalar division.
Definition at line 897 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::divide_scalar_inplace().
|
inline |
In-place polynomial quotient.
Definition at line 962 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::divmod().
|
inlinenoexcept |
Equality comparison.
Two polynomials are equal iff they have the same non-zero terms. For floating-point types, coefficients are compared within epsilon.
Definition at line 1750 of file tpl_polynomial.H.
References Aleph::and, Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeffs, and Aleph::divide_and_conquer_partition_dp().
|
inline |
Coefficient at exponent exp (0 if absent).
Definition at line 588 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeff_at(), and exp().
|
inlinestatic |
Definition at line 2198 of file tpl_polynomial.H.
References Aleph::polynomial_detail::abs_to_u64(), Aleph::DynList< T >::append(), and Aleph::divide_and_conquer_partition_dp().
Referenced by Aleph::Gen_Polynomial< Coefficient >::try_extract_primitive_cubic_factor(), Aleph::Gen_Polynomial< Coefficient >::try_extract_primitive_quadratic_factor(), and Aleph::Gen_Polynomial< Coefficient >::try_extract_rational_linear_factor().
|
inline |
Exponentiation \(p(x)^n\) by repeated squaring.
| [in] | n | Exponent. |
n == 0). Definition at line 1127 of file tpl_polynomial.H.
References Aleph::divide_and_conquer_partition_dp().
Referenced by algebraic_transformations(), Aleph::Gen_Polynomial< Coefficient >::compose(), TEST(), TEST(), and TEST().
|
inline |
Primitive part: polynomial divided by its content.
Returns \(p / \text{content}(p)\). For a non-zero polynomial, the result has leading coefficient positive (in absolute value).
Definition at line 1987 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::Gen_Polynomial< Coefficient >::content(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), Aleph::Gen_Polynomial< Coefficient >::leading_coeff(), and Aleph::Gen_Polynomial< Coefficient >::scale_inplace().
Referenced by Aleph::Gen_Polynomial< Coefficient >::factorize(), Aleph::Gen_Polynomial< Coefficient >::integer_gcd(), TEST(), TEST(), TEST(), Aleph::Gen_Polynomial< Coefficient >::try_extract_primitive_cubic_factor(), Aleph::Gen_Polynomial< Coefficient >::try_extract_primitive_quadratic_factor(), and Aleph::Gen_Polynomial< Coefficient >::yun_sfd().
|
inline |
Pseudo-division for non-field coefficient types.
Computes q, r such that \(\text{lc}(d)^{\deg(a)-\deg(d)+1} \cdot a = q \cdot d + r\). No division of coefficients is performed, so this works correctly over integer rings.
| [in] | d | Divisor (must not be zero). |
| std::domain_error | if d is zero. |
Definition at line 1240 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::add_to_coeff(), ah_domain_error_if, Aleph::Gen_Polynomial< Coefficient >::degree(), Aleph::divide_and_conquer_partition_dp(), exp(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), Aleph::Gen_Polynomial< Coefficient >::leading_coeff(), Aleph::polynomial_detail::power(), r, and Aleph::Gen_Polynomial< Coefficient >::scale_inplace().
Referenced by Aleph::Gen_Polynomial< Coefficient >::integer_gcd(), and TEST().
|
inlinestatic |
Definition at line 2135 of file tpl_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), exp(), and Aleph::Gen_Polynomial< Coefficient >::for_each_term().
Referenced by Aleph::Gen_Polynomial< Coefficient >::factor_mod_p().
|
inlineprivate |
Remove all entries whose coefficient is (approximately) zero.
Definition at line 204 of file tpl_polynomial.H.
References Aleph::DynList< T >::append(), Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeffs, and FunctionalMethods< Container, T >::for_each().
|
inline |
Reciprocal polynomial: \(x^d \cdot p(1/x)\).
Reverses the coefficient sequence. If \(p(x) = \sum c_i x^i\), the reciprocal is \(\sum c_i x^{d-i}\) where \(d = \deg(p)\).
Definition at line 1303 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::Gen_Polynomial< Coefficient >::degree(), and Aleph::Gen_Polynomial< Coefficient >::is_zero().
Referenced by algebraic_transformations(), and TEST().
|
inlineprivate |
Multiply every coefficient in place by a scalar.
Definition at line 269 of file tpl_polynomial.H.
References Aleph::DynList< T >::append(), Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), exp(), and FunctionalMethods< Container, T >::for_each().
Referenced by Aleph::Gen_Polynomial< Coefficient >::operator*=(), Aleph::Gen_Polynomial< Coefficient >::operator+=(), Aleph::Gen_Polynomial< Coefficient >::primitive_part(), and Aleph::Gen_Polynomial< Coefficient >::pseudo_divmod().
|
inline |
Set coefficient at exponent; removes entry if zero.
| [in] | exp | Exponent of the term. |
| [in] | c | The coefficient value. |
Definition at line 1934 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), Aleph::Gen_Polynomial< Coefficient >::coeff_ptr(), Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), and exp().
Referenced by Aleph::Gen_Polynomial< Coefficient >::divide_by_monic_linear_mod(), Aleph::Gen_Polynomial< Coefficient >::factor_mod_p(), Aleph::Gen_Polynomial< Coefficient >::hensel_lift(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::homomorphic_eval(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), Aleph::Gen_Polynomial< Coefficient >::try_extract_primitive_cubic_factor(), and Aleph::Gen_Polynomial< Coefficient >::try_extract_primitive_quadratic_factor().
|
inline |
Taylor shift: \(p(x + k)\).
Computed via composition with the linear polynomial \(x + k\).
| [in] | k | Shift amount. |
Definition at line 1342 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::compose(), Aleph::divide_and_conquer_partition_dp(), and k.
Referenced by Aleph::Gen_Polynomial< Coefficient >::add_scaled_shifted(), algebraic_transformations(), Aleph::Gen_Polynomial< Coefficient >::divmod(), TEST(), and TEST().
|
inline |
Divide by \(x^k\) (shift exponents down).
Terms with exponent less than k are discarded (floor division).
| [in] | k | Number of positions to shift down. |
Definition at line 1372 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs, and k.
|
inline |
Multiply by \(x^k\) (shift exponents up).
| [in] | k | Number of positions to shift up. |
Definition at line 1352 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs, and k.
|
inline |
Count sign changes in the coefficient sequence.
By Descartes' rule, the number of positive real roots (with multiplicity) is at most the number of sign changes and has the same parity.
Definition at line 1504 of file tpl_polynomial.H.
References Aleph::and, Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), and Aleph::Gen_Polynomial< Coefficient >::epsilon().
Referenced by root_analysis(), and TEST().
|
inline |
Evaluate \(p(x)\) using sparse evaluation.
Each non-zero term \(c \cdot x^e\) is computed via fast exponentiation. Complexity: \(O(k \log d)\) where \(k\) is the number of terms and \(d\) is the degree.
| [in] | x | Evaluation point. |
Definition at line 663 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), and Aleph::polynomial_detail::power().
Referenced by Aleph::Gen_Polynomial< Coefficient >::eval().
|
inline |
Square-free part: \(p / \gcd(p, p')\).
Removes repeated root factors. For example, if \(p(x) = (x-1)^3 (x-2)\), the square-free part is \((x-1)(x-2)\).
Definition at line 1437 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::derivative(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::gcd(), Aleph::Gen_Polynomial< Coefficient >::is_constant(), and Aleph::Gen_Polynomial< Coefficient >::is_zero().
Referenced by algebraic_transformations(), TEST(), and TEST().
|
inline |
Sturm sequence of this polynomial.
The Sturm chain \(p_0 = p, p_1 = p', p_{i+1} = -\text{rem}(p_{i-1}, p_i)\) is used to count distinct real roots in an interval.
Definition at line 1549 of file tpl_polynomial.H.
References Aleph::DynList< T >::append(), Aleph::Gen_Polynomial< Coefficient >::derivative(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::is_constant(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), and r.
Referenced by Aleph::Gen_Polynomial< Coefficient >::count_real_roots(), and TEST().
|
inlinestatic |
Count sign changes in a Sturm chain at a given point.
| [in] | chain | Sturm chain (from sturm_chain()). |
| [in] | x | Evaluation point. |
Definition at line 1579 of file tpl_polynomial.H.
References Aleph::and, Aleph::Gen_Polynomial< Coefficient >::coeff_is_zero(), and Aleph::divide_and_conquer_partition_dp().
Referenced by Aleph::Gen_Polynomial< Coefficient >::count_real_roots().
|
inline |
All non-zero terms as a sorted list of (exponent, coefficient).
Definition at line 1827 of file tpl_polynomial.H.
References Aleph::DynList< T >::append(), and Aleph::Gen_Polynomial< Coefficient >::coeffs.
Referenced by TEST().
|
inline |
Dense coefficient vector.
Returns an Array of size \(d + 1\) (or empty for zero polynomial) containing all coefficients in ascending exponent order, zero-filled for absent terms.
Definition at line 1411 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::Gen_Polynomial< Coefficient >::degree(), Aleph::divide_and_conquer_partition_dp(), and Aleph::Gen_Polynomial< Coefficient >::is_zero().
|
inline |
Make monic: divide by leading coefficient.
| std::domain_error | if zero polynomial. |
Definition at line 1292 of file tpl_polynomial.H.
References ah_domain_error_if, Aleph::Gen_Polynomial< Coefficient >::is_zero(), and Aleph::Gen_Polynomial< Coefficient >::leading_coeff().
Referenced by TEST().
|
inline |
Human-readable string representation.
Uses descending exponent order with mathematical sign conventions: "3x^2 + 2x - 1", "x^3 - x", "5", "0".
| [in] | var | Variable name (default "x"). |
Definition at line 1861 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs, Aleph::divide_and_conquer_partition_dp(), exp(), and Aleph::Gen_Polynomial< Coefficient >::for_each_term_desc().
Referenced by Aleph::operator<<(), TEST(), TEST(), and TEST().
|
inline |
Truncate to degree less than n.
Keeps only terms with exponent strictly less than n, i.e., computes \(p(x) \bmod x^n\).
| [in] | n | Truncation order. |
Definition at line 1393 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::coeffs.
|
inlinestatic |
Definition at line 2245 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::degree(), Aleph::divide_and_conquer_partition_dp(), exp(), and k.
Referenced by Aleph::Gen_Polynomial< Coefficient >::factorize(), and Aleph::Gen_Polynomial< Coefficient >::try_extract_rational_linear_factor().
|
inlinestatic |
Try exact division but treat inexact integral division as a rejected candidate.
Exhaustive integer factor searches intentionally test many polynomials that are not actual divisors. After hardening divmod() to throw on inexact leading-coefficient division, these search paths must convert that condition back into a simple "candidate does not divide" result.
Definition at line 2226 of file tpl_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), and r.
Referenced by Aleph::Gen_Polynomial< Coefficient >::try_extract_primitive_cubic_factor(), and Aleph::Gen_Polynomial< Coefficient >::try_extract_primitive_quadratic_factor().
|
inlinestatic |
Try to extract an exact primitive cubic factor over \(\mathbb{Z}\).
Exhaustively searches primitive cubic candidates \(a x^3 + b x^2 + c x + d\) such that \(a\) divides the leading coefficient and \(d\) divides the constant term. Candidate coefficients are bounded with a Landau-Mignotte style estimate, and each candidate is verified by exact division.
Definition at line 2424 of file tpl_polynomial.H.
References Aleph::polynomial_detail::abs_to_u64(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), Aleph::Gen_Polynomial< Coefficient >::positive_divisors(), Aleph::Gen_Polynomial< Coefficient >::primitive_part(), Aleph::Gen_Polynomial< Coefficient >::set_coeff(), and Aleph::Gen_Polynomial< Coefficient >::try_exact_candidate_division().
Referenced by Aleph::Gen_Polynomial< Coefficient >::factorize().
|
inlinestatic |
Try to extract an exact primitive quadratic factor over \(\mathbb{Z}\).
Exhaustively searches primitive quadratic candidates \(a x^2 + b x + c\) such that \(a\) divides the leading coefficient and \(c\) divides the constant term. Candidate linear coefficients are bounded using a Cauchy-style root bound and verified by exact polynomial division.
Definition at line 2343 of file tpl_polynomial.H.
References Aleph::polynomial_detail::abs_to_u64(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), Aleph::Gen_Polynomial< Coefficient >::positive_divisors(), Aleph::Gen_Polynomial< Coefficient >::primitive_part(), Aleph::Gen_Polynomial< Coefficient >::set_coeff(), and Aleph::Gen_Polynomial< Coefficient >::try_exact_candidate_division().
Referenced by Aleph::Gen_Polynomial< Coefficient >::factorize().
|
inlinestatic |
Definition at line 2285 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::polynomial_detail::abs_to_u64(), Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::positive_divisors(), and Aleph::Gen_Polynomial< Coefficient >::try_divide_by_linear_factor().
Referenced by Aleph::Gen_Polynomial< Coefficient >::factorize().
|
inlinestatic |
The monomial \(x^n\).
| [in] | n | Exponent. |
Definition at line 455 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), and Aleph::divide_and_conquer_partition_dp().
Referenced by TEST().
|
inlinestatic |
Definition at line 1184 of file tpl_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Polynomial< Coefficient >::divmod(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), Aleph::Gen_Polynomial< Coefficient >::leading_coeff(), and r.
Referenced by algebraic_transformations(), TEST(), and TEST().
|
inline |
Yun's square-free decomposition (SFD).
Decomposes a polynomial into square-free factors with multiplicities. Each factor has no repeated roots, and the union of all factors (with multiplicity) reconstructs the original.
Uses Yun's algorithm:
Definition at line 2065 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::_integer_exact_quot(), Aleph::DynList< T >::append(), Aleph::Gen_Polynomial< Coefficient >::derivative(), Aleph::divide_and_conquer_partition_dp(), h, Aleph::Gen_Polynomial< Coefficient >::integer_gcd(), Aleph::Gen_Polynomial< Coefficient >::is_constant(), Aleph::Gen_Polynomial< Coefficient >::primitive_part(), and w.
|
inlinestatic |
The zero polynomial.
Definition at line 441 of file tpl_polynomial.H.
References Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial().
Referenced by TEST().
|
private |
Definition at line 173 of file tpl_polynomial.H.
Referenced by Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::Gen_Polynomial(), Aleph::Gen_Polynomial< Coefficient >::_integer_exact_quot(), Aleph::Gen_Polynomial< Coefficient >::add_to_coeff(), Aleph::Gen_Polynomial< Coefficient >::cauchy_bound(), Aleph::Gen_Polynomial< Coefficient >::coeff_at(), Aleph::Gen_Polynomial< Coefficient >::coeff_ptr(), Aleph::Gen_Polynomial< Coefficient >::coeff_ptr(), Aleph::Gen_Polynomial< Coefficient >::coefficients(), Aleph::Gen_Polynomial< Coefficient >::content(), Aleph::Gen_Polynomial< Coefficient >::definite_integral(), Aleph::Gen_Polynomial< Coefficient >::degree(), Aleph::Gen_Polynomial< Coefficient >::derivative(), Aleph::Gen_Polynomial< Coefficient >::divide_scalar_inplace(), Aleph::Gen_Polynomial< Coefficient >::eval(), Aleph::Gen_Polynomial< Coefficient >::exponents(), Aleph::Gen_Polynomial< Coefficient >::for_each_term(), Aleph::Gen_Polynomial< Coefficient >::for_each_term_desc(), Aleph::Gen_Polynomial< Coefficient >::has_term(), Aleph::Gen_Polynomial< Coefficient >::horner_eval(), Aleph::Gen_Polynomial< Coefficient >::is_constant(), Aleph::Gen_Polynomial< Coefficient >::is_monic(), Aleph::Gen_Polynomial< Coefficient >::is_monomial(), Aleph::Gen_Polynomial< Coefficient >::is_zero(), Aleph::Gen_Polynomial< Coefficient >::leading_coeff(), Aleph::Gen_Polynomial< Coefficient >::mignotte_bound(), Aleph::Gen_Polynomial< Coefficient >::multiply_by_monic_linear(), Aleph::Gen_Polynomial< Coefficient >::negate_arg(), Aleph::Gen_Polynomial< Coefficient >::num_terms(), Aleph::Gen_Polynomial< Coefficient >::operator*(), Aleph::Gen_Polynomial< Coefficient >::operator+=(), Aleph::Gen_Polynomial< Coefficient >::operator-(), Aleph::Gen_Polynomial< Coefficient >::operator-=(), Aleph::Gen_Polynomial< Coefficient >::operator/(), Aleph::Gen_Polynomial< Coefficient >::operator==(), Aleph::Gen_Polynomial< Coefficient >::primitive_part(), Aleph::Gen_Polynomial< Coefficient >::remove_zeros(), Aleph::Gen_Polynomial< Coefficient >::reverse(), Aleph::Gen_Polynomial< Coefficient >::scale_inplace(), Aleph::Gen_Polynomial< Coefficient >::set_coeff(), Aleph::Gen_Polynomial< Coefficient >::shift_down(), Aleph::Gen_Polynomial< Coefficient >::shift_up(), Aleph::Gen_Polynomial< Coefficient >::sign_variations(), Aleph::Gen_Polynomial< Coefficient >::sparse_eval(), Aleph::Gen_Polynomial< Coefficient >::terms_list(), Aleph::Gen_Polynomial< Coefficient >::to_dense(), Aleph::Gen_Polynomial< Coefficient >::to_str(), and Aleph::Gen_Polynomial< Coefficient >::truncate().