85a64fb517
Previously, most dimension mismatch asserts used raw `assert!` and did not include the mismatching dimensions in the panic message. When using dynamic matrices, this led to somewhat-opaque panics such as: ```rust let m1 = DMatrix::<f32>::zeros(2, 3); let m2 = DMatrix::<f32>::zeros(5, 10); m1 + m2 // panic: Matrix addition/subtraction dimensions mismatch. ``` This patch adds dimension information in the panic messages wherever doing so did not add additional bounds checks, mostly by simply changing `assert!(a == b, ...)` cases to `assert_eq!`. After: ```rust // panic: assertion failed: `(left == right)` // left: `(2, 3)`, // right: `(5, 10)`: Matrix addition/subtraction dimensions mismatch. ``` Note that the `gemv` and `ger` were not updated, as they are called from within other functions on subset matricies -- e.g., `gemv` is called from `gemm` which is called from `mul_to` . Including dimension information in the `gemv` panic messages would be confusing to `mul` / `mul_to` users, because it would include dimensions of the column vectors that `gemm` passes to `gemv` rather than of the original `mul` arguments. A fix would be to add bounds checks to `mul_to`, but that may have performance and redundancy implications, so is left to another patch. |
||
---|---|---|
.. | ||
alias_slice.rs | ||
alias.rs | ||
allocator.rs | ||
array_storage.rs | ||
blas.rs | ||
cg.rs | ||
componentwise.rs | ||
constraint.rs | ||
construction_slice.rs | ||
construction.rs | ||
conversion.rs | ||
coordinates.rs | ||
default_allocator.rs | ||
dimension.rs | ||
edition.rs | ||
helper.rs | ||
indexing.rs | ||
iter.rs | ||
matrix_alga.rs | ||
matrix_simba.rs | ||
matrix_slice.rs | ||
matrix.rs | ||
mod.rs | ||
norm.rs | ||
ops.rs | ||
properties.rs | ||
scalar.rs | ||
statistics.rs | ||
storage.rs | ||
swizzle.rs | ||
unit.rs | ||
vec_storage.rs |