Fixed Sparse-Sparse Product in case of mixed StorageIndex types
The Sparse-Sparse product implementation converts its arguments to different storage order, but always uses the storage index of the result matrix. This can cause problems if the input indices are not representable as such.
The two cases are
- Result is small, but the inputs are large, e.g. (8 x 512) x (512 x 8) -> (8 x 8). This is the case that was broken.
- Result is large, but inputs are small, e.g. (127 x 8) x ( 8 x 127) -> (127 x 127). That worked, but I've added a test-case nontheless.
Note that case 1) can still lead to problems, because the StorageIndex imposes 2 limits:
a) The maximum coordinate any nonzero can have
b) The maximum number of nonzeros.
While a) is clearly not violated in case 1), we might create two many nonzeros ans the product would still fail. In this case the result is truly not representable with the given types. This MR only fixes the case when the operation itself is valid.