|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Internal helpers for multivariate polynomial operations. More...
Functions | |
| size_t | total_degree (const Array< size_t > &idx) noexcept |
| Total degree of a multi-index (sum of exponents). | |
| bool | is_zero_index (const Array< size_t > &idx) noexcept |
| Test whether a multi-index is the zero vector. | |
| Array< size_t > | add_indices (const Array< size_t > &a, const Array< size_t > &b) |
| Component-wise addition of two multi-indices. | |
| Array< size_t > | extend_index (const Array< size_t > &idx, size_t target) |
Pad a multi-index with trailing zeros to reach target size. | |
| template<typename T > | |
| T | int_power (const T &base, size_t exp) |
| Integer power by repeated squaring. | |
| Array< size_t > | decrement_index_at (const Array< size_t > &idx, const size_t var, const size_t n=1) |
| Decrement exponent at a specific variable. | |
| template<typename T > | |
| T | falling_factorial (const size_t k, const size_t n) |
| Falling factorial k(k-1)(k-2)...(k-n+1). | |
| Array< size_t > | flat_to_multi_index (size_t flat, const Array< size_t > &sizes) |
| Convert flat index to multi-index given sizes per dimension. | |
| size_t | multi_to_flat_index (const Array< size_t > &midx, const Array< size_t > &sizes) |
| Convert multi-index to flat index given sizes per dimension. | |
| template<typename Coefficient > | |
| Coefficient | eval_monomial (const Array< Coefficient > &pt, const Array< size_t > &alpha) |
| Evaluate monomial at a point (helper for fitting/interpolation). | |
| bool | divides_index (const Array< size_t > &alpha, const Array< size_t > &beta, size_t nvars) noexcept |
| Test whether alpha divides beta component-wise (alpha(i) <= beta(i) all i). | |
| Array< size_t > | lcm_indices (const Array< size_t > &a, const Array< size_t > &b, const size_t nvars) |
| Component-wise max = monomial LCM. | |
| Array< size_t > | sub_indices (const Array< size_t > &beta, const Array< size_t > &alpha, const size_t nvars) |
| Component-wise subtraction beta - alpha (requires alpha divides beta). | |
Internal helpers for multivariate polynomial operations.
|
inline |
Component-wise addition of two multi-indices.
Pads the shorter one with zeros.
Definition at line 94 of file tpl_multi_polynomial.H.
References r, and Aleph::Array< T >::size().
Referenced by Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::operator*().
|
inline |
Decrement exponent at a specific variable.
Definition at line 137 of file tpl_multi_polynomial.H.
References r.
Referenced by Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::partial().
|
inlinenoexcept |
Test whether alpha divides beta component-wise (alpha(i) <= beta(i) all i).
Definition at line 200 of file tpl_multi_polynomial.H.
References Aleph::divide_and_conquer_partition_dp().
Referenced by Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::divmod(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::minimize_groebner_basis(), and Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::redundant_pair_by_chain_criterion().
| Coefficient Aleph::multi_poly_detail::eval_monomial | ( | const Array< Coefficient > & | pt, |
| const Array< size_t > & | alpha | ||
| ) |
Evaluate monomial at a point (helper for fitting/interpolation).
Definition at line 190 of file tpl_multi_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), int_power(), and Aleph::Array< T >::size().
Referenced by Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::fit_parallel().
|
inline |
Pad a multi-index with trailing zeros to reach target size.
Definition at line 106 of file tpl_multi_polynomial.H.
References r, and Aleph::Array< T >::size().
Referenced by Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::norm(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::operator*(), and Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::promote().
Falling factorial k(k-1)(k-2)...(k-n+1).
Definition at line 148 of file tpl_multi_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), and k.
|
inline |
Convert flat index to multi-index given sizes per dimension.
Assumes row-major order (rightmost dimension varies fastest).
Definition at line 163 of file tpl_multi_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), r, and Aleph::Array< T >::size().
Integer power by repeated squaring.
Definition at line 118 of file tpl_multi_polynomial.H.
References exp().
Referenced by Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_eval_monomial(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_substitute_var(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::eval(), eval_monomial(), and Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::homomorphic_eval().
Test whether a multi-index is the zero vector.
Definition at line 83 of file tpl_multi_polynomial.H.
Referenced by Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::is_constant(), and Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::to_str().
|
inline |
Component-wise max = monomial LCM.
Definition at line 213 of file tpl_multi_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), r, and Aleph::Array< T >::size().
Referenced by Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::make_pair_candidate(), and Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::s_poly().
|
inline |
Convert multi-index to flat index given sizes per dimension.
Definition at line 176 of file tpl_multi_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::Array< T >::size().
|
inline |
Component-wise subtraction beta - alpha (requires alpha divides beta).
Definition at line 222 of file tpl_multi_polynomial.H.
References Aleph::divide_and_conquer_partition_dp(), r, and Aleph::Array< T >::size().
Referenced by Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::divmod(), and Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::s_poly().
Total degree of a multi-index (sum of exponents).
Definition at line 74 of file tpl_multi_polynomial.H.
References Aleph::sum().
Referenced by Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::degree(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::make_pair_candidate(), Aleph::Grlex_Order::operator()(), and Aleph::Grevlex_Order::operator()().