Introduction
Overview
Single-Algebra is a comprehensive library developed for the SingleRust ecosystem to provide essential matrix statistics functionality. Its primary focus is implementing highly optimized sparse algorithms that fill a current gap in the Rust ecosystem. As a companion library for SingleRust, it provides dimensionality reduction, matrix statistics, convenience functions, and singular value decomposition.
The library is still under active development with upcoming features including Variational Auto Encoders, additional SVD methods, and more convenience functions. It serves as one of the core libraries of the SingleRust crate. For more information on the entire ecosystem, visit the Overview Page.
Philosophy
The core philosophy of single-algebra is to provide a unified interface for computational operations while maintaining flexibility across different mathematical contexts. Rather than reinventing fundamental algorithms, single-algebra builds upon established libraries like nalgebra and ndarray, extending them with domain-specific functionality that bridges the gap between general-purpose linear algebra and specialized scientific computing needs.
Three key principles guide the development of single-algebra:
-
Efficiency with large data: Optimized for both sparse and dense matrix operations, with special attention to memory usage and computational performance on biological datasets.
-
Composable functionality: Modular design allows users to combine operations in flexible ways, using traits to define capabilities that span different matrix representations.
-
Scientific computing focus: Built-in matrix operations and dimensionality reduction algorithms commonly needed in computational biology and data analysis.
Key Features
- Matrix Operations: Comprehensive support for sparse matrix formats (CSR/CSC) with high-performance implementations
- Dimensionality Reduction: PCA, sparse PCA, and SVD implementations
- Batch Processing: Flexible analysis of grouped data with masking support
- Statistical Analysis: Performance-optimized matrix statistics operations
- Memory Efficiency: Designed to handle large biological datasets with minimal memory overhead
Getting Started
To incorporate single-algebra into your Rust project, add the following to your Cargo.toml
:
[dependencies]
single-algebra = "0.7.0"
The library is organized into modules that can be selectively imported based on your needs:
// Import matrix operation traits
use single_algebra::sparse::{MatrixSum, MatrixVariance, MatrixNonZero};
// Import dimensionality reduction
use single_algebra::dimred::pca::{SparsePCABuilder, SVDMethod};
// Or import everything
use single_algebra::*;
In the following sections, we'll explore the different components of single-algebra and how they can be used in real-world applications.