Crate russell_chk[][src]

Expand description

Russell - Rust Scientific Library

chk: Functions to check vectors and other data in tests

Example

// check float point number
assert_approx_eq!(0.0000123, 0.000012, 1e-6);

// check vector of float point numbers
assert_vec_approx_eq!(&[0.01, 0.012], &[0.012, 0.01], 1e-2);

// check derivative using central differences
let f = |x: f64| -x;
let at_x = 8.0;
let dfdx_at_x = -1.01;
assert_deriv_approx_eq!(dfdx_at_x, f, at_x, 1e-2);

Macros

Asserts that two numbers are approximately equal to each other

Asserts that derivatives have approximately equal values

Asserts that two vectors have the same length and approximately equal values

Constants

Initial stepsize h for deriv_central5

Functions

Computes the numerical derivative and errors using central differences with 5 points

Computes the numerical derivative using central differences with 5 points

Returns package description