numerics-rs
About
In order to learn Rust, I decided to create a project inspired by the most common problems I have encountered working in finanial engineering. It is written in pure Rust and I strive for it to be the fastest existing implementation. Currently supports:
- Interpolation (Univariate, spline polynomials up to an order of 3)
- Numerical solving (WIP)
- Convenient matrix API and common matrix operations (WIP)
Usage
To use, add this to your crate:
use ;
Examples
Linear interpolation:
let x_values = vec!;
let y_values = vec!;
// Create an interpolator
let interpolator = new;
// Test linear interpolation at known points
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
// Test linear interpolation between the points
assert_eq!;
assert_eq!;
assert_eq!;
Dependencies
It comes with 0 external dependencies
Thread safety
Everything in the API is immutable, thus it is safe to use in a multi-threaded environment
How fast is it?
It is very fast and lightweight, it is using precomputed coefficients and it scales really well if you want to call it many times using the same set of knots. Benchmarks will be added in future versions
Cargo
- Install the rust toolchain in order to have cargo installed by following this guide.
- run
cargo install numerics-rs
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
See CONTRIBUTING.md.
Feedback
This is my first Rust project therefore I greatly appreciate your feedback, feel free to get in touch