Struct QrDecomposition

Source
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>

Source

pub fn new(arr: Array<f64, ArrayImpl, 2>) -> RlstResult<Self>

Create a new QR Decomposition.

Source

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.

Source

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).

Source

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).

Source

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.

Source

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>

Source

pub fn new(arr: Array<f32, ArrayImpl, 2>) -> RlstResult<Self>

Create a new QR Decomposition.

Source

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.

Source

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).

Source

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).

Source

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.

Source

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>

Source

pub fn new(arr: Array<c64, ArrayImpl, 2>) -> RlstResult<Self>

Create a new QR Decomposition.

Source

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.

Source

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).

Source

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).

Source

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.

Source

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>

Source

pub fn new(arr: Array<c32, ArrayImpl, 2>) -> RlstResult<Self>

Create a new QR Decomposition.

Source

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.

Source

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).

Source

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).

Source

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.

Source

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>
where ArrayImpl: Unpin, Item: Unpin,

§

impl<Item, ArrayImpl> UnwindSafe for QrDecomposition<Item, ArrayImpl>
where ArrayImpl: UnwindSafe, Item: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

§

type Err = NoError

The error type produced by a failed conversion.
§

fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>

Convert the given value into an approximately equivalent representation.
§

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

§

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.
§

fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>

Convert the subject into an approximately equivalent representation.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T, Dst> ConvAsUtil<Dst> for T

§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
§

impl<T> ConvUtil for T

§

fn approx_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject to a given type with the default scheme.
§

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<Src> TryFrom<Src> for Src

§

type Err = NoError

The error type produced by a failed conversion.
§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<Src> ValueFrom<Src> for Src

§

type Err = NoError

The error type produced by a failed conversion.
§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.