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>
impl<T, Dim: Shape> Diag<T, Dim>
Sourcepub fn column_vector(&self) -> ColRef<'_, T, Dim>
pub fn column_vector(&self) -> ColRef<'_, T, Dim>
returns the diagonal as a column vector
Sourcepub fn column_vector_mut(&mut self) -> ColMut<'_, T, Dim>
pub fn column_vector_mut(&mut self) -> ColMut<'_, T, Dim>
returns the diagonal as a column vector
Sourcepub fn into_column_vector(self) -> Col<T, Dim>
pub fn into_column_vector(self) -> Col<T, Dim>
returns the diagonal as a column vector
Sourcepub fn as_dyn(&self) -> DiagRef<'_, T>
pub fn as_dyn(&self) -> DiagRef<'_, T>
see DiagRef::as_dyn
Sourcepub fn as_dyn_mut(&mut self) -> DiagMut<'_, T>
pub fn as_dyn_mut(&mut self) -> DiagMut<'_, T>
Sourcepub fn as_shape_mut<D: Shape>(&mut self, len: D) -> DiagMut<'_, T, D>
pub fn as_shape_mut<D: Shape>(&mut self, len: D) -> DiagMut<'_, T, D>
Sourcepub fn conjugate_mut(&mut self) -> DiagMut<'_, T::Conj, Dim>where
T: Conjugate,
pub fn conjugate_mut(&mut self) -> DiagMut<'_, T::Conj, Dim>where
T: Conjugate,
Sourcepub fn canonical_mut(&mut self) -> DiagMut<'_, T::Canonical, Dim>where
T: Conjugate,
pub fn canonical_mut(&mut self) -> DiagMut<'_, T::Canonical, Dim>where
T: Conjugate,
Sourcepub fn zeros(dim: Dim) -> Selfwhere
T: ComplexField,
pub fn zeros(dim: Dim) -> Selfwhere
T: ComplexField,
returns a new diagonal with dimension dim, filled with zeros
Sourcepub fn ones(dim: Dim) -> Selfwhere
T: ComplexField,
pub fn ones(dim: Dim) -> Selfwhere
T: ComplexField,
returns a new diagonal with dimension dim, filled with ones
Sourcepub fn full(dim: Dim, value: T) -> Selfwhere
T: Clone,
pub fn full(dim: Dim, value: T) -> Selfwhere
T: Clone,
returns a new diagonal with dimension dim, filled with value
Sourcepub fn copy_from<RhsT: Conjugate<Canonical = T>>(
&mut self,
rhs: impl AsDiagRef<T = RhsT, Dim = Dim>,
)where
T: ComplexField,
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>
impl<T: ComplexField, ViewT: Conjugate<Canonical = T>> BiLinOp<T> for Diag<ViewT>
Source§fn transpose_apply_scratch(&self, rhs_ncols: usize, par: Par) -> StackReq
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 columnsSource§impl<T: ComplexField, ViewT: Conjugate<Canonical = T>> BiPrecond<T> for Diag<ViewT>
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
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 placeSource§impl<T: ComplexField, ViewT: Conjugate<Canonical = T>> LinOp<T> for Diag<ViewT>
impl<T: ComplexField, ViewT: Conjugate<Canonical = T>> LinOp<T> for Diag<ViewT>
Source§fn apply_scratch(&self, rhs_ncols: usize, par: Par) -> StackReq
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 columnsSource§impl<T: ComplexField, ViewT: Conjugate<Canonical = T>> Precond<T> for Diag<ViewT>
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
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