Skip to main content

Features

single-algebra provides a modular architecture where functionality can be selectively enabled through Cargo features. This allows you to include only the components you need, optimizing compilation time and binary size for your specific use case.

Available Features

Core Matrix Operations

These features are available by default and provide fundamental matrix operations:

  • sparse: Core sparse matrix functionality including CsrMatrix and CscMatrix implementations with operations for summing, counting non-zeros, finding min/max values, and normalization.
  • dense: Operations on dense matrices via ndarray, including normalization and statistical functions.

Linear Algebra

  • lapack: Enables LAPACK-based implementations for SVD decomposition and other linear algebra operations using nalgebra-lapack with OpenBLAS backend.
  • nalgebra: Provides integration with the nalgebra library for linear algebra operations.
  • faer: Alternative linear algebra backend using the faer library, which provides fast implementations of common algorithms.
  • simba: Support for generalized mathematical operations using the simba library.

Statistical Analysis

  • statistics: Comprehensive statistical functionality including:
    • Parametric and non-parametric hypothesis testing (t-tests, Mann-Whitney)
    • Multiple testing correction methods (Bonferroni, Benjamini-Hochberg)
    • Effect size calculations
    • Batch-wise statistical comparisons

Machine Learning

  • clustering: Enables community detection and clustering algorithms:

    • Louvain method for community detection
    • K-nearest neighbors graph construction
    • Similarity network creation
    • Local moving algorithm for community refinement
    • Leiden algorithm implementation (in progress)
  • network: Graph-based data structures and algorithms for network analysis.

  • local_moving: Implementation of local moving algorithm for community detection.

Integration

  • smartcore: Integration with the smartcore machine learning library.

Feature Dependencies

Some features have dependencies on other features:

  • clustering depends on network and local_moving and enables the kiddo crate for k-d tree operations.
  • local_moving depends on network and enables the ahash crate.
  • lapack enables the nalgebra-lapack crate with OpenBLAS support.

Selecting Features

You can enable specific features in your Cargo.toml:

[dependencies]
single-algebra = { version = "0.2.2-alpha.0", features = ["statistics", "clustering", "faer"] }

For most bioinformatics applications, we recommend enabling the statistics, clustering, and either faer or lapack features for comprehensive functionality.

Default Configuration

By default, single-algebra is configured with minimal features to keep the dependency footprint small. For production applications, you'll typically want to enable the specific features required for your use case.