DiagRef

Type Alias DiagRef 

Source
pub type DiagRef<'a, T, Dim = usize, Stride = isize> = Diag<Ref<'a, T, Dim, Stride>>;
Expand description

diagonal matrix view

Aliased Type§

#[repr(transparent)]
pub struct DiagRef<'a, T, Dim = usize, Stride = isize>(pub Ref<'a, T, Dim, Stride>);

Tuple Fields§

§0: Ref<'a, T, Dim, Stride>

Implementations§

Source§

impl<'a, T> DiagRef<'a, T>

Source

pub fn from_ref(value: &'a T) -> Self

creates a diagonal matrix view over the given element

Source

pub fn from_slice(slice: &'a [T]) -> Self

creates a DiagRef from slice views over the diagonal data, the result has the same dimension as the length of the input slice

Source§

impl<'a, T, Dim: Shape, Stride: Stride> DiagRef<'a, T, Dim, Stride>

Source

pub const unsafe fn from_raw_parts( ptr: *const T, dim: Dim, stride: Stride, ) -> Self

creates a DiagRef from pointers to the diagonal data, dimension, and stride

§safety

this function has the same safety requirements as [MatRef::from_raw_parts(ptr, dim, 1, stride, 0)]

Source

pub fn column_vector(self) -> ColRef<'a, T, Dim, Stride>

returns the diagonal as a column vector view.

Source

pub fn as_ref(&self) -> DiagRef<'_, T, Dim, Stride>

returns a view over self

Source

pub fn as_shape<D: Shape>(self, len: D) -> DiagRef<'a, T, D, Stride>

returns the input matrix with the given shape after checking that it matches the current shape

Source

pub fn as_dyn(self) -> DiagRef<'a, T, usize, Stride>

returns the input matrix with dynamic shape

Source

pub fn as_dyn_stride(self) -> DiagRef<'a, T, Dim>

returns the input matrix with dynamic stride

Source

pub fn conjugate(self) -> DiagRef<'a, T::Conj, Dim, Stride>
where T: Conjugate,

returns a view over the conjugate of self

Source

pub fn canonical(self) -> DiagRef<'a, T::Canonical, Dim, Stride>
where T: Conjugate,

returns an unconjugated view over self

Source

pub fn dim(&self) -> Dim

returns the dimension of self

Trait Implementations§

Source§

impl<T, Dim: Shape, Stride: Stride> AsDiagRef for DiagRef<'_, T, Dim, Stride>

Source§

type Dim = Dim

dimension type
Source§

type T = T

scalar type
Source§

fn as_diag_ref(&self) -> DiagRef<'_, Self::T, Self::Dim>

returns a view over self
Source§

impl<T: ComplexField, ViewT: Conjugate<Canonical = T>> BiLinOp<T> for DiagRef<'_, ViewT>

Source§

fn transpose_apply_scratch(&self, rhs_ncols: usize, par: Par) -> StackReq

computes the workspace size and alignment required to apply the transpose or adjoint o self to a matrix with rhs_ncols columns
Source§

fn transpose_apply( &self, out: MatMut<'_, T>, rhs: MatRef<'_, T>, par: Par, stack: &mut MemStack, )

applies the transpose of self to rhs, and stores the result in out
Source§

fn adjoint_apply( &self, out: MatMut<'_, T>, rhs: MatRef<'_, T>, par: Par, stack: &mut MemStack, )

applies the adjoint of self to rhs, and stores the result in out
Source§

impl<T: ComplexField, ViewT: Conjugate<Canonical = T>> BiPrecond<T> for DiagRef<'_, ViewT>

Source§

fn transpose_apply_in_place_scratch( &self, rhs_ncols: usize, par: Par, ) -> StackReq

computes the workspace size and alignment required to apply the transpose or adjoint of self to a matrix with rhs_ncols columns in place
Source§

fn transpose_apply_in_place( &self, rhs: MatMut<'_, T>, par: Par, stack: &mut MemStack, )

applies the transpose of self to rhs, and stores the result in rhs
Source§

fn adjoint_apply_in_place( &self, rhs: MatMut<'_, T>, par: Par, stack: &mut MemStack, )

applies the adjoint of self to rhs, and stores the result in rhs
Source§

impl<T: ComplexField, ViewT: Conjugate<Canonical = T>> LinOp<T> for DiagRef<'_, ViewT>

Source§

fn apply_scratch(&self, rhs_ncols: usize, par: Par) -> StackReq

computes the workspace size and alignment required to apply self or the conjugate o self to a matrix with rhs_ncols columns
Source§

fn nrows(&self) -> usize

output dimension of the operator
Source§

fn ncols(&self) -> usize

input dimension of the operator
Source§

fn apply( &self, out: MatMut<'_, T>, rhs: MatRef<'_, T>, par: Par, stack: &mut MemStack, )

applies self to rhs, and stores the result in out
Source§

fn conj_apply( &self, out: MatMut<'_, T>, rhs: MatRef<'_, T>, par: Par, stack: &mut MemStack, )

applies the conjugate of self to rhs, and stores the result in out
Source§

impl<T: ComplexField, ViewT: Conjugate<Canonical = T>> Precond<T> for DiagRef<'_, ViewT>

Source§

fn apply_in_place_scratch(&self, rhs_ncols: usize, par: Par) -> StackReq

computes the workspace size and alignment required to apply self or the conjugate of self to a matrix with rhs_ncols columns in place
Source§

fn apply_in_place(&self, rhs: MatMut<'_, T>, par: Par, stack: &mut MemStack)

applies self to rhs, and stores the result in rhs
Source§

fn conj_apply_in_place( &self, rhs: MatMut<'_, T>, par: Par, stack: &mut MemStack, )

applies the conjugate of self to rhs, and stores the result in rhs