Fix compilation after rebase.

This commit is contained in:
Crozet Sébastien 2021-04-06 10:53:11 +02:00
parent d17088398a
commit 35ec135d2c
8 changed files with 69 additions and 63 deletions

View File

@ -30,10 +30,10 @@
----- -----
## Gold sponsors ## Platinum sponsors
Rapier is supported by: Rapier is supported by:
<p> <p>
<a href="https://embark-studios.com"> <a href="https://embark-studios.com">
<img src="https://www.embark.dev/img/logo_black.png" width="301px"> <img src="https://www.embark.dev/img/logo_black.png" width="401px">
</a> </a>
</p> </p>

View File

@ -20,9 +20,11 @@ use typenum::{self, Cmp, Greater};
use simba::scalar::{ClosedAdd, ClosedMul}; use simba::scalar::{ClosedAdd, ClosedMul};
use crate::base::allocator::Allocator; use crate::base::allocator::Allocator;
use crate::base::dimension::{Const, Dim, DimName, Dynamic, ToTypenum, U1, U2, U3, U4, U5, U6}; use crate::base::dimension::{Dim, DimName, Dynamic, ToTypenum};
use crate::base::storage::Storage; use crate::base::storage::Storage;
use crate::base::{DefaultAllocator, Matrix, MatrixMN, MatrixN, Scalar, Unit, Vector, VectorN}; use crate::base::{
Const, DefaultAllocator, Matrix, MatrixMN, MatrixN, Scalar, Unit, Vector, VectorN,
};
/// When "no_unsound_assume_init" is enabled, expands to `unimplemented!()` instead of `new_uninitialized_generic().assume_init()`. /// When "no_unsound_assume_init" is enabled, expands to `unimplemented!()` instead of `new_uninitialized_generic().assume_init()`.
/// Intended as a placeholder, each callsite should be refactored to use uninitialized memory soundly /// Intended as a placeholder, each callsite should be refactored to use uninitialized memory soundly
@ -210,9 +212,9 @@ where
/// m.m31 == 7.0 && m.m32 == 8.0 && m.m33 == 9.0); /// m.m31 == 7.0 && m.m32 == 8.0 && m.m33 == 9.0);
/// ``` /// ```
#[inline] #[inline]
pub fn from_rows<SB>(rows: &[Matrix<N, U1, C, SB>]) -> Self pub fn from_rows<SB>(rows: &[Matrix<N, Const<1>, C, SB>]) -> Self
where where
SB: Storage<N, U1, C>, SB: Storage<N, Const<1>, C>,
{ {
assert!(!rows.is_empty(), "At least one row must be given."); assert!(!rows.is_empty(), "At least one row must be given.");
let nrows = R::try_to_usize().unwrap_or_else(|| rows.len()); let nrows = R::try_to_usize().unwrap_or_else(|| rows.len());
@ -878,10 +880,10 @@ where
* *
*/ */
macro_rules! componentwise_constructors_impl( macro_rules! componentwise_constructors_impl(
($($R: ty, $C: ty, $($args: ident:($irow: expr,$icol: expr)),*);* $(;)*) => {$( ($($R: expr, $C: expr, $($args: ident:($irow: expr,$icol: expr)),*);* $(;)*) => {$(
impl<N> MatrixMN<N, $R, $C> impl<N> MatrixMN<N, Const<$R>, Const<$C>>
where N: Scalar, where N: Scalar,
DefaultAllocator: Allocator<N, $R, $C> { DefaultAllocator: Allocator<N, Const<$R>, Const<$C>> {
/// Initializes this matrix from its components. /// Initializes this matrix from its components.
#[inline] #[inline]
pub fn new($($args: N),*) -> Self { pub fn new($($args: N),*) -> Self {
@ -903,21 +905,21 @@ componentwise_constructors_impl!(
/* /*
* Square matrices 1 .. 6. * Square matrices 1 .. 6.
*/ */
U2, U2, m11:(0,0), m12:(0,1), 2, 2, m11:(0,0), m12:(0,1),
m21:(1,0), m22:(1,1); m21:(1,0), m22:(1,1);
U3, U3, m11:(0,0), m12:(0,1), m13:(0,2), 3, 3, m11:(0,0), m12:(0,1), m13:(0,2),
m21:(1,0), m22:(1,1), m23:(1,2), m21:(1,0), m22:(1,1), m23:(1,2),
m31:(2,0), m32:(2,1), m33:(2,2); m31:(2,0), m32:(2,1), m33:(2,2);
U4, U4, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), 4, 4, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3),
m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3),
m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3); m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3);
U5, U5, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), 5, 5, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4), m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4),
m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4), m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4),
m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3), m45:(3,4), m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3), m45:(3,4),
m51:(4,0), m52:(4,1), m53:(4,2), m54:(4,3), m55:(4,4); m51:(4,0), m52:(4,1), m53:(4,2), m54:(4,3), m55:(4,4);
U6, U6, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), m16:(0,5), 6, 6, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), m16:(0,5),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4), m26:(1,5), m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4), m26:(1,5),
m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4), m36:(2,5), m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4), m36:(2,5),
m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3), m45:(3,4), m46:(3,5), m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3), m45:(3,4), m46:(3,5),
@ -927,47 +929,47 @@ componentwise_constructors_impl!(
/* /*
* Rectangular matrices with 2 rows. * Rectangular matrices with 2 rows.
*/ */
U2, U3, m11:(0,0), m12:(0,1), m13:(0,2), 2, 3, m11:(0,0), m12:(0,1), m13:(0,2),
m21:(1,0), m22:(1,1), m23:(1,2); m21:(1,0), m22:(1,1), m23:(1,2);
U2, U4, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), 2, 4, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3); m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3);
U2, U5, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), 2, 5, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4); m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4);
U2, U6, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), m16:(0,5), 2, 6, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), m16:(0,5),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4), m26:(1,5); m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4), m26:(1,5);
/* /*
* Rectangular matrices with 3 rows. * Rectangular matrices with 3 rows.
*/ */
U3, U2, m11:(0,0), m12:(0,1), 3, 2, m11:(0,0), m12:(0,1),
m21:(1,0), m22:(1,1), m21:(1,0), m22:(1,1),
m31:(2,0), m32:(2,1); m31:(2,0), m32:(2,1);
U3, U4, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), 3, 4, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3),
m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3); m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3);
U3, U5, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), 3, 5, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4), m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4),
m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4); m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4);
U3, U6, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), m16:(0,5), 3, 6, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), m16:(0,5),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4), m26:(1,5), m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4), m26:(1,5),
m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4), m36:(2,5); m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4), m36:(2,5);
/* /*
* Rectangular matrices with 4 rows. * Rectangular matrices with 4 rows.
*/ */
U4, U2, m11:(0,0), m12:(0,1), 4, 2, m11:(0,0), m12:(0,1),
m21:(1,0), m22:(1,1), m21:(1,0), m22:(1,1),
m31:(2,0), m32:(2,1), m31:(2,0), m32:(2,1),
m41:(3,0), m42:(3,1); m41:(3,0), m42:(3,1);
U4, U3, m11:(0,0), m12:(0,1), m13:(0,2), 4, 3, m11:(0,0), m12:(0,1), m13:(0,2),
m21:(1,0), m22:(1,1), m23:(1,2), m21:(1,0), m22:(1,1), m23:(1,2),
m31:(2,0), m32:(2,1), m33:(2,2), m31:(2,0), m32:(2,1), m33:(2,2),
m41:(3,0), m42:(3,1), m43:(3,2); m41:(3,0), m42:(3,1), m43:(3,2);
U4, U5, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), 4, 5, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4), m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4),
m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4), m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4),
m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3), m45:(3,4); m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3), m45:(3,4);
U4, U6, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), m16:(0,5), 4, 6, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), m16:(0,5),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4), m26:(1,5), m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4), m26:(1,5),
m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4), m36:(2,5), m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4), m36:(2,5),
m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3), m45:(3,4), m46:(3,5); m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3), m45:(3,4), m46:(3,5);
@ -975,22 +977,22 @@ componentwise_constructors_impl!(
/* /*
* Rectangular matrices with 5 rows. * Rectangular matrices with 5 rows.
*/ */
U5, U2, m11:(0,0), m12:(0,1), 5, 2, m11:(0,0), m12:(0,1),
m21:(1,0), m22:(1,1), m21:(1,0), m22:(1,1),
m31:(2,0), m32:(2,1), m31:(2,0), m32:(2,1),
m41:(3,0), m42:(3,1), m41:(3,0), m42:(3,1),
m51:(4,0), m52:(4,1); m51:(4,0), m52:(4,1);
U5, U3, m11:(0,0), m12:(0,1), m13:(0,2), 5, 3, m11:(0,0), m12:(0,1), m13:(0,2),
m21:(1,0), m22:(1,1), m23:(1,2), m21:(1,0), m22:(1,1), m23:(1,2),
m31:(2,0), m32:(2,1), m33:(2,2), m31:(2,0), m32:(2,1), m33:(2,2),
m41:(3,0), m42:(3,1), m43:(3,2), m41:(3,0), m42:(3,1), m43:(3,2),
m51:(4,0), m52:(4,1), m53:(4,2); m51:(4,0), m52:(4,1), m53:(4,2);
U5, U4, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), 5, 4, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3),
m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3),
m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3), m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3),
m51:(4,0), m52:(4,1), m53:(4,2), m54:(4,3); m51:(4,0), m52:(4,1), m53:(4,2), m54:(4,3);
U5, U6, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), m16:(0,5), 5, 6, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), m16:(0,5),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4), m26:(1,5), m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4), m26:(1,5),
m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4), m36:(2,5), m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4), m36:(2,5),
m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3), m45:(3,4), m46:(3,5), m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3), m45:(3,4), m46:(3,5),
@ -999,25 +1001,25 @@ componentwise_constructors_impl!(
/* /*
* Rectangular matrices with 6 rows. * Rectangular matrices with 6 rows.
*/ */
U6, U2, m11:(0,0), m12:(0,1), 6, 2, m11:(0,0), m12:(0,1),
m21:(1,0), m22:(1,1), m21:(1,0), m22:(1,1),
m31:(2,0), m32:(2,1), m31:(2,0), m32:(2,1),
m41:(3,0), m42:(3,1), m41:(3,0), m42:(3,1),
m51:(4,0), m52:(4,1), m51:(4,0), m52:(4,1),
m61:(5,0), m62:(5,1); m61:(5,0), m62:(5,1);
U6, U3, m11:(0,0), m12:(0,1), m13:(0,2), 6, 3, m11:(0,0), m12:(0,1), m13:(0,2),
m21:(1,0), m22:(1,1), m23:(1,2), m21:(1,0), m22:(1,1), m23:(1,2),
m31:(2,0), m32:(2,1), m33:(2,2), m31:(2,0), m32:(2,1), m33:(2,2),
m41:(3,0), m42:(3,1), m43:(3,2), m41:(3,0), m42:(3,1), m43:(3,2),
m51:(4,0), m52:(4,1), m53:(4,2), m51:(4,0), m52:(4,1), m53:(4,2),
m61:(5,0), m62:(5,1), m63:(5,2); m61:(5,0), m62:(5,1), m63:(5,2);
U6, U4, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), 6, 4, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3),
m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3),
m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3), m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3),
m51:(4,0), m52:(4,1), m53:(4,2), m54:(4,3), m51:(4,0), m52:(4,1), m53:(4,2), m54:(4,3),
m61:(5,0), m62:(5,1), m63:(5,2), m64:(5,3); m61:(5,0), m62:(5,1), m63:(5,2), m64:(5,3);
U6, U5, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4), 6, 5, m11:(0,0), m12:(0,1), m13:(0,2), m14:(0,3), m15:(0,4),
m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4), m21:(1,0), m22:(1,1), m23:(1,2), m24:(1,3), m25:(1,4),
m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4), m31:(2,0), m32:(2,1), m33:(2,2), m34:(2,3), m35:(2,4),
m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3), m45:(3,4), m41:(3,0), m42:(3,1), m43:(3,2), m44:(3,3), m45:(3,4),
@ -1027,21 +1029,21 @@ componentwise_constructors_impl!(
/* /*
* Row vectors 1 .. 6. * Row vectors 1 .. 6.
*/ */
U1, U1, x:(0,0); 1, 1, x:(0,0);
U1, U2, x:(0,0), y:(0,1); 1, 2, x:(0,0), y:(0,1);
U1, U3, x:(0,0), y:(0,1), z:(0,2); 1, 3, x:(0,0), y:(0,1), z:(0,2);
U1, U4, x:(0,0), y:(0,1), z:(0,2), w:(0,3); 1, 4, x:(0,0), y:(0,1), z:(0,2), w:(0,3);
U1, U5, x:(0,0), y:(0,1), z:(0,2), w:(0,3), a:(0,4); 1, 5, x:(0,0), y:(0,1), z:(0,2), w:(0,3), a:(0,4);
U1, U6, x:(0,0), y:(0,1), z:(0,2), w:(0,3), a:(0,4), b:(0,5); 1, 6, x:(0,0), y:(0,1), z:(0,2), w:(0,3), a:(0,4), b:(0,5);
/* /*
* Column vectors 1 .. 6. * Column vectors 1 .. 6.
*/ */
U2, U1, x:(0,0), y:(1,0); 2, 1, x:(0,0), y:(1,0);
U3, U1, x:(0,0), y:(1,0), z:(2,0); 3, 1, x:(0,0), y:(1,0), z:(2,0);
U4, U1, x:(0,0), y:(1,0), z:(2,0), w:(3,0); 4, 1, x:(0,0), y:(1,0), z:(2,0), w:(3,0);
U5, U1, x:(0,0), y:(1,0), z:(2,0), w:(3,0), a:(4,0); 5, 1, x:(0,0), y:(1,0), z:(2,0), w:(3,0), a:(4,0);
U6, U1, x:(0,0), y:(1,0), z:(2,0), w:(3,0), a:(4,0), b:(5,0); 6, 1, x:(0,0), y:(1,0), z:(2,0), w:(3,0), a:(4,0), b:(5,0);
); );
/* /*

View File

@ -37,7 +37,7 @@ impl<N: Scalar, const R: usize, const C: usize> Allocator<N, Const<R>, Const<C>>
type Buffer = ArrayStorage<N, R, C>; type Buffer = ArrayStorage<N, R, C>;
#[inline] #[inline]
unsafe fn allocate_uninitialized(_: R, _: C) -> mem::MaybeUninit<Self::Buffer> { unsafe fn allocate_uninitialized(_: Const<R>, _: Const<C>) -> mem::MaybeUninit<Self::Buffer> {
mem::MaybeUninit::<Self::Buffer>::uninit() mem::MaybeUninit::<Self::Buffer>::uninit()
} }
@ -146,12 +146,13 @@ where
rto: Const<RTO>, rto: Const<RTO>,
cto: Const<CTO>, cto: Const<CTO>,
buf: <Self as Allocator<N, RFrom, CFrom>>::Buffer, buf: <Self as Allocator<N, RFrom, CFrom>>::Buffer,
) -> ArrayStorage<N, RTo, CTo> { ) -> ArrayStorage<N, RTO, CTO> {
#[cfg(feature = "no_unsound_assume_init")] #[cfg(feature = "no_unsound_assume_init")]
let mut res: ArrayStorage<N, RTo, CTo> = unimplemented!(); let mut res: ArrayStorage<N, RTO, CTO> = unimplemented!();
#[cfg(not(feature = "no_unsound_assume_init"))] #[cfg(not(feature = "no_unsound_assume_init"))]
let mut res = let mut res =
<Self as Allocator<N, RTo, CTo>>::allocate_uninitialized(rto, cto).assume_init(); <Self as Allocator<N, Const<RTO>, Const<CTO>>>::allocate_uninitialized(rto, cto)
.assume_init();
let (rfrom, cfrom) = buf.shape(); let (rfrom, cfrom) = buf.shape();

View File

@ -17,7 +17,7 @@ use simba::simd::SimdPartialOrd;
use crate::base::allocator::Allocator; use crate::base::allocator::Allocator;
use crate::base::dimension::{DimName, DimNameAdd, DimNameSum, U1}; use crate::base::dimension::{DimName, DimNameAdd, DimNameSum, U1};
use crate::base::iter::{MatrixIter, MatrixIterMut}; use crate::base::iter::{MatrixIter, MatrixIterMut};
use crate::base::{DefaultAllocator, Scalar, VectorN}; use crate::base::{Const, DefaultAllocator, Scalar, VectorN};
/// A point in an euclidean space. /// A point in an euclidean space.
/// ///
@ -202,7 +202,7 @@ where
let mut res = unsafe { let mut res = unsafe {
crate::unimplemented_or_uninitialized_generic!( crate::unimplemented_or_uninitialized_generic!(
<DimNameSum<D, U1> as DimName>::name(), <DimNameSum<D, U1> as DimName>::name(),
U1 Const::<1>
) )
}; };
res.fixed_slice_mut::<D, U1>(0, 0).copy_from(&self.coords); res.fixed_slice_mut::<D, U1>(0, 0).copy_from(&self.coords);

View File

@ -12,8 +12,8 @@ use crate::base::allocator::Allocator;
use crate::base::dimension::{DimName, DimNameAdd, DimNameSum, U1}; use crate::base::dimension::{DimName, DimNameAdd, DimNameSum, U1};
use crate::base::{DefaultAllocator, Scalar, VectorN}; use crate::base::{DefaultAllocator, Scalar, VectorN};
use crate::{ use crate::{
Point1, Point2, Point3, Point4, Point5, Point6, Vector1, Vector2, Vector3, Vector4, Vector5, Const, Point1, Point2, Point3, Point4, Point5, Point6, Vector1, Vector2, Vector3, Vector4,
Vector6, Vector5, Vector6,
}; };
use simba::scalar::{ClosedDiv, SupersetOf}; use simba::scalar::{ClosedDiv, SupersetOf};
@ -29,7 +29,7 @@ where
pub unsafe fn new_uninitialized() -> Self { pub unsafe fn new_uninitialized() -> Self {
Self::from(crate::unimplemented_or_uninitialized_generic!( Self::from(crate::unimplemented_or_uninitialized_generic!(
D::name(), D::name(),
U1 Const::<1>
)) ))
} }

View File

@ -3,9 +3,9 @@ use num::Zero;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::allocator::{Allocator, Reallocator}; use crate::allocator::{Allocator, Reallocator};
use crate::base::{DefaultAllocator, Matrix, MatrixMN, MatrixN, Unit, VectorN}; use crate::base::{Const, DefaultAllocator, Matrix, MatrixMN, MatrixN, Unit, VectorN};
use crate::constraint::{SameNumberOfRows, ShapeConstraint}; use crate::constraint::{SameNumberOfRows, ShapeConstraint};
use crate::dimension::{Dim, DimMin, DimMinimum, U1}; use crate::dimension::{Dim, DimMin, DimMinimum};
use crate::storage::{Storage, StorageMut}; use crate::storage::{Storage, StorageMut};
use crate::ComplexField; use crate::ComplexField;
@ -67,7 +67,7 @@ where
let mut p = PermutationSequence::identity_generic(min_nrows_ncols); let mut p = PermutationSequence::identity_generic(min_nrows_ncols);
let mut diag = let mut diag =
unsafe { crate::unimplemented_or_uninitialized_generic!(min_nrows_ncols, U1) }; unsafe { crate::unimplemented_or_uninitialized_generic!(min_nrows_ncols, Const::<1>) };
if min_nrows_ncols.value() == 0 { if min_nrows_ncols.value() == 0 {
return ColPivQR { return ColPivQR {

View File

@ -2,7 +2,7 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::allocator::Allocator; use crate::allocator::Allocator;
use crate::base::{DefaultAllocator, MatrixMN, MatrixN, VectorN}; use crate::base::{DefaultAllocator, MatrixN, VectorN};
use crate::dimension::{Const, DimDiff, DimSub, U1}; use crate::dimension::{Const, DimDiff, DimSub, U1};
use crate::storage::Storage; use crate::storage::Storage;
use simba::scalar::ComplexField; use simba::scalar::ComplexField;
@ -61,9 +61,12 @@ where
"Unable to compute the symmetric tridiagonal decomposition of an empty matrix." "Unable to compute the symmetric tridiagonal decomposition of an empty matrix."
); );
let mut off_diagonal = let mut off_diagonal = unsafe {
unsafe { crate::unimplemented_or_uninitialized_generic!(dim.sub(Const::<1>), Const::<1>) }; crate::unimplemented_or_uninitialized_generic!(dim.sub(Const::<1>), Const::<1>)
let mut p = unsafe { crate::unimplemented_or_uninitialized_generic!(dim.sub(Const::<1>), Const::<1>) }; };
let mut p = unsafe {
crate::unimplemented_or_uninitialized_generic!(dim.sub(Const::<1>), Const::<1>)
};
for i in 0..dim.value() - 1 { for i in 0..dim.value() - 1 {
let mut m = m.rows_range_mut(i + 1..); let mut m = m.rows_range_mut(i + 1..);

View File

@ -2,7 +2,7 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::allocator::Allocator; use crate::allocator::Allocator;
use crate::base::{DefaultAllocator, MatrixN, VectorN, U1}; use crate::base::{Const, DefaultAllocator, MatrixN, VectorN};
use crate::dimension::Dim; use crate::dimension::Dim;
use crate::storage::Storage; use crate::storage::Storage;
use simba::scalar::RealField; use simba::scalar::RealField;
@ -52,7 +52,7 @@ where
let n = p.ncols(); let n = p.ncols();
let n_dim = p.data.shape().1; let n_dim = p.data.shape().1;
let mut d = VectorN::zeros_generic(n_dim, U1); let mut d = VectorN::zeros_generic(n_dim, Const::<1>);
let mut u = MatrixN::zeros_generic(n_dim, n_dim); let mut u = MatrixN::zeros_generic(n_dim, n_dim);
d[n - 1] = p[(n - 1, n - 1)]; d[n - 1] = p[(n - 1, n - 1)];