Crate axiolid_numeric

Source
Expand description

Shared numeric substrate: root finding, quadrature, dense linear algebra and least squares, and minimisation over f64.

These are the general numeric routines geometry algorithms build on – curve and surface fitting, fairing, projection and inversion – in one place instead of re-derived inline. The reference designs are OCCT’s math package, QUADPACK, Brent (1973) and MINPACK.

NeedRoutine
a root of f between two points of opposite signfind_root
every real root of a polynomial in an intervalPolynomial::real_roots
integral f with an error estimateintegrate
fixed Gauss rule for an integrand of known degreeGaussLegendre
square systemLu
symmetric positive definite systemCholesky
large sparse symmetric positive definite systemconjugate_gradient on a SparseMatrix
linear least squares, rankQr, least_squares
least squares with equality constraintsconstrained_least_squares
nonlinear least squares, nonlinear equationslevenberg_marquardt
minimum of f on an intervalminimize_scalar

§Contract

  • Non-finite input is refused by name (NumericError::NonFiniteInput), as is a non-finite value from a caller’s function.
  • Every answer says how far it can be trusted: a bracket that contains the root, an error estimate, a condition estimate, or an explicitly unresolved region. Which of these is a proven bound and which is an estimate is stated on each field.
  • Iterative routines report a Status. One that ran out of budget still returns its best value and estimate; its converged() accessor turns that into NumericError::NotConverged for callers that only accept a met tolerance.
  • Singular, rank-deficient, non-symmetric and indefinite matrices are refused, never solved into infinities.

There are no geometry types here and no dependencies: values are plain f64 slices, a small row-major Matrix and a compressed-row SparseMatrix.

Re-exports§

pub use error::NumericError;
pub use error::NumericResult;
pub use error::Status;
pub use linalg::constrained_least_squares;
pub use linalg::least_squares;
pub use linalg::Cholesky;
pub use linalg::ConstrainedSolution;
pub use linalg::LeastSquaresSolution;
pub use linalg::LinearSolution;
pub use linalg::Lu;
pub use linalg::Matrix;
pub use linalg::Qr;
pub use optimize::levenberg_marquardt;
pub use optimize::minimize_scalar;
pub use optimize::LeastSquaresMinimum;
pub use optimize::LevenbergMarquardtOptions;
pub use optimize::Residuals;
pub use optimize::ScalarMinimum;
pub use optimize::Termination;
pub use poly::Polynomial;
pub use poly::PolynomialRoot;
pub use poly::RootKind;
pub use quad::integrate;
pub use quad::GaussLegendre;
pub use quad::Integral;
pub use quad::IntegrationOptions;
pub use root::find_root;
pub use root::Root;
pub use sparse::conjugate_gradient;
pub use sparse::ConjugateGradientOptions;
pub use sparse::ConjugateGradientSolution;
pub use sparse::SparseMatrix;

Modules§

error
Refusals and convergence status shared by every routine.
linalg
Dense linear algebra for small and medium systems.
optimize
Minimisation: a bounded scalar minimiser and damped Gauss-Newton (Levenberg-Marquardt) for nonlinear least squares.
poly
Real polynomials in the power basis and all their real roots in an interval.
quad
Numerical integration of a scalar function over a finite interval.
root
Bracketed scalar root finding with guaranteed convergence.
sparse
Sparse matrices and the preconditioned conjugate-gradient solve.