These functions partition a matrix into a set of smaller matrices.
(The submatrices do not overlap).
In the pool function the user specifies the submatrix size, and in the pool2 function the user specifies the (approx) target size.
In the "exact" edge method, the input matrix needs to divisible into equally sized matrices.
An error is produced if this is not possible.
In the "spart" edge method, smaller equal or near-equal sized matrices are used for edge cases.