Skip to content

Repository files navigation

maryada

Crates.io Version docs.rs Codecov GitHub Actions Workflow Status

maryada is a no_std binary64 interval arithmetic library conforming to IEEE Std 1788.1-2017. It provides bare and decorated real intervals, outward-rounded elementary operations, and text and binary interchange. Rectangular complex intervals are available through an optional feature.

The conformance claim applies to the real interval API. The rectangular complex interval extension is outside the scope of the standard. See CONFORMANCE.md for the operation accuracy declarations, required features, implementation details, and test coverage.

use maryada::{Interval, IntervalOps};

let x = Interval::new(1.0, 2.0);
let y = x.sqr();

assert_eq!(y.bounds(), (1.0, 4.0));

Features

  • complex enables the ComplexBox rectangular complex interval API.
  • num-complex enables complex plus interoperability with num_complex::Complex64.
  • linalg enables the linear algebra API, namely IntervalMatrix and its associated operations.
  • complex-linalg enables allocation-backed complex interval matrices and verified complex solves.
  • branch enables the no_std branch-and-bound engine and its allocation-backed work queues.

Complex systems use the same matrix-facing API as real systems. The default verified solve first applies a residual-centered complex epsilon-inflation method and transparently retries through a conservative 2n real embedding when the direct sufficient test does not certify an enclosure. Use try_solve when you need a typed SolveError, or solve for the concise Option form.

The branch feature provides a resumable generic BranchAndBound scheduler, pluggable evaluators, pruners, branching rules, and work queues. Its GlobalMinimizer convenience layer implements best-first interval subdivision; domains can be real intervals, complex boxes, vectors, or custom types that implement Bisect and optionally Midpoint.

Linear algebra has been implemented mostly by following the work of Jaroslav Horáček's dissertation:

@phdthesis{Horacek2019Interval,
  author = {Jaroslav Hor{\'a}{\v c}ek},
  title  = {Interval Linear and Nonlinear Systems},
  school = {Charles University, Faculty of Mathematics and Physics},
  year   = {2019},
  address = {Prague, Czech Republic},
  url    = {https://dspace.cuni.cz/handle/20.500.11956/111301}
}

Future plans

  • Support for alternate complex interval space formulations, like disks and polyarcs
  • Linear algebra methods (a lot of this is done, but there are still some thing I want to add)
  • Potentially a PyO3 binding if I find it useful

Licensing

maryada is available under either the MIT License or the Apache License 2.0.

About

Interval arithmetic in pure #[no_std] Rust

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages