use na::{Scalar, DefaultAllocator}; use traits::{Alloc, Dimension}; use aliases::{Vec, Mat}; pub fn column(m: &Mat, index: usize) -> Vec where DefaultAllocator: Alloc { m.column(index).into_owned() } pub fn set_column(m: &Mat, index: usize, x: &Vec) -> Mat where DefaultAllocator: Alloc { let mut res = m.clone(); res.set_column(index, x); res } pub fn row(m: &Mat, index: usize) -> Vec where DefaultAllocator: Alloc { m.row(index).into_owned().transpose() } pub fn set_row(m: &Mat, index: usize, x: &Vec) -> Mat where DefaultAllocator: Alloc { let mut res = m.clone(); res.set_row(index, &x.transpose()); res }