STD.BLAS.Apply2Cells( m, n , x, f );
| m | Number of rows |
| n | Number of columns |
| x | Matrix |
| f | Function to apply |
| Return: | The updated matrix |
The Apply2Cells function iterates a matrix and applies a function to each cell.
Example:
IMPORT STD;
STD.BLAS.Types.value_t example_1(STD.BLAS.Types.value_t v,
STD.BLAS.Types.dimensiopn_t x,
STD.BLAS.Types.dimension_t y) := FUNCTION
RETURN IF(x=y, 1.0, 1/v);
END;
init_mat := [1, 2, 4, 4, 5, 10, 2, 5, 2];
new_mat := STD.BLAS.Apply2Cells(3, 3, init_mat, example_1);
// The new_mat matrix will be [1, .5, .25, .25, 1, .1, .5, .2, 1]
See Also: ICellFunc