TriangularViewMut

Struct TriangularViewMut 

Source
pub struct TriangularViewMut<'a, T: Scalar> { /* private fields */ }
Expand description

A mutable triangular matrix view over dense storage.

Implementations§

Source§

impl<'a, T: Scalar> TriangularViewMut<'a, T>

Source

pub fn new(mat: MatMut<'a, T>, uplo: TriangularKind, diag: DiagonalKind) -> Self

Creates a new mutable triangular view over a matrix.

Source

pub fn dim(&self) -> usize

Returns the matrix dimension.

Source

pub fn shape(&self) -> (usize, usize)

Returns the shape (n, n).

Source

pub fn uplo(&self) -> TriangularKind

Returns the triangular kind.

Source

pub fn diag(&self) -> DiagonalKind

Returns the diagonal kind.

Source

pub fn in_triangle(&self, row: usize, col: usize) -> bool

Returns true if element is in stored triangle.

Source

pub fn get(&self, row: usize, col: usize) -> Option<&T>

Returns a reference to element.

Source

pub fn get_mut(&mut self, row: usize, col: usize) -> Option<&mut T>

Returns a mutable reference to element.

Source

pub fn set(&mut self, row: usize, col: usize, value: T)

Sets an element in the stored triangle.

§Panics

Panics if the element is outside the stored triangle or on the diagonal for unit triangular matrices.

Source

pub fn rb(&self) -> TriangularView<'_, T>

Creates an immutable reborrow.

Source

pub fn rb_mut(&mut self) -> TriangularViewMut<'_, T>

Creates a mutable reborrow.

Source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns a mutable pointer to the data.

Source

pub fn fill(&mut self, value: T)

Fills the stored triangle with a value.

Does not modify the diagonal for unit triangular matrices.

Source

pub fn scale(&mut self, alpha: T)

Scales the stored triangle by a scalar.

Source

pub fn zero_non_triangle(&mut self)
where T: Zero,

Clears the non-stored triangle to zero.

Auto Trait Implementations§

§

impl<'a, T> Freeze for TriangularViewMut<'a, T>

§

impl<'a, T> RefUnwindSafe for TriangularViewMut<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for TriangularViewMut<'a, T>

§

impl<'a, T> Sync for TriangularViewMut<'a, T>

§

impl<'a, T> Unpin for TriangularViewMut<'a, T>

§

impl<'a, T> !UnwindSafe for TriangularViewMut<'a, T>

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