pub struct MatrixComplexF64 { /* private fields */ }

Implementations§

source§

impl MatrixComplexF64

source

pub fn new(n1: usize, n2: usize) -> Option<Self>

Creates a new MatrixF64.

source

pub fn new_with_init(n1: usize, n2: usize) -> Option<Self>

Creates a new MatrixF64 with all elements set to zero.

source

pub fn get(&self, y: usize, x: usize) -> ComplexF64

This function returns the (i,j)-th element of the matrix. If y or x lie outside the allowed range of 0 to n1-1 and 0 to n2-1 then the error handler is invoked and 0 is returned.

source

pub fn set(&mut self, y: usize, x: usize, value: &ComplexF64) -> &Self

This function sets the value of the (i,j)-th element of the matrix to value. If y or x lies outside the allowed range of 0 to n1-1 and 0 to n2-1 then the error handler is invoked.

source

pub fn set_all(&mut self, x: &ComplexF64) -> &Self

This function sets all the elements of the matrix to the value x.

source

pub fn set_zero(&mut self) -> &Self

This function sets all the elements of the matrix to zero.

source

pub fn set_identity(&mut self) -> &Self

This function sets the elements of the matrix to the corresponding elements of the identity matrix, m(i,j) = \delta(i,j), i.e. a unit diagonal with all off-diagonal elements zero. This applies to both square and rectangular matrices.

source

pub fn copy_from(&mut self, other: &MatrixComplexF64) -> Result<(), Value>

This function copies the elements of the other matrix into the self matrix. The two matrices must have the same size.

source

pub fn copy_to(&self, other: &mut MatrixComplexF64) -> Result<(), Value>

This function copies the elements of the self matrix into the other matrix. The two matrices must have the same size.

source

pub fn swap(&mut self, other: &mut MatrixComplexF64) -> Result<(), Value>

This function exchanges the elements of the matrices self and other by copying. The two matrices must have the same size.

source

pub fn get_row(&self, y: usize) -> Result<VectorComplexF64, Value>

This function copies the elements of the y-th row of the matrix into the returned vector.

source

pub fn get_col(&self, x: usize) -> Result<VectorComplexF64, Value>

This function copies the elements of the x-th column of the matrix into the returned vector.

source

pub fn set_row(&mut self, y: usize, v: &VectorComplexF64) -> Result<(), Value>

This function copies the elements of the vector v into the y-th row of the matrix. The length of the vector must be the same as the length of the row.

source

pub fn set_col(&mut self, x: usize, v: &VectorComplexF64) -> Result<(), Value>

This function copies the elements of the vector v into the x-th column of the matrix. The length of the vector must be the same as the length of the column.

source

pub fn swap_rows(&mut self, y1: usize, y2: usize) -> Result<(), Value>

This function exchanges the y1-th and y2-th rows of the matrix in-place.

source

pub fn swap_columns(&mut self, x1: usize, x2: usize) -> Result<(), Value>

This function exchanges the x1-th and x2-th columns of the matrix in-place.

source

pub fn swap_row_col(&mut self, i: usize, j: usize) -> Result<(), Value>

This function exchanges the i-th row and j-th column of the matrix in-place. The matrix must be square for this operation to be possible.

source

pub fn transpose_memcpy(&self) -> Result<MatrixComplexF64, Value>

This function returns the transpose of the matrix by copying the elements into it. This function works for all matrices provided that the dimensions of the matrix dest match the transposed dimensions of the matrix.

source

pub fn transpose(&mut self) -> Result<(), Value>

This function replaces the matrix m by its transpose by copying the elements of the matrix in-place. The matrix must be square for this operation to be possible.

source

pub fn add(&mut self, other: &MatrixComplexF64) -> Result<(), Value>

This function adds the elements of the other matrix to the elements of the self matrix. The result self(i,j) <- self(i,j) + other(i,j) is stored in self and other remains unchanged. The two matrices must have the same dimensions.

source

pub fn sub(&mut self, other: &MatrixComplexF64) -> Result<(), Value>

This function subtracts the elements of the other matrix from the elements of the self matrix. The result self(i,j) <- self(i,j) - other(i,j) is stored in self and other remains unchanged. The two matrices must have the same dimensions.

source

pub fn mul_elements(&mut self, other: &MatrixComplexF64) -> Result<(), Value>

This function multiplies the elements of the self matrix by the elements of the other matrix. The result self(i,j) <- self(i,j) * other(i,j) is stored in self and other remains unchanged. The two matrices must have the same dimensions.

source

pub fn div_elements(&mut self, other: &MatrixComplexF64) -> Result<(), Value>

This function divides the elements of the self matrix by the elements of the other matrix. The result self(i,j) <- self(i,j) / other(i,j) is stored in self and other remains unchanged. The two matrices must have the same dimensions.

source

pub fn scale(&mut self, x: &ComplexF64) -> Result<(), Value>

This function multiplies the elements of the self matrix by the constant factor x. The result self(i,j) <- x self(i,j) is stored in self.

source

pub fn add_constant(&mut self, x: &ComplexF64) -> Result<(), Value>

This function adds the constant value x to the elements of the self matrix. The result self(i,j) <- self(i,j) + x is stored in self.

source

pub fn is_null(&self) -> bool

This function returns true if all the elements of the self matrix are stricly zero.

source

pub fn is_pos(&self) -> bool

This function returns true if all the elements of the self matrix are stricly positive.

source

pub fn is_neg(&self) -> bool

This function returns true if all the elements of the self matrix are stricly negative.

source

pub fn is_non_neg(&self) -> bool

This function returns true if all the elements of the self matrix are stricly non-negative.

source

pub fn equal(&self, other: &MatrixComplexF64) -> bool

This function returns true if all elements of the two matrix are equal.

source

pub fn row<F: FnOnce(Option<VectorComplexF64View<'_>>)>( &mut self, i: usize, f: F )

source

pub fn column<F: FnOnce(Option<VectorComplexF64View<'_>>)>( &mut self, j: usize, f: F )

source

pub fn diagonal<F: FnOnce(Option<VectorComplexF64View<'_>>)>(&mut self, f: F)

source

pub fn subdiagonal<F: FnOnce(Option<VectorComplexF64View<'_>>)>( &mut self, k: usize, f: F )

source

pub fn superdiagonal<F: FnOnce(Option<VectorComplexF64View<'_>>)>( &mut self, k: usize, f: F )

source

pub fn subrow<F: FnOnce(Option<VectorComplexF64View<'_>>)>( &mut self, i: usize, offset: usize, n: usize, f: F )

source

pub fn subcolumn<F: FnOnce(Option<VectorComplexF64View<'_>>)>( &mut self, i: usize, offset: usize, n: usize, f: F )

source

pub fn size1(&self) -> usize

source

pub fn size2(&self) -> usize

source

pub fn clone(&self) -> Option<Self>

Trait Implementations§

source§

impl Debug for MatrixComplexF64

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for MatrixComplexF64

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.