Diag

Type Alias Diag 

Source
pub type Diag<T, Dim = usize> = Diag<Own<T, Dim>>;
Expand description

diagonal matrix

Aliased Type§

#[repr(transparent)]
pub struct Diag<T, Dim = usize>(pub Own<T, Dim>);

Tuple Fields§

§0: Own<T, Dim>

Implementations§

Source§

impl<T, Dim: Shape> Diag<T, Dim>

Source

pub fn column_vector(&self) -> ColRef<'_, T, Dim>

returns the diagonal as a column vector

Source

pub fn column_vector_mut(&mut self) -> ColMut<'_, T, Dim>

returns the diagonal as a column vector

Source

pub fn into_column_vector(self) -> Col<T, Dim>

returns the diagonal as a column vector

Source

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

returns a view over self

Source

pub fn as_mut(&mut self) -> DiagMut<'_, T, Dim>

returns a view over self

Source

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

Source

pub fn as_dyn(&self) -> DiagRef<'_, T>

Source

pub fn as_dyn_mut(&mut self) -> DiagMut<'_, T>

Source

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

Source

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

Source

pub fn as_shape_mut<D: Shape>(&mut self, len: D) -> DiagMut<'_, T, D>

Source

pub fn conjugate_mut(&mut self) -> DiagMut<'_, T::Conj, Dim>
where T: Conjugate,

Source

pub fn canonical_mut(&mut self) -> DiagMut<'_, T::Canonical, Dim>
where T: Conjugate,

Source

pub fn dim(&self) -> Dim

returns the dimension of self

Source

pub fn zeros(dim: Dim) -> Self
where T: ComplexField,

returns a new diagonal with dimension dim, filled with zeros

Source

pub fn ones(dim: Dim) -> Self
where T: ComplexField,

returns a new diagonal with dimension dim, filled with ones

Source

pub fn full(dim: Dim, value: T) -> Self
where T: Clone,

returns a new diagonal with dimension dim, filled with value

Source

pub fn copy_from<RhsT: Conjugate<Canonical = T>>( &mut self, rhs: impl AsDiagRef<T = RhsT, Dim = Dim>, )
where T: ComplexField,

copies other into self

Trait Implementations§

Source§

impl<T: ComplexField, ViewT: Conjugate<Canonical = T>> BiLinOp<T> for Diag<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 Diag<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 Diag<ViewT>

Source§

fn nrows(&self) -> usize

output dimension of the operator
Source§

fn ncols(&self) -> usize

input dimension of the operator
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 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 Diag<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