Macro totsu_core::splitm_mut
source · macro_rules! splitm_mut {
($slice:expr, $( ($var:ident; $len:expr) ),+ ) => { ... };
}
Expand description
Splits a SliceMut
into multiple ones.
use totsu_core::solver::{SliceLike, SliceMut, LinAlg};
use totsu_core::{splitm_mut, FloatGeneric};
fn func<L: LinAlg>(mut x: SliceMut<L::Sl>) {
splitm_mut!(x, (x1; 4), (x2; 5), (x3; 6));
assert_eq!(x1.len(), 4);
assert_eq!(x2.len(), 5);
assert_eq!(x3.len(), 6);
}
type L = FloatGeneric<f64>;
let a = &mut[0.; 20];
let x = <L as LinAlg>::Sl::new_mut(a);
func::<L>(x);