Commit Graph

61 Commits

Author SHA1 Message Date
Andreas Longva
55c3a9c764 Formatting 2022-11-14 16:43:47 +01:00
Andreas Longva
31e687bd76 Implement Matrix::{as_view, as_view_mut} methods 2022-11-14 16:43:05 +01:00
Andreas Longva
8867b365e3 Rename slice -> view in parameter names, comments etc. 2022-11-14 14:40:53 +01:00
Andreas Longva
7d5097b0b2 Remove use of deprecated *Slice aliases in nalgebra 2022-11-14 09:33:08 +01:00
Andreas Longva
29bff32d2d Rename MatrixSlice(Mut) to MatrixView(Mut)
Additionally introduce deprecated type aliases with the old names to avoid
a breaking change.
2022-11-11 16:10:40 +01:00
Andreas Longva
c8dfb5e348 Rename SliceStorage(Mut) to ViewStorage(Mut)
Additionally, we add type aliases with the old names to maintain
backwards compatibility with deprecation warnings.
2022-11-11 15:46:06 +01:00
Sébastien Crozet
f715883f9f Re-add the conversion from a slice to a static array 2021-11-21 21:47:35 +01:00
raimundo saona
2233a38048 Implement conversion methods for RowDVector 2021-08-26 11:07:00 +02:00
Sébastien Crozet
dd6c40016e Remove the Copy requirement from SimdRealField. 2021-08-04 17:34:25 +02:00
Sébastien Crozet
8c6ebf2757 Implement the single-allocator-trait approach. 2021-08-02 18:41:46 +02:00
Violeta Hernández
10b5dc9bb6 Many miscellaneous improvements throughout 2021-07-17 20:19:20 -05:00
Violeta Hernández
c01d591478 We have reached compilation! 2021-07-17 13:01:03 -05:00
Violeta Hernández
9a528e23b9 Almost! 2021-07-17 04:36:14 -05:00
Violeta Hernández
87fe2b30df Checkpoint #9 2021-07-16 23:17:56 -05:00
Violeta Hernández
c3f869e017 Checkpoint #8 2021-07-16 01:53:28 -05:00
Violeta Hernández
df9b6f5f64 blas.rs works now! 2021-07-15 23:56:58 -05:00
Violeta Hernández
8d10e69e33 Finally figured out some trait nitty-gritty 2021-07-14 13:24:27 -05:00
Sébastien Crozet
cce7d9e9b6
Merge pull request #937 from jsmith628/fixed-size-borrow
Implemented Borrow and BorrowMut on fixed size matrices
2021-07-11 17:48:09 +02:00
Joshua Smith
a7fe7a5d9a fixed check-fmt error 2021-07-08 11:05:32 -05:00
Sébastien Crozet
0a5bd520a4
Merge pull request #922 from Cryptjar/impl-into-slice
Allow to extract the inner slices of SliceStorage
2021-07-08 09:50:41 +02:00
Joshua Smith
2279da446e impl Borrow and BorrowMut for fixed size matrices 2021-07-07 13:26:19 -05:00
Violeta Hernández
281b140365
Fix most clippy warnings 2021-06-18 09:45:37 +02:00
Cryptjar
801d8a61a6 Add a From impl to convert DVectorSlice[mut] back to into a slice. 2021-06-18 02:50:10 +02:00
Crozet Sébastien
b398a5e189 Re-add conversion between arrays and row vectors. 2021-05-06 18:22:04 +02:00
Crozet Sébastien
43cf22af28 Cleanup conversion between static arrays and static matrices. 2021-04-27 13:16:01 +02:00
Crozet Sébastien
24d546d3b6 Rename generic parameter N -> T 2021-04-11 13:57:54 +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
Crozet Sébastien
729a8fd7f2 Add conversion from/to glam types + move glam/alga/mint impls to a "third_party" module. 2021-03-06 12:20:38 +01:00
Crozet Sébastien
162a7ef09c Fix compilation when the mint or alga features are enabled. 2021-02-25 14:30:04 +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
b15a274a14 Add workaround for the deserialization of a matrix containing an enum. 2020-12-18 11:54:56 +01:00
Crozet Sébastien
857ce13b63 Add DVector::from(Vec). 2020-11-19 16:28:06 +01:00
Crozet Sébastien
e852df6124 Add sections for most Matrix methods. 2020-11-15 16:57:49 +01: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
Fan Jiang
0e69df2999 Update format 2020-04-01 01:14:32 -04:00
Fan Jiang
74bfd9cad6 Change to the recommended style of using MaybeUninit 2020-03-31 16:50:26 -04: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
f8cd26cfa9 Replace alga by simba. 2020-03-21 12:16:46 +01:00
Fan Jiang
fe75c60325 Fix warnings on latest rustc 2020-03-10 18:20:52 -04:00
Sébastien Crozet
9ec8d4dbd8 Merge pull request #688 from rustsim/matrix_to_slice
Add matrix/slice conversions.
2020-03-02 12:45:37 +01:00
sebcrozet
8bf94f7afb Add matrix/slice conversions.
Fix #687.
2020-03-02 12:45:37 +01:00
Avi Weinstock
774f4da3e2 Add Clone to Scalar, providing a default implementation of inlined_clone. Change Scalar + Clone bounds to just Scalar. 2020-03-02 12:45:37 +01:00
Avi Weinstock
52aac8b975 Add inlined_clone to Scalar, and relax bounds from Scalar + Copy to Scalar + Clone nearly everywhere.
The various nalgebra-lapack FooScalars are still Copy because they make use of uninitialized memory.
nalgebgra-glm Number still uses Copy because upstream `approx` requires it.
2020-03-02 12:45:37 +01:00
Avi Weinstock
7d99015473 Move Copy constraint from the definition of Scalar to all its use-sites.
This should semantically be a no-op, but enables refactorings to use non-Copy scalars on a case-by-case basis.
Also, the only instance of a `One + Zero` trait bound was changed into a `Zero + One` bound to match the others.

