nalgebra/src/base
Jenan Wise 85a64fb517 More verbose DMatrix dim asserts where possible.
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.
2020-06-22 17:18:53 -07:00
..
alias_slice.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
alias.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
allocator.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
array_storage.rs Run cargo fmt. 2020-06-07 09:07:25 +02:00
blas.rs More verbose DMatrix dim asserts where possible. 2020-06-22 17:18:53 -07:00
cg.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
componentwise.rs Re-add inf/sup. 2020-03-24 19:05:47 +01:00
constraint.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
construction_slice.rs Run cargo fmt. 2020-06-07 09:07:25 +02:00
construction.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
conversion.rs Run rustfmt. 2020-04-05 23:19:10 +02:00
coordinates.rs Move Copy constraint from the definition of Scalar to all its use-sites. 2020-03-02 12:45:37 +01:00
default_allocator.rs Merge pull request #713 from rustsim/soa_simd 2020-04-05 21:16:48 +02:00
dimension.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
edition.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
helper.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
indexing.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
iter.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
matrix_alga.rs Re-add all the alga trait impls behind a feature. 2020-04-05 17:53:27 +02:00
matrix_simba.rs Replace alga by simba. 2020-03-21 12:16:46 +01:00
matrix_slice.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
matrix.rs More verbose DMatrix dim asserts where possible. 2020-06-22 17:18:53 -07:00
mod.rs Re-add all the alga trait impls behind a feature. 2020-04-05 17:53:27 +02:00
norm.rs Fix compilation of tests. 2020-04-05 18:33:03 +02:00
ops.rs More verbose DMatrix dim asserts where possible. 2020-06-22 17:18:53 -07:00
properties.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
scalar.rs Move Copy constraint from the definition of Scalar to all its use-sites. 2020-03-02 12:45:37 +01:00
statistics.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
storage.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00
swizzle.rs Move Copy constraint from the definition of Scalar to all its use-sites. 2020-03-02 12:45:37 +01:00
unit.rs Add missing docs. 2020-04-05 18:02:03 +02:00
vec_storage.rs Run cargo fmt. 2020-04-05 18:49:48 +02:00