single_utilities/lib.rs
1//! # Single Utilities
2//!
3//! A comprehensive utilities library designed for the SingleRust ecosystem and beyond.
4//! This crate provides fundamental building blocks for mathematical computations,
5//! data processing, and algorithmic operations commonly needed in scientific computing,
6//! machine learning, and data analysis applications.
7//!
8//! ## Overview
9//!
10//! Single Utilities offers a collection of traits and types that abstract common
11//! patterns in numerical computing while maintaining flexibility and performance.
12//! While primarily developed for the SingleRust ecosystem, the library is designed
13//! with modularity and interoperability in mind, making it suitable for use with
14//! other Rust libraries and frameworks.
15//!
16//! ## Features
17//!
18//! ### Traits Module
19//! - **Numeric Operations**: Comprehensive traits for basic and advanced numeric operations
20//! - **Thread Safety**: Thread-safe variants for concurrent and parallel computations
21//! - **SIMD Support**: Optional SIMD-accelerated operations when the "simd" feature is enabled
22//! - **Type Constraints**: Flexible trait bounds for generic mathematical algorithms
23//!
24//! ### Types Module
25//! - **Direction Handling**: Utilities for row/column-oriented operations
26//! - **Distance Metrics**: Common distance functions for similarity calculations
27//! - **Batch Processing**: Identifiers and utilities for batch operations
28//!
29//! ## Usage
30//!
31//! ```rust
32//! use single_utilities::traits::NumericOps;
33//! use single_utilities::types::{Direction, DistanceMetric};
34//!
35//! // Use traits to constrain generic functions
36//! fn process_data<T: NumericOps>(data: &[T]) -> T {
37//! // Your numeric processing logic here
38//! T::zero()
39//! }
40//!
41//! // Use direction for matrix operations
42//! let direction = Direction::ROW;
43//! if direction.is_row() {
44//! // Process row-wise
45//! }
46//! ```
47//!
48//! ## Feature Flags
49//!
50//! - `simd`: Enables SIMD-accelerated operations using the `simba` crate
51//!
52//! ## Compatibility
53//!
54//! This library is designed to work seamlessly with:
55//! - The broader SingleRust ecosystem
56//! - Standard numeric libraries like `num-traits`
57//! - SIMD libraries like `simba` (when feature is enabled)
58//! - Custom mathematical and scientific computing libraries
59
60pub mod traits;
61
62pub mod types;
63
64pub(crate) mod utils;