Struct rgsl::types::matrix_complex::MatrixComplexF32 [] [src]

pub struct MatrixComplexF32 {
    // some fields omitted
}

Methods

impl MatrixComplexF32
[src]

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

Creates a new MatrixF64 with all elements set to zero

Example with n1 = 2 and n2 = 3 :

XX XX XX

XX XX XX

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

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.

fn set(&self, y: usize, x: usize, value: &ComplexF32) -> &MatrixComplexF32

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.

fn set_all(&self, x: &ComplexF32) -> &MatrixComplexF32

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

fn set_zero(&self) -> &MatrixComplexF32

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

fn set_identity(&self) -> &MatrixComplexF32

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.

fn copy_from(&self, other: &MatrixComplexF32) -> Value

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

fn copy_to(&self, other: &MatrixComplexF32) -> Value

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

fn swap(&self, other: &MatrixComplexF32) -> Value

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

fn get_row(&self, y: usize) -> Option<(VectorComplexF32, Value)>

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

fn get_col(&self, x: usize) -> Option<(VectorComplexF32, Value)>

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

fn set_row(&self, y: usize, v: &VectorComplexF32) -> 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.

fn set_col(&self, x: usize, v: &VectorComplexF32) -> 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.

fn swap_rows(&self, y1: usize, y2: usize) -> Value

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

fn swap_columns(&self, x1: usize, x2: usize) -> Value

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

fn swap_row_col(&self, i: usize, j: usize) -> 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.

fn transpose_memcpy(&self) -> Option<(MatrixComplexF32, 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.

fn transpose(&self) -> 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.

fn add(&self, other: &MatrixComplexF32) -> 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.

fn sub(&self, other: &MatrixComplexF32) -> 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.

fn mul_elements(&self, other: &MatrixComplexF32) -> 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.

fn div_elements(&self, other: &MatrixComplexF32) -> 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.

fn scale(&self, x: &ComplexF32) -> 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.

fn add_constant(&self, x: &ComplexF32) -> 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.

fn is_null(&self) -> bool

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

fn is_pos(&self) -> bool

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

fn is_neg(&self) -> bool

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

fn is_non_neg(&self) -> bool

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

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

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

fn clone(&self) -> Option<MatrixComplexF32>

Trait Implementations

impl Drop for MatrixComplexF32
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more

impl Debug for MatrixComplexF32
[src]

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

Formats the value using the given formatter.