Similar to Map, Fold is one of the fundamental higher order functions in functional programming, see https://en.wikipedia.org/wiki/Fold_%28higher-order_function%29
With these fold functions you can fold some function over all columns (or over all rows). This is useful to implement simple algorithms (which are missing in the library) over all columns or rows, e.g. to compute column sums or some row statistics. You could also write a loop to achieve the same thing, but accessing matrix cells by index is very inefficient especially for sparse matrices.
With these fold functions you can fold some function over all columns (or over all rows). This is useful to implement simple algorithms (which are missing in the library) over all columns or rows, e.g. to compute column sums or some row statistics. You could also write a loop to achieve the same thing, but accessing matrix cells by index is very inefficient especially for sparse matrices.