The following sed scripts were used in the refactoring (with each clause added to reduce the error count of `cargo check`):

```bash
export RELEVANT_SOURCEFILES="$(find src -name '*.rs') $(find examples -name '*.rs')"
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N: Scalar,/N: Scalar+Copy,/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N: Scalar + Field/N: Scalar + Copy + Field/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N: Scalar + Zero/N: Scalar + Copy + Zero/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N: Scalar + Closed/N: Scalar + Copy + Closed/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N: Scalar + Eq/N: Scalar + Copy + Eq/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N: Scalar + PartialOrd/N: Scalar + Copy + PartialOrd/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N: *Scalar + Zero/N: Scalar + Copy + Zero/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N: Scalar + PartialEq/N: Scalar + Copy + PartialEq/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N: Scalar>/N: Scalar+Copy>/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N: Scalar + $bound/N: Scalar + Copy + $bound/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N: *Scalar + $bound/N: Scalar + Copy + $bound/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\): *Scalar,/N\1: Scalar+Copy,/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N: *Scalar + $trait/N: Scalar + Copy + $trait/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\): *Scalar + Superset/N\1: Scalar + Copy + Superset/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\): *Scalar + \([a-zA-Z]*Eq\)/N\1: Scalar + Copy + \2/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\?\): *Scalar + \([a-zA-Z]*Eq\)/N\1: Scalar + Copy + \2/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\?\): *Scalar + \(hash::\)/N\1: Scalar + Copy + \2/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\?\): *Scalar {/N\1: Scalar + Copy {/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\?\): *Scalar + \(Zero\)/N\1: Scalar + Copy + \2/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\?\): *Scalar + \(Bounded\)/N\1: Scalar + Copy + \2/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\?\): *Scalar + \(Lattice\)/N\1: Scalar + Copy + \2/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\?\): *Scalar + \(Meet\|Join\)/N\1: Scalar + Copy + \2/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\?\): *Scalar + \(fmt::\)/N\1: Scalar + Copy + \2/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\?\): *Scalar + \(Ring\)/N\1: Scalar + Copy + \2/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\?\): *Scalar + \(Hash\)/N\1: Scalar + Copy + \2/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\?\): *Scalar + \(Send\|Sync\)/N\1: Scalar + Copy + \2/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/One + Zero/Zero + One/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\?\): *Scalar + \(Zero\)/N\1: Scalar + Copy + \2/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\?\): *Scalar + \($marker\)/N\1: Scalar + Copy + \2/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/N\([0-9]\?\): *Scalar>/N\1: Scalar + Copy>/' $f; done
for f in $RELEVANT_SOURCEFILES; do sed -i 's/Scalar+Copy/Scalar + Copy/' $f; done
```
2020-03-02 12:45:37 +01:00
Andreas Longva
2f77d73226 Generalize From<_> for MatrixSlice(Mut) to allow different strides 2020-03-02 12:45:35 +01:00
Andreas Longva
a05aa313da Implement From<&Matrix> for MatrixSlice 2020-03-02 12:45:35 +01:00
sebcrozet
3cbe60523a 2018 edition. 2019-03-23 14:33:47 +01:00