Skip to main content

Crate use_geode

Crate use_geode 

Source
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.

Rust 1.95.0+ Edition 2024 Geode arrays License MIT or Apache-2.0

§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 vectors
TypeVector models finite vectors such as [m2, m3, m4, ...] with checked index updates and explicit trimming.
Exact counting
hyper_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 groupPrimary itemsBest fit
Type vectorsTypeVector, face_countModeling small finite hyper-Catalan index vectors
Structural countspolygon_edge_count, polygon_vertex_countExact subdivision counts derived from a type vector
Hyper-Catalan countshyper_catalan, catalan_from_geode_dimensionExact coefficients for small hyper-Catalan workflows
Geode coefficientsgeode, geode_memoized, geode_on_first_axis, diagonal helpersSmall recursive Geode-array calculations with checked arithmetic
Checked integer helperschecked_factorial, checked_product_factorials, exact_divide, GeodeErrorCall 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.

ScenarioUse use-geode directly?Why
You need exact small hyper-Catalan coefficientsYesThe crate keeps the type-vector and coefficient surface narrow and explicit
You need small recursive Geode coefficientsYesThe crate exposes direct checked helpers plus memoization for the same recurrence
You need broad math APIs beyond Geode-style countingUsually nouse-math can compose this crate with the other focused math crates
You need large-scale symbolic or asymptotic Geode computationNoThat 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 u128 arithmetic and return GeodeError values 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;

Modules§

error
geode
prelude