AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
polynomial_solvers.hpp File Reference
#include "axom/core/Array.hpp"
#include "axom/core/ArrayView.hpp"
#include <complex>
#include <type_traits>

Classes

struct  axom::numerics::PolynomialRootResult
 Result metadata for an all-roots polynomial solve. More...
 

Namespaces

 axom
 
 axom::numerics
 

Functions

template<typename ScalarType >
ScalarType axom::numerics::evaluate_polynomial (ArrayView< const double > coeffs_descending, const ScalarType &x)
 Evaluate a polynomial with coefficients stored in descending power order. More...
 
axom::Array< double > axom::numerics::bernstein_to_monomial (ArrayView< const double > bernstein_coeffs)
 Convert Bernstein coefficients to monomial coefficients on [0, 1]. More...
 
int axom::numerics::effective_polynomial_degree (ArrayView< const double > coeffs_ascending, double tol=1e-12)
 Return the effective degree of a polynomial after trimming near-zero leading coefficients. More...
 
axom::Array< std::complex< double > > axom::numerics::solve_polynomial_durand_kerner (ArrayView< const double > coeffs_ascending, double tol=1e-12, std::complex< double > seed=std::complex< double > {0.4, 0.9})
 Approximate all roots of a polynomial using the Durand-Kerner method. More...
 
PolynomialRootResult axom::numerics::solve_polynomial_durand_kerner_checked (ArrayView< const double > coeffs_ascending, double tol=1e-12, int max_iters=200, std::complex< double > seed=std::complex< double > {0.4, 0.9})
 Approximate all roots of a polynomial using the Durand-Kerner method, including convergence diagnostics. More...
 
int axom::numerics::solve_linear (ArrayView< const double > coeff, ArrayView< double > roots, int &numRoots)
 Find the real root for a linear equation of form \( ax + b = 0 \). More...
 
int axom::numerics::solve_linear (const double *coeff, double *roots, int &numRoots)
 Deprecated pointer-based overload for solve_linear(ArrayView<const double>, ArrayView<double>, int&). More...
 
int axom::numerics::solve_quadratic (ArrayView< const double > coeff, ArrayView< double > roots, int &numRoots)
 For a quadratic equation of the form \( ax^2 + bx + c = 0 \), find real roots using the quadratic formula. More...
 
int axom::numerics::solve_quadratic (const double *coeff, double *roots, int &numRoots)
 Deprecated pointer-based overload for solve_quadratic(ArrayView<const double>, ArrayView<double>, int&). More...
 
int axom::numerics::solve_cubic (ArrayView< const double > coeff, ArrayView< double > roots, int &numRoots)
 For a cubic equation of the form \( ax^3 + bx^2 + cx + d = 0 \), find real roots. More...
 
int axom::numerics::solve_cubic (const double *coeff, double *roots, int &numRoots)
 Deprecated pointer-based overload for solve_cubic(ArrayView<const double>, ArrayView<double>, int&). More...