Installation
Getting started with single-algebra is straightforward. This page guides you through the installation process and basic setup.
Adding single-algebra to Your Project
Add single-algebra to your Rust project by including it in your Cargo.toml
file:
[dependencies]
single-algebra = "0.2.2-alpha.0"
By default, this includes the core functionality with minimal dependencies. To enable additional features, specify them explicitly:
[dependencies]
single-algebra = { version = "0.2.2-alpha.0", features = ["statistics", "clustering"] }
See the Features page for a complete list of available features.
Basic Usage
Once installed, you can import single-algebra in your Rust code:
// Import the entire library
use single_algebra::*;
// Or import specific components
use single_algebra::sparse::MatrixSum;
use single_algebra::statistics::inference::MatrixStatTests;
use single_algebra::clustering::Louvain;
Verifying Installation
Create a simple example to verify your installation:
use single_algebra::sparse::{MatrixSum};
use nalgebra_sparse::{CooMatrix, CsrMatrix};
fn main() {
// Create a simple sparse matrix
let coo = CooMatrix::try_from_triplets(
3, 3,
vec![0, 1, 2],
vec![0, 1, 2],
vec![1.0, 2.0, 3.0]
).unwrap();
let csr: CsrMatrix<f64> = (&coo).into();
// Calculate column sums
let col_sums: Vec<f64> = csr.sum_col().unwrap();
println!("Column sums: {:?}", col_sums);
}
Release Channels
single-algebra follows semantic versioning:
- Stable releases: Use the latest version number (e.g.,
0.2.2
) - Pre-releases: Alpha and beta versions are available with the suffix (e.g.,
0.2.2-alpha.0
) - Development: For the latest development version, you can use a Git dependency:
[dependencies]
single-algebra = { git = "https://github.com/SingleRust/single-algebra.git", branch = "main" }
Platform Support
single-algebra is designed to work on all platforms supported by Rust, including:
- Linux
- macOS
- Windows
- Other Unix-like systems
Certain features that depend on external libraries (like LAPACK) may have additional platform-specific requirements. See the Requirements page for details.
Updating
To update to the latest version of single-algebra, modify the version number in your Cargo.toml
:
[dependencies]
single-algebra = "0.2.3" # Replace with the latest version
Or run cargo update
to update within your specified version constraints.
For questions or issues with installation, please open an issue on the GitHub repository.