multi_type_matrix: investigate a way to allow modification of element values during walk().
We need a way to allow modifications of element values during walk() without too much overhead.
We will either add a variant of walk() for mutable access, or another similar method if the former is not doable.