Commit Graph

191 Commits

Author SHA1 Message Date
Malte Tammena 39aa52d019 Add must_use annotations in src/**/*.rs 2021-06-06 14:46:36 +02:00
Malte Tammena d85c10a73c Add some missing question marks 2021-06-06 11:34:29 +02:00
Malte Tammena 925fc1edd7 Annotate functions with #[must_use] where appropriate 2021-06-06 11:28:12 +02:00
Crozet Sébastien 95b021dbfb Don't enable serde by default.
Don't enable `serde/std` by default.
Add a `serde-serialize-no-std` feature to enable serde without its default features.
2021-04-12 12:14:16 +02:00
Crozet Sébastien cc4427e52b Make matrix power work for non-owned matrices. 2021-04-11 14:07:06 +02:00
Crozet Sébastien 24d546d3b6 Rename generic parameter N -> T 2021-04-11 13:57:54 +02:00
Crozet Sébastien 35ec135d2c Fix compilation after rebase. 2021-04-11 13:53:45 +02:00
Crozet Sébastien d17088398a Replace generic-array with a regular array based on min-const-generics. 2021-04-11 13:53:45 +02:00
Sébastien Crozet 2ebba30117
Merge pull request #861 from jturner314/fix-cholesky-det-complex
Fix Cholesky::determinant for complex elements
2021-04-11 13:49:35 +02:00
Sébastien Crozet b9a524427b
Merge pull request #859 from OfficialURL/dev
Added pow functions
2021-04-11 13:44:06 +02:00
Violeta Hernández 341091f647 `pow_mut` now returns `Result`. 2021-04-10 00:12:26 -05:00
Violeta Hernández 81f2fc38d7 Use mul_to instead of square_buf
Didn't realize that this was something that was already implemented.
2021-04-09 23:59:22 -05:00
Violeta Hernández 15a63cb892 Memory improvements, extra comments.
The result of `multiplier ^ 2` is now written into a single buffer.
2021-04-09 23:43:59 -05:00
Vinzent Steinberg 260ee54288 Disable some tests if "rand" feature is disabled
This avoids some misleading errors for `cargo test`.
2021-04-10 01:00:12 -03:00
Jim Turner cea3bdc8e5 Fix Cholesky::determinant for Complex elements
The previous implementation was correct only for real elements. The
Cholesky decomposition is `L L^H`, so the determinant is `det(L) *
det(L^H)`. Since `L` is a triangular matrix, `det(L)` is the product
of the diagonal elements of `L`. Since `L^H` is triangular and its
diagonal elements are the conjugates of the diagonal elements of `L`,
`det(L^H)` is the conjugate of `det(L)`. So, the overall determinant
is the product of the diagonal elements of `L` times its conjugate.
2021-04-09 14:28:16 -04:00
Jim Turner 50fed194f4 Add determinant method to Cholesky 2021-04-07 23:10:19 -04:00
Violeta Hernández 06b657ad49 Added pow_mut.
Actually, I think this will do.
2021-04-05 12:32:12 -05:00
Violeta Hernández ab85766b5a Added pow function.
I'll try adding some unchecked and in place variants soon.
2021-04-05 12:17:49 -05:00
Crozet Sébastien 6cfd2bca14 Use proptest for all nalgebra tests. 2021-02-28 17:52:14 +01:00
Crozet Sébastien 7b6b3649f2 Run cargo fmt. 2021-02-25 16:20:11 +01:00
Crozet Sébastien 6699039fec Fix rebase-induced compilation error. 2021-02-25 15:51:13 +01:00
Crozet Sébastien aeb9f7ea39 Add a matrix.udu() method to compute the UDU decomposition. 2021-02-25 15:49:24 +01:00
Crozet Sébastien ab0d335b61 Fix tests for the UDU decomposition. 2021-02-25 15:48:44 +01:00
Christopher Rabotin 89ca2fe5fb UDU only supported for Real matrices, not Complex
Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com>
2021-02-25 15:48:44 +01:00
Christopher Rabotin 4ff4911ac3 Implement requested changes
Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com>
2021-02-25 15:48:44 +01:00
Chris 06861a9755 Update src/linalg/udu.rs
Co-authored-by: Sébastien Crozet <sebastien@crozet.re>
2021-02-25 15:48:44 +01:00
Christopher Rabotin 7a49b9eeca UDU: d now stored in VectorN instead of MatrixN
Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com>
2021-02-25 15:48:44 +01:00
Christopher Rabotin e9933e5c91 UDU: Expand to Dim from DimName
Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com>
2021-02-25 15:48:44 +01:00
Christopher Rabotin 5a7ed61e9b UDU impl: using 0-index nomenclature
Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com>
2021-02-25 15:48:44 +01:00
Christopher Rabotin a8d40423ea Fixed UDU algorithm
Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com>
2021-02-25 15:48:44 +01:00
Christopher Rabotin 8dda6714b5 Untested UDU implementation
Pushing to trigger build

Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com>
2021-02-25 15:48:44 +01:00
Sébastien Crozet 21cc428480
Merge pull request #803 from aweinstock314/no_unsound_assume_init
Propagate `mem::MaybeUninit` through the return types of `Allocator::…
2021-02-25 15:46:49 +01:00
Avi Weinstock ee32f7d4cf Run `cargo fmt`. 2021-02-25 13:42:23 +01:00
Avi Weinstock cd12422d6f Change `zero_or_uninitialized_generic` to `unimplemented_or_uninitialized_generic`, and use it instead of manually dispatching on `feature=no_unsound_assume_init` in functions without `N: Zero`. 2021-02-25 13:42:23 +01:00
Avi Weinstock 36a3ac814f Propagate `mem::MaybeUninit` through the return types of `Allocator::allocate_uninitialized` and `Matrix::new_uninitialized_generic`.
Most call sites still invoke UB through `assume_init`. Said call sites instead invoke `unimplemented!()` if the `no_unsound_assume_init` feature is enabled, to make it easier to gradually fix them.

Progress towards #556.
2021-02-25 13:42:23 +01:00
Crozet Sébastien 598c217d75 Move the col_piv_qr method to the decomposition module. 2021-02-25 13:28:42 +01:00
Crozet Sébastien 693e6d0035 Run cargo fmt. 2021-02-25 12:59:14 +01:00
Crozet Sébastien 308d95386e Fix all tests and the ColPivQR::solve. 2021-02-25 12:06:04 +01:00
russellb23 63a34528e0 Added test for QR factorization and fixed unpack issue 2021-02-25 11:31:37 +01:00
russellb23 1316133625 Removed unused imports 2021-02-25 11:31:37 +01:00
russellb23 a2f3e1ac26 Inverted sign in householder 2021-02-25 11:31:37 +01:00
russellb23 f8c0195f0f QR factorization with column pivoting 2021-02-25 11:31:37 +01:00
Philippe Renon 87ee014bd3 clippy: fix clone_on_copy warnings 2020-11-19 12:55:15 +01:00
Philippe Renon bbc6a28f7d clippy: fix len_without_is_empty warnings 2020-11-19 12:24:26 +01:00
Philippe Renon 008c24204e clippy: fix unreadable_literal warnings 2020-11-16 14:43:36 +01:00
Philippe Renon de4a067d27 clippy: fix len_zero warnings 2020-11-16 12:11:24 +01:00
Crozet Sébastien e852df6124 Add sections for most Matrix methods. 2020-11-15 16:57:49 +01:00
Crozet Sébastien 45f2fc4f92 Move all matrix decomposition methods under a single impl. 2020-11-13 17:26:47 +01:00
Sébastien Crozet eb94084760
Merge pull request #756 from dayrover/cholesky
Remove unnecessary Trait bound DimSub<Dynamic> in fn cholesky(self)
2020-10-24 18:23:03 +02:00
Philippe Renon 0b0f248267 clippy: fix #identity_op 2020-10-11 11:42:22 +02:00