|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Sparse multivariate polynomial over an arbitrary coefficient ring. More...
#include <sstream>#include <string>#include <type_traits>#include <limits>#include <cmath>#include <utility>#include <iomanip>#include <future>#include <thread>#include <fstream>#include <numeric>#include <ah-errors.H>#include <ahSort.H>#include <tpl_array.H>#include <tpl_dynBinHeap.H>#include <tpl_dynMapTree.H>#include <htlist.H>#include <ah-parallel.H>#include <tpl_polynomial.H>Go to the source code of this file.
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
| namespace | Aleph::multi_poly_detail |
| Internal helpers for multivariate polynomial operations. | |
Typedefs | |
| using | Aleph::MultiPolynomial = Gen_MultiPolynomial< double, Grevlex_Order > |
| Multivariate polynomial with double coefficients, grevlex. | |
| using | Aleph::MultiPolynomial_Lex = Gen_MultiPolynomial< double, Lex_Order > |
| Multivariate polynomial with lex ordering. | |
| using | Aleph::MultiPolynomial_Grlex = Gen_MultiPolynomial< double, Grlex_Order > |
| Multivariate polynomial with grlex ordering. | |
| using | Aleph::IntMultiPolynomial = Gen_MultiPolynomial< long long, Grevlex_Order > |
| Multivariate polynomial with integer (long long) coefficients, grevlex. | |
| using | Aleph::IntMultiPolynomial_Lex = Gen_MultiPolynomial< long long, Lex_Order > |
| Multivariate polynomial with integer (long long) coefficients, lex. | |
Functions | |
| size_t | Aleph::multi_poly_detail::total_degree (const Array< size_t > &idx) noexcept |
| Total degree of a multi-index (sum of exponents). | |
| bool | Aleph::multi_poly_detail::is_zero_index (const Array< size_t > &idx) noexcept |
| Test whether a multi-index is the zero vector. | |
| Array< size_t > | Aleph::multi_poly_detail::add_indices (const Array< size_t > &a, const Array< size_t > &b) |
| Component-wise addition of two multi-indices. | |
| Array< size_t > | Aleph::multi_poly_detail::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 | Aleph::multi_poly_detail::int_power (const T &base, size_t exp) |
| Integer power by repeated squaring. | |
| Array< size_t > | Aleph::multi_poly_detail::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 | Aleph::multi_poly_detail::falling_factorial (const size_t k, const size_t n) |
| Falling factorial k(k-1)(k-2)...(k-n+1). | |
| Array< size_t > | Aleph::multi_poly_detail::flat_to_multi_index (size_t flat, const Array< size_t > &sizes) |
| Convert flat index to multi-index given sizes per dimension. | |
| size_t | Aleph::multi_poly_detail::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 | Aleph::multi_poly_detail::eval_monomial (const Array< Coefficient > &pt, const Array< size_t > &alpha) |
| Evaluate monomial at a point (helper for fitting/interpolation). | |
| bool | Aleph::multi_poly_detail::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 > | Aleph::multi_poly_detail::lcm_indices (const Array< size_t > &a, const Array< size_t > &b, const size_t nvars) |
| Component-wise max = monomial LCM. | |
| Array< size_t > | Aleph::multi_poly_detail::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). | |
| template<typename C , class M > | |
| PolyFitAnalysis< C > | Aleph::analyze_fit (const Gen_MultiPolynomial< C, M > &poly, const Array< std::pair< Array< C >, C > > &data) |
| Compute residual analysis for a polynomial fit. | |
| template<typename C , class M > | |
| Gen_MultiPolynomial< C, M > | Aleph::operator* (const C &s, const Gen_MultiPolynomial< C, M > &p) |
| Scalar * polynomial (commutative). | |
| template<typename C , class M > | |
| Gen_MultiPolynomial< C, M > | Aleph::operator+ (const C &s, const Gen_MultiPolynomial< C, M > &p) |
| Scalar + polynomial (commutative). | |
| template<typename C , class M > | |
| Gen_MultiPolynomial< C, M > | Aleph::operator- (const C &s, const Gen_MultiPolynomial< C, M > &p) |
| Scalar - polynomial. | |
| template<typename C , class M > | |
| std::ostream & | Aleph::operator<< (std::ostream &out, const Gen_MultiPolynomial< C, M > &p) |
| Stream insertion. | |
Sparse multivariate polynomial over an arbitrary coefficient ring.
Provides Gen_MultiPolynomial<Coefficient, MonomOrder>, a template class representing polynomials in \(n\) variables with a sparse map from multi-index (exponent vector) to coefficient. Three standard monomial orderings are included: lexicographic (Lex_Order), graded lexicographic (Grlex_Order), and graded reverse lexicographic (Grevlex_Order, the default).
Layer 1 of the multivariate polynomial subsystem — covers representation, arithmetic, evaluation, and pretty-printing.
Definition in file tpl_multi_polynomial.H.