A bioinformatics library for numerical modeling, optimisation, data analysis, and simulation written in Rust.
Spindalis provides a collection of numerical methods, polynomial parsing and evaluation tools, derivative computation, and optimisation algorithms for scientific computing and bioinformatics applications.
- Polynomial parsing and evaluation
- Derivative computation
- Root and Extrema finding with Bisection and Newton–Raphson methods
- Extensible modules for numerical modelling and optimisation
Add Spindalis as a dependency in your Cargo.toml:
To use the latest stable release, add spindalis as a dependency:
[dependencies]
spindalis = "0.X.X" # Always use the latest version available on crates.ioOr, use Cargo:
cargo add spindalis[dependencies]
spindalis = { git = "https://github.com/lignum-vitae/spindalis.git" }Then run:
cargo build
Spindalis makes handling polynomials easier through dedicated functions for parsing,
evaluation, and derivation. Core functionality is implemented through structs for
the three classes of polynomials:
SimplePolynomial, IntermediatePolynomial, and Polynomial. These structs are
unified through their implementation of PolynomialTraits, where they have
attached methods to parse, evaluate, integrate, and derivate
univariate and multivariate polynomials.
Simple Polynomial can handle univariate polynomials with integer exponents and only addition and subtraction.
Intermediate Polynomial is an extension of Simple Polynomial that can handle multivariate polynomials. Intermediate polynomial can also handle fractional, decimal, and negative exponents.
Polynomial is intended to handle all operations for a polynomial. This would include multivariate polynomials, functions such as sin or cos, constants such as pi, fractional exponents, negative exponents, and optimistically also polynomial expansion.
This repository is split into three crates. The tests for spindalis_core and spindalis_macros are located in the tests folder of spindalis.
| Crate | Description |
|---|---|
spindalis |
The main library crate that provides high-level access to all mathematical, polynomial, and utility implementations |
spindalis_core |
Fundamental data structures and core logic for polynomials, including polynomial structs, parsing, and methods for calculating derivatives and integrals |
spindalis_macros |
Procedural macros to enhance usability with compile time evaluation of polynomials |
Within these crates, the following modules spindalis::<module name> are provided
| Module | Description |
|---|---|
utils |
Utility functions such as different types of mean and standard deviation |
polynomials |
Parsing and evaluating simple and intermediate polynomials |
derivatives |
Differentiating simple and intermediate polynomials |
integrals |
Integrating simple and intermediate polynomials |
solvers |
Solving equations and differential equations, including root-finding, extrema-finding, and ODE solvers |
eigen |
Algorithms to solve eigenvalue and eigenvector problems |
regressors |
Linear and non-linear regression, including least-squares, Gaussian, and polynomial regression |
reduction |
Linear and non-linear dimensionality reduction algorithms, including PCA |
Working examples of the available algorithms as well as a full list of available algorithms can be found in the
examples/ directory.
Run any example with the following command:
cargo run --example <example_name>
Do not include .rs when running examples.
We welcome contributions! Please read our:
Note
Before submitting a PR, install just and run just check
to pull the latest changes from the main branch as well as to format, test, and lint your code.
Just can be installed using cargo install just, curl, or your favourite package manager.
Stay connected via our Discord Server
Caution
Arr2D functionality and decomposition functions moved to jedvek! Arr2D is now Matrix2D.
This project is in the beta stage. APIs may change without warning until version 1.0.0.
This project is licensed under the MIT License - see the LICENSE file for details.