conspire 0.7.2

The Rust interface to conspire.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use super::{super::assert::AssertionError, Interpolate1D, LinearInterpolation, Vector};
use crate::math::assert::Assert;

#[test]
fn line() -> Result<(), AssertionError> {
    let x = Vector::from([0.324, 0.745]);
    let xp = Vector::from([0.0, 1.0]);
    let linear_function = |x: &Vector| x * 2.3;
    let fp = linear_function(&xp);
    let f = LinearInterpolation::interpolate_1d(&x, &xp, &fp);
    Assert::eq(linear_function(&x), &f)
}