pub struct QrDecomposition<Item: RlstScalar, ArrayImpl: UnsafeRandomAccessByValue<2, Item = Item> + Stride<2> + Shape<2> + RawAccessMut<Item = Item>> { /* private fields */ }
Expand description
QR decomposition
Implementations§
Source§impl<ArrayImpl: UnsafeRandomAccessByValue<2, Item = f64> + Stride<2> + Shape<2> + RawAccessMut<Item = f64>> QrDecomposition<f64, ArrayImpl>
impl<ArrayImpl: UnsafeRandomAccessByValue<2, Item = f64> + Stride<2> + Shape<2> + RawAccessMut<Item = f64>> QrDecomposition<f64, ArrayImpl>
Sourcepub fn new(arr: Array<f64, ArrayImpl, 2>) -> RlstResult<Self>
pub fn new(arr: Array<f64, ArrayImpl, 2>) -> RlstResult<Self>
Create a new QR Decomposition.
Sourcepub fn get_perm(&self) -> Vec<usize>
pub fn get_perm(&self) -> Vec<usize>
Return the permuation vector for the QR decomposition.
If perm[i] = j
then the ith column of QR corresponds
to the jth column of the original array.
Sourcepub fn get_r<ArrayImplR: UnsafeRandomAccessByValue<2, Item = f64> + UnsafeRandomAccessMut<2, Item = f64> + RawAccessMut<Item = f64> + Shape<2> + Stride<2>>(
&self,
arr: Array<f64, ArrayImplR, 2>,
)
pub fn get_r<ArrayImplR: UnsafeRandomAccessByValue<2, Item = f64> + UnsafeRandomAccessMut<2, Item = f64> + RawAccessMut<Item = f64> + Shape<2> + Stride<2>>( &self, arr: Array<f64, ArrayImplR, 2>, )
Return the R matrix of the QR decomposition.
If A
has dimension (m, n)
then R has
dimension (k, n)
with k=min(m, n)
.
Sourcepub fn get_p<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = f64> + UnsafeRandomAccessMut<2, Item = f64> + RawAccessMut<Item = f64> + Shape<2> + Stride<2>>(
&self,
arr: Array<f64, ArrayImplQ, 2>,
)
pub fn get_p<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = f64> + UnsafeRandomAccessMut<2, Item = f64> + RawAccessMut<Item = f64> + Shape<2> + Stride<2>>( &self, arr: Array<f64, ArrayImplQ, 2>, )
Return the permuation matrix P
.
For A
an (m,n)
matrix P
has dimension (n, n)
.
Sourcepub fn get_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = f64> + UnsafeRandomAccessMut<2, Item = f64> + RawAccessMut<Item = f64> + Shape<2> + Stride<2>>(
&self,
arr: Array<f64, ArrayImplQ, 2>,
) -> RlstResult<()>
pub fn get_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = f64> + UnsafeRandomAccessMut<2, Item = f64> + RawAccessMut<Item = f64> + Shape<2> + Stride<2>>( &self, arr: Array<f64, ArrayImplQ, 2>, ) -> RlstResult<()>
Return the Q matrix of the QR decomposition.
If A
has dimension (m, n)
then arr
needs
to be of dimension (m, r)
, where r<= m`` is the desired number of columns of
Q`.
This method allocates temporary memory during execution.
Sourcepub fn apply_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = f64> + UnsafeRandomAccessMut<2, Item = f64> + RawAccessMut<Item = f64> + Shape<2> + Stride<2>>(
&self,
arr: Array<f64, ArrayImplQ, 2>,
side: ApplyQSide,
trans: ApplyQTrans,
) -> RlstResult<()>
pub fn apply_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = f64> + UnsafeRandomAccessMut<2, Item = f64> + RawAccessMut<Item = f64> + Shape<2> + Stride<2>>( &self, arr: Array<f64, ArrayImplQ, 2>, side: ApplyQSide, trans: ApplyQTrans, ) -> RlstResult<()>
Apply Q to a given matrix.
This method allocates temporary memory during execution.
Source§impl<ArrayImpl: UnsafeRandomAccessByValue<2, Item = f32> + Stride<2> + Shape<2> + RawAccessMut<Item = f32>> QrDecomposition<f32, ArrayImpl>
impl<ArrayImpl: UnsafeRandomAccessByValue<2, Item = f32> + Stride<2> + Shape<2> + RawAccessMut<Item = f32>> QrDecomposition<f32, ArrayImpl>
Sourcepub fn new(arr: Array<f32, ArrayImpl, 2>) -> RlstResult<Self>
pub fn new(arr: Array<f32, ArrayImpl, 2>) -> RlstResult<Self>
Create a new QR Decomposition.
Sourcepub fn get_perm(&self) -> Vec<usize>
pub fn get_perm(&self) -> Vec<usize>
Return the permuation vector for the QR decomposition.
If perm[i] = j
then the ith column of QR corresponds
to the jth column of the original array.
Sourcepub fn get_r<ArrayImplR: UnsafeRandomAccessByValue<2, Item = f32> + UnsafeRandomAccessMut<2, Item = f32> + RawAccessMut<Item = f32> + Shape<2> + Stride<2>>(
&self,
arr: Array<f32, ArrayImplR, 2>,
)
pub fn get_r<ArrayImplR: UnsafeRandomAccessByValue<2, Item = f32> + UnsafeRandomAccessMut<2, Item = f32> + RawAccessMut<Item = f32> + Shape<2> + Stride<2>>( &self, arr: Array<f32, ArrayImplR, 2>, )
Return the R matrix of the QR decomposition.
If A
has dimension (m, n)
then R has
dimension (k, n)
with k=min(m, n)
.
Sourcepub fn get_p<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = f32> + UnsafeRandomAccessMut<2, Item = f32> + RawAccessMut<Item = f32> + Shape<2> + Stride<2>>(
&self,
arr: Array<f32, ArrayImplQ, 2>,
)
pub fn get_p<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = f32> + UnsafeRandomAccessMut<2, Item = f32> + RawAccessMut<Item = f32> + Shape<2> + Stride<2>>( &self, arr: Array<f32, ArrayImplQ, 2>, )
Return the permuation matrix P
.
For A
an (m,n)
matrix P
has dimension (n, n)
.
Sourcepub fn get_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = f32> + UnsafeRandomAccessMut<2, Item = f32> + RawAccessMut<Item = f32> + Shape<2> + Stride<2>>(
&self,
arr: Array<f32, ArrayImplQ, 2>,
) -> RlstResult<()>
pub fn get_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = f32> + UnsafeRandomAccessMut<2, Item = f32> + RawAccessMut<Item = f32> + Shape<2> + Stride<2>>( &self, arr: Array<f32, ArrayImplQ, 2>, ) -> RlstResult<()>
Return the Q matrix of the QR decomposition.
If A
has dimension (m, n)
then arr
needs
to be of dimension (m, r)
, where r<= m`` is the desired number of columns of
Q`.
This method allocates temporary memory during execution.
Sourcepub fn apply_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = f32> + UnsafeRandomAccessMut<2, Item = f32> + RawAccessMut<Item = f32> + Shape<2> + Stride<2>>(
&self,
arr: Array<f32, ArrayImplQ, 2>,
side: ApplyQSide,
trans: ApplyQTrans,
) -> RlstResult<()>
pub fn apply_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = f32> + UnsafeRandomAccessMut<2, Item = f32> + RawAccessMut<Item = f32> + Shape<2> + Stride<2>>( &self, arr: Array<f32, ArrayImplQ, 2>, side: ApplyQSide, trans: ApplyQTrans, ) -> RlstResult<()>
Apply Q to a given matrix.
This method allocates temporary memory during execution.
Source§impl<ArrayImpl: UnsafeRandomAccessByValue<2, Item = c64> + Stride<2> + Shape<2> + RawAccessMut<Item = c64>> QrDecomposition<c64, ArrayImpl>
impl<ArrayImpl: UnsafeRandomAccessByValue<2, Item = c64> + Stride<2> + Shape<2> + RawAccessMut<Item = c64>> QrDecomposition<c64, ArrayImpl>
Sourcepub fn new(arr: Array<c64, ArrayImpl, 2>) -> RlstResult<Self>
pub fn new(arr: Array<c64, ArrayImpl, 2>) -> RlstResult<Self>
Create a new QR Decomposition.
Sourcepub fn get_perm(&self) -> Vec<usize>
pub fn get_perm(&self) -> Vec<usize>
Return the permuation vector for the QR decomposition.
If perm[i] = j
then the ith column of QR corresponds
to the jth column of the original array.
Sourcepub fn get_r<ArrayImplR: UnsafeRandomAccessByValue<2, Item = c64> + UnsafeRandomAccessMut<2, Item = c64> + RawAccessMut<Item = c64> + Shape<2> + Stride<2>>(
&self,
arr: Array<c64, ArrayImplR, 2>,
)
pub fn get_r<ArrayImplR: UnsafeRandomAccessByValue<2, Item = c64> + UnsafeRandomAccessMut<2, Item = c64> + RawAccessMut<Item = c64> + Shape<2> + Stride<2>>( &self, arr: Array<c64, ArrayImplR, 2>, )
Return the R matrix of the QR decomposition.
If A
has dimension (m, n)
then R has
dimension (k, n)
with k=min(m, n)
.
Sourcepub fn get_p<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = c64> + UnsafeRandomAccessMut<2, Item = c64> + RawAccessMut<Item = c64> + Shape<2> + Stride<2>>(
&self,
arr: Array<c64, ArrayImplQ, 2>,
)
pub fn get_p<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = c64> + UnsafeRandomAccessMut<2, Item = c64> + RawAccessMut<Item = c64> + Shape<2> + Stride<2>>( &self, arr: Array<c64, ArrayImplQ, 2>, )
Return the permuation matrix P
.
For A
an (m,n)
matrix P
has dimension (n, n)
.
Sourcepub fn get_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = c64> + UnsafeRandomAccessMut<2, Item = c64> + RawAccessMut<Item = c64> + Shape<2> + Stride<2>>(
&self,
arr: Array<c64, ArrayImplQ, 2>,
) -> RlstResult<()>
pub fn get_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = c64> + UnsafeRandomAccessMut<2, Item = c64> + RawAccessMut<Item = c64> + Shape<2> + Stride<2>>( &self, arr: Array<c64, ArrayImplQ, 2>, ) -> RlstResult<()>
Return the Q matrix of the QR decomposition.
If A
has dimension (m, n)
then arr
needs
to be of dimension (m, r)
, where r<= m`` is the desired number of columns of
Q`.
This method allocates temporary memory during execution.
Sourcepub fn apply_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = c64> + UnsafeRandomAccessMut<2, Item = c64> + RawAccessMut<Item = c64> + Shape<2> + Stride<2>>(
&self,
arr: Array<c64, ArrayImplQ, 2>,
side: ApplyQSide,
trans: ApplyQTrans,
) -> RlstResult<()>
pub fn apply_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = c64> + UnsafeRandomAccessMut<2, Item = c64> + RawAccessMut<Item = c64> + Shape<2> + Stride<2>>( &self, arr: Array<c64, ArrayImplQ, 2>, side: ApplyQSide, trans: ApplyQTrans, ) -> RlstResult<()>
Apply Q to a given matrix.
This method allocates temporary memory during execution.
Source§impl<ArrayImpl: UnsafeRandomAccessByValue<2, Item = c32> + Stride<2> + Shape<2> + RawAccessMut<Item = c32>> QrDecomposition<c32, ArrayImpl>
impl<ArrayImpl: UnsafeRandomAccessByValue<2, Item = c32> + Stride<2> + Shape<2> + RawAccessMut<Item = c32>> QrDecomposition<c32, ArrayImpl>
Sourcepub fn new(arr: Array<c32, ArrayImpl, 2>) -> RlstResult<Self>
pub fn new(arr: Array<c32, ArrayImpl, 2>) -> RlstResult<Self>
Create a new QR Decomposition.
Sourcepub fn get_perm(&self) -> Vec<usize>
pub fn get_perm(&self) -> Vec<usize>
Return the permuation vector for the QR decomposition.
If perm[i] = j
then the ith column of QR corresponds
to the jth column of the original array.
Sourcepub fn get_r<ArrayImplR: UnsafeRandomAccessByValue<2, Item = c32> + UnsafeRandomAccessMut<2, Item = c32> + RawAccessMut<Item = c32> + Shape<2> + Stride<2>>(
&self,
arr: Array<c32, ArrayImplR, 2>,
)
pub fn get_r<ArrayImplR: UnsafeRandomAccessByValue<2, Item = c32> + UnsafeRandomAccessMut<2, Item = c32> + RawAccessMut<Item = c32> + Shape<2> + Stride<2>>( &self, arr: Array<c32, ArrayImplR, 2>, )
Return the R matrix of the QR decomposition.
If A
has dimension (m, n)
then R has
dimension (k, n)
with k=min(m, n)
.
Sourcepub fn get_p<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = c32> + UnsafeRandomAccessMut<2, Item = c32> + RawAccessMut<Item = c32> + Shape<2> + Stride<2>>(
&self,
arr: Array<c32, ArrayImplQ, 2>,
)
pub fn get_p<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = c32> + UnsafeRandomAccessMut<2, Item = c32> + RawAccessMut<Item = c32> + Shape<2> + Stride<2>>( &self, arr: Array<c32, ArrayImplQ, 2>, )
Return the permuation matrix P
.
For A
an (m,n)
matrix P
has dimension (n, n)
.
Sourcepub fn get_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = c32> + UnsafeRandomAccessMut<2, Item = c32> + RawAccessMut<Item = c32> + Shape<2> + Stride<2>>(
&self,
arr: Array<c32, ArrayImplQ, 2>,
) -> RlstResult<()>
pub fn get_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = c32> + UnsafeRandomAccessMut<2, Item = c32> + RawAccessMut<Item = c32> + Shape<2> + Stride<2>>( &self, arr: Array<c32, ArrayImplQ, 2>, ) -> RlstResult<()>
Return the Q matrix of the QR decomposition.
If A
has dimension (m, n)
then arr
needs
to be of dimension (m, r)
, where r<= m`` is the desired number of columns of
Q`.
This method allocates temporary memory during execution.
Sourcepub fn apply_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = c32> + UnsafeRandomAccessMut<2, Item = c32> + RawAccessMut<Item = c32> + Shape<2> + Stride<2>>(
&self,
arr: Array<c32, ArrayImplQ, 2>,
side: ApplyQSide,
trans: ApplyQTrans,
) -> RlstResult<()>
pub fn apply_q_alloc<ArrayImplQ: UnsafeRandomAccessByValue<2, Item = c32> + UnsafeRandomAccessMut<2, Item = c32> + RawAccessMut<Item = c32> + Shape<2> + Stride<2>>( &self, arr: Array<c32, ArrayImplQ, 2>, side: ApplyQSide, trans: ApplyQTrans, ) -> RlstResult<()>
Apply Q to a given matrix.
This method allocates temporary memory during execution.
Auto Trait Implementations§
impl<Item, ArrayImpl> Freeze for QrDecomposition<Item, ArrayImpl>where
ArrayImpl: Freeze,
impl<Item, ArrayImpl> RefUnwindSafe for QrDecomposition<Item, ArrayImpl>where
ArrayImpl: RefUnwindSafe,
Item: RefUnwindSafe,
impl<Item, ArrayImpl> Send for QrDecomposition<Item, ArrayImpl>where
ArrayImpl: Send,
impl<Item, ArrayImpl> Sync for QrDecomposition<Item, ArrayImpl>where
ArrayImpl: Sync,
impl<Item, ArrayImpl> Unpin for QrDecomposition<Item, ArrayImpl>
impl<Item, ArrayImpl> UnwindSafe for QrDecomposition<Item, ArrayImpl>where
ArrayImpl: UnwindSafe,
Item: UnwindSafe,
Blanket Implementations§
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more