Add checks for matching shapes in Solve, SolveH, and EighInplace#290
Conversation
Codecov Report
@@ Coverage Diff @@
## master #290 +/- ##
==========================================
+ Coverage 89.01% 89.09% +0.08%
==========================================
Files 71 71
Lines 3578 3633 +55
==========================================
+ Hits 3185 3237 +52
- Misses 393 396 +3
Continue to review full report at Codecov.
|
Before, mismatched shapes would lead to segfaults or other memory errors.
389fd77 to
d7e5672
Compare
|
The primary question is whether to panic or return an error in the case of mismatching shapes. @bluss or @termoshtt do you have an opinion on this? |
|
(I'm not a maintainer of this crate) I don't know the error handling story in this crate so well, but panic on shape mismatch fits my general definition quite well. It's not a very "dynamic" condition: the program should be constructed so that it's known the two inputs have compatible shapes at that point in the program, otherwise there was a bug. |
This should be correct. |
Whenever two arrays are used in a single operation, we need to check that the shapes are compatible. Without these checks, we get segfaults, etc.