implicit_predicates_core/lib.rs
1//! Arithmetic building blocks for exact geometric predicates.
2//!
3//! This is the `no_std`, dependency-free core of the `implicit-predicates`
4//! crates. Most users should depend on `implicit-predicates` instead.
5//!
6//! Currently it provides:
7//!
8//! - [`Sign`], the result type of every predicate;
9//! - [`eft`], error-free transformations: floating-point sums and products
10//! together with their exact rounding errors;
11//! - [`expansion`], exact values represented as sums of `f64` components,
12//! with exact addition, subtraction, scaling and sign;
13//! - [`scratch`], [`Scratch`], a bump arena over a borrowed buffer that holds
14//! the expansions of a computation and runs those operations on them, as
15//! well as the exact product of two expansions.
16//!
17//! The optional `alloc` feature adds an owned arena that grows on the heap,
18//! `Scratch::growable`, so the exact arithmetic can always complete. Without
19//! it nothing allocates.
20//!
21//! **Status: early development.** The API is incomplete and may change.
22
23#![no_std]
24
25#[cfg(feature = "alloc")]
26extern crate alloc;
27
28pub mod eft;
29pub mod expansion;
30pub mod scratch;
31mod sign;
32
33pub use scratch::{Mark, Scratch, ScratchExhausted, Span};
34pub use sign::Sign;