nabled_core/lib.rs
1//! Core shared types and utilities for the `nabled` workspace.
2//!
3//! `nabled-core` is the common substrate used by `nabled-linalg` and
4//! `nabled-ml`. It intentionally stays lightweight and focused on:
5//!
6//! 1. Shared error taxonomy (`ShapeError`, `NabledError`, `IntoNabledError`).
7//! 2. Reusable shape/validation helpers over ndarray inputs.
8//! 3. Prelude exports for ndarray and complex number types.
9//!
10//! # Main Modules
11//!
12//! 1. [`errors`]: shared error contracts used across workspace crates.
13//! 2. [`validation`]: reusable ndarray validation helpers.
14//! 3. [`prelude`]: common array and complex-number type exports.
15//!
16//! # Example
17//!
18//! ```rust
19//! use ndarray::{arr1, arr2};
20//! use nabled_core::validation::validate_square_system;
21//!
22//! let a = arr2(&[[2.0_f64, 1.0], [1.0, 2.0]]);
23//! let b = arr1(&[1.0_f64, 1.0]);
24//! validate_square_system(&a, &b)?;
25//! # Ok::<(), nabled_core::errors::ShapeError>(())
26//! ```
27
28pub mod errors;
29pub mod prelude {
30 pub use ndarray::{
31 Array, Array1, Array2, Array3, ArrayD, ArrayView1, ArrayView2, ArrayView3, ArrayViewMut1,
32 ArrayViewMut2, ArrayViewMut3,
33 };
34 pub use num_complex::{Complex32, Complex64};
35}
36pub mod validation;