Commit Graph

964 Commits

Author SHA1 Message Date
Andreas Longva f6730dac1f Basic matrixcompare functionality 2020-06-29 18:50:19 +02:00
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
sebcrozet 2c2d1e4f07 Run cargo fmt. 2020-06-07 09:07:25 +02:00
Sébastien Crozet 3359e25435 Cholesky: add unchecked construction compatible with AoSoA SIMD. 2020-06-07 09:05:10 +02:00
Sébastien Crozet 423b4b27b0
Merge pull request #585 from fusion-engineering-forks/pr-default 2020-06-07 08:58:47 +02:00
Chris Hodapp 7363caba17 Fix doc typo (v is right-singular vectors, not left) 2020-04-21 10:23:00 -04:00
sebcrozet 6dc739b70b Remove unused allocator bound. 2020-04-21 10:37:14 +02:00
sebcrozet f4c0897764 Fix compilation of matrix exponential when targetting no-std. 2020-04-21 10:35:20 +02:00
Fredrik Jansson 583a8fb110 Removed unsafe immutable hack 2020-04-12 13:27:11 +02:00
Fredrik Jansson e914afe2af Added support for dynamic matrices 2020-04-12 11:59:06 +02:00
Fredrik Jansson 0a3ee99cdb Changed dimension name R to D
Changed N::from_x to crate::convert
2020-04-12 11:46:00 +02:00
Fredrik Jansson 4ec94408b5 Pub use of exp in the linalg module 2020-04-07 09:41:32 +02:00
Fredrik Jansson b3ef66fd14 Fixed bug in onenorm_matrix_power_norm 2020-04-07 09:41:32 +02:00
Fredrik Jansson e156561677 one_norm is not a public function 2020-04-07 09:41:32 +02:00
Fredrik Jansson 2696ffd7a1 Fixed bug by introducing one norm 2020-04-07 09:41:32 +02:00
Fredrik Jansson c0a6df55b1 Addition of matrix exponent for static size matrices. 2020-04-07 09:41:32 +02:00
sebcrozet 677f355143 Run rustfmt. 2020-04-05 23:19:10 +02:00
Sébastien Crozet b81aed767f
Merge pull request #713 from rustsim/soa_simd
Switch to Simba and make the base and geometry modules mostly SIMD AoSoA friendly.
2020-04-05 21:16:48 +02:00
sebcrozet bbb3be512e Run cargo fmt. 2020-04-05 18:49:48 +02:00
sebcrozet 691f58b622 Fix compilation of tests. 2020-04-05 18:33:03 +02:00
sebcrozet 2c03353b30 Add missing docs. 2020-04-05 18:02:03 +02:00
sebcrozet c5dad7f960 Re-add all the alga trait impls behind a feature. 2020-04-05 17:53:27 +02:00
sebcrozet 191ccbf551 Fix warnings and compilation with the `arbitrary` feature. 2020-04-05 17:18:50 +02:00
sebcrozet d48a644d5c Add missing implementatino of SimdValue for UnitQuaternion. 2020-04-05 16:35:26 +02:00
sebcrozet 8f662a1a61 Rename translation simba impl file. 2020-04-05 16:35:16 +02:00
Chia-Sheng Chen 65bc037b5d Supplement the document of fn as_ptr 2020-04-03 17:56:08 +08:00
Chia-Sheng Chen b996a6f0ce Supplement the document of fn vector_to_matrix_index 2020-04-03 17:39:49 +08:00
Fan Jiang 0e69df2999 Update format 2020-04-01 01:14:32 -04:00
Fan Jiang 451c61e293 Add TODO notice and reference to issue 2020-03-31 17:04:10 -04:00
Fan Jiang 526dac1914 Be more specific on what is happening here 2020-03-31 17:03:07 -04:00
Fan Jiang 74bfd9cad6 Change to the recommended style of using MaybeUninit 2020-03-31 16:50:26 -04:00
Sébastien Crozet a095a7dfcd Re-add some missing transform multiplications. 2020-03-24 19:06:28 +01:00
Sébastien Crozet 81bb9e94f8 Re-add orthogonalization and subspace basis computation. 2020-03-24 19:06:05 +01:00
Sébastien Crozet 8ef46d62cb Re-add inf/sup. 2020-03-24 19:05:47 +01:00
Sébastien Crozet cdbc9da46c Add From<[...; .]> impls for AoSoA Isometry and Similarity. 2020-03-24 10:16:31 +01:00
sebcrozet b3f347e45e Add From<[...; .]> impls for all SIMD geometric sructures up to the isometry (excluded). 2020-03-23 09:16:01 +01:00
sebcrozet b1857e6a36 Fix compilation of tests. 2020-03-21 23:44:24 +01:00
sebcrozet cbcf4d7c27 Make Isometry, Unit/Quaternion, Rotation, Similarity, and UnitComplex partially compatible with AoSoA. 2020-03-21 23:35:41 +01:00
sebcrozet f8cd26cfa9 Replace alga by simba. 2020-03-21 12:16:46 +01:00
Sébastien Crozet 002e735c76 Make blas, matrix, norm, and ops.rs compatible with SoA Simd. 2020-03-17 17:58:36 +01:00
Fan Jiang fe75c60325 Fix warnings on latest rustc 2020-03-10 18:20:52 -04:00
Sébastien Crozet 155ba3a50a Merge pull request #698 from rustsim/try_set_magnitude
Add a method to set the magnitude of a vector.
2020-03-02 12:45:39 +01:00
Sébastien Crozet 1d64de3822 Merge pull request #609 from aplund/dev
Refactor row_sum() and column_sum() to cover more cases.
2020-03-02 12:45:39 +01:00
sebcrozet b09d9770f7 Add a method to set the magnitude of a vector. 2020-03-02 12:45:39 +01:00
Sébastien Crozet a67c451ae5 Merge pull request #607 from cauthmann/dev
Add #[must_use] to all functions with a _mut variant (#598)
2020-03-02 12:45:39 +01:00
nnmm 54f1c71742 Small docs improvements 2020-03-02 12:45:39 +01:00
Ilya Epifanov a62d9d1ad1 GivensRotation::new() should default to (I, 0) 2020-03-02 12:45:38 +01:00
S.Brandeis 6d608cb99f Revert "Broader PartialEq implementation for types implementing Dim trait"
This reverts commit 6f5c9c0f
2020-03-02 12:45:38 +01:00
S.Brandeis 08d990f276 Make shape check a one-liner in impl PartialEq for Matrix 2020-03-02 12:45:38 +01:00
S.Brandeis d35ef06f44 Remove unnecessary PartialEq trait use in PartialEq impl for Matrix 2020-03-02 12:45:38 +01:00