Scythe-1.0.3
template<typename T , matrix_order O, matrix_style S, class FUNCTOR >
void scythe::for_each_ij_set ( Matrix< T, O, S > &  M,
FUNCTOR  func 
)

Iterate through a Matrix in order.

This function iterates through a Matrix, M, in order, setting each element in the Matrix to the result of an invocation of the function object, func. The () operator of func should take two unsigned integer parameters (i - the row offset into M; j - the column offset into M) and return a result of type T.

Parameters:
MThe Matrix to iterate over.
funcThe functor to execute on each iteration.

References scythe::Matrix_base< ORDER, STYLE >::cols(), and scythe::Matrix_base< ORDER, STYLE >::rows().

Referenced by eye().