saf1d

Macro saf1d 

Source
macro_rules! saf1d {
    ($([$($x:literal),+ $(,)?]),+ $(,)?) => { ... };
}
Expand description

Creates a SAF matrix of a single population.

This is mainly intended for readability in doc-tests.

ยงExamples

use winsfs_core::saf1d;
let saf = saf1d![
    [0.0,  0.1,  0.2],
    [0.3,  0.4,  0.5],
    [0.6,  0.7,  0.8],
    [0.9,  0.10, 0.11],
    [0.12, 0.13, 0.14],
];
assert_eq!(saf.sites(), 5);
assert_eq!(saf.shape(), [3]);
assert_eq!(saf.get_site(0).as_slice(), &[0.0, 0.1, 0.2]);
assert_eq!(saf.get_site(2).as_slice(), &[0.6, 0.7, 0.8]);