use-geode
Install
[]
= "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.
| 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 ;
let vector = new?;
assert_eq!;
assert_eq!;
assert_eq!;
# Ok::
Compute hyper-Catalan and Geode coefficients
use ;
let vector = new?;
assert_eq!;
assert_eq!;
assert_eq!;
# Ok::
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.