Function peroxide::util::non_macro::logspace

source ·
pub fn logspace<S, T, U>(start: S, end: T, length: usize, base: U) -> Vec<f64>
where S: Into<f64> + Copy, T: Into<f64> + Copy, U: Into<f64> + Copy,
Expand description

Numpy like logspace

§Examples

use peroxide::fuga::*;

let a = logspace(0, 10, 11, 2);
let b = vec![1f64, 2f64, 4f64, 8f64, 16f64, 32f64, 64f64, 128f64, 256f64, 512f64, 1024f64];
assert_eq!(a, b);

let single = logspace(0f64, 0f64, 1, 10);
assert_eq!(single, vec![1f64]);