Some functions that check dimensions of the input argument raise a NOT_MATRIX exception, others raise Failure or Assert_failure. This commit changes them to all use the same dimension checking logic and to raise a NOT_MATRIX exception.
The mli docs for these functions did not mention that they can raise exceptions, would you like me to add that info to the mli entries?
Also, now each of these functions has the same dimension check logic, maybe it would be a good idea to pull it out in its own function. But then, maybe that should need benchmarking before doing that (though not sure if these particular functions would be in a hot path anyway...)
Some functions that check dimensions of the input argument raise a NOT_MATRIX exception, others raise Failure or Assert_failure. This commit changes them to all use the same dimension checking logic and to raise a NOT_MATRIX exception.
The mli docs for these functions did not mention that they can raise exceptions, would you like me to add that info to the mli entries?
Also, now each of these functions has the same dimension check logic, maybe it would be a good idea to pull it out in its own function. But then, maybe that should need benchmarking before doing that (though not sure if these particular functions would be in a hot path anyway...)