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§
Sourcefn map_matrix(&'a self, f: &'a dyn Fn(&T) -> V) -> DenseMatrix<V, I>
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.
Sourcefn map_indexed_matrix(
&'a self,
f: &mut dyn FnMut(MatrixAddress<I>, &T) -> V,
) -> DenseMatrix<V, I>
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.