MatrixMap

Trait MatrixMap 

Source
pub trait MatrixMap<'a, 'b, T, V, I>
where T: 'static, V: 'static, I: 'static + Coordinate,
{ // Required methods fn map_matrix(&'a self, f: &'a dyn Fn(&T) -> V) -> DenseMatrix<V, I>; fn map_indexed_matrix( &'a self, f: &mut dyn FnMut(MatrixAddress<I>, &T) -> V, ) -> DenseMatrix<V, I>; }
Expand description

MatrixMap provides convenience functions to transform one matrix into another.

Required Methods§

Source

fn map_matrix(&'a self, f: &'a dyn Fn(&T) -> V) -> DenseMatrix<V, I>

map creates a Matrix<V, I> from a Matrix<T, I> using a helper function to transform each element.

Source

fn map_indexed_matrix( &'a self, f: &mut dyn FnMut(MatrixAddress<I>, &T) -> V, ) -> DenseMatrix<V, I>

map_indexed_matrix creates a Matrix<V, I> from a Matrix<T, I> using a helper function that takes the address and value of each element.

Implementors§

Source§

impl<'a, 'b, T, V, I> MatrixMap<'a, 'b, T, V, I> for DenseMatrix<T, I>
where T: 'static, V: 'static, I: 'static + Coordinate,