Expand description
§use-geode
Geode-array primitives for `RustUse`: finite type vectors, hyper-Catalan coefficients, polygon subdivision counts, and small exact Geode coefficient calculations.
Checked `u128` helpers for small exact Geode-array and hyper-Catalan workflows.
§Install
[dependencies]
use-geode = "0.0.1"§Foundation
use-geode provides a deliberately small exact-counting surface for finite type vectors [m2, m3, m4, ...], hyper-Catalan coefficients, and Geode coefficients defined by the factorization S - 1 = (t2 + t3 + t4 + ...) * G. The crate focuses on primitive u128 computations, small recursive Geode values, and structural polygon counts derived from a type vector.
This crate provides small, exact, educational and computational primitives inspired by the Geode series. It does not claim to implement the full theory, optimized large-scale Geode computation, or a closed form for the general Geode coefficient.
Finite type vectorsTypeVector models finite vectors such as [m2, m3, m4, ...] with checked index updates and explicit trimming.
|
Exact countinghyper_catalan, geode, and geode_memoized use exact checked integer arithmetic instead of floating-point approximations.
|
Small-scale helpers Polygon edge and vertex counts plus a few axis and diagonal helpers keep the crate useful without turning it into a symbolic series engine. |
| Helper group | Primary items | Best fit |
|---|---|---|
| Type vectors | TypeVector, face_count | Modeling small finite hyper-Catalan index vectors |
| Structural counts | polygon_edge_count, polygon_vertex_count | Exact subdivision counts derived from a type vector |
| Hyper-Catalan counts | hyper_catalan, catalan_from_geode_dimension | Exact coefficients for small hyper-Catalan workflows |
| Geode coefficients | geode, geode_memoized, geode_on_first_axis, diagonal helpers | Small recursive Geode-array calculations with checked arithmetic |
| Checked integer helpers | checked_factorial, checked_product_factorials, exact_divide, GeodeError | Call sites that need explicit overflow and divisibility failures instead of panicking |
§When to use directly
Choose use-geode directly when you want a small exact surface for Geode-array primitives and hyper-Catalan vectors without pulling in the wider facade crate.
| Scenario | Use use-geode directly? | Why |
|---|---|---|
| You need exact small hyper-Catalan coefficients | Yes | The crate keeps the type-vector and coefficient surface narrow and explicit |
| You need small recursive Geode coefficients | Yes | The crate exposes direct checked helpers plus memoization for the same recurrence |
| You need broad math APIs beyond Geode-style counting | Usually no | use-math can compose this crate with the other focused math crates |
| You need large-scale symbolic or asymptotic Geode computation | No | That is intentionally outside the crate’s scope |
§Scope
- This crate is about Geode arrays, hyper-Catalan coefficients, and small exact coefficient calculations.
- It is not geodesy, GIS, geospatial geometry, or coordinate-distance math.
- Calculations stay in checked
u128arithmetic and returnGeodeErrorvalues on overflow or invalid exact division. - Recursive Geode helpers are intended for small exact inputs, not large-scale enumeration or symbolic algebra.
§Examples
§Build a type vector and inspect its counts
use use_geode::{TypeVector, face_count, polygon_edge_count, polygon_vertex_count};
let vector = TypeVector::new(vec![2, 1])?;
assert_eq!(face_count(&vector), 3);
assert_eq!(polygon_edge_count(&vector)?, 8);
assert_eq!(polygon_vertex_count(&vector)?, 6);
§Compute hyper-Catalan and Geode coefficients
use use_geode::{TypeVector, geode, geode_memoized, hyper_catalan};
let vector = TypeVector::new(vec![0, 1])?;
assert_eq!(hyper_catalan(&vector)?, 1);
assert_eq!(geode(&vector)?, 3);
assert_eq!(geode_memoized(&vector)?, 3);
§Status
use-geode is a concrete pre-1.0 crate in the RustUse math workspace. The current surface is intentionally small, exact, and focused on finite Geode-array primitives rather than full formal-series machinery.
Geode-array primitives for RustUse.
Re-exports§
pub use error::GeodeError;pub use geode::TypeVector;pub use geode::catalan_from_geode_dimension;pub use geode::checked_factorial;pub use geode::checked_product_factorials;pub use geode::diagonal_geode_2d;pub use geode::diagonal_geode_3d;pub use geode::diagonal_geode_4d;pub use geode::exact_divide;pub use geode::face_count;pub use geode::geode;pub use geode::geode_memoized;pub use geode::geode_on_first_axis;pub use geode::hyper_catalan;pub use geode::polygon_edge_count;pub use geode::polygon_vertex_count;