Struct totsu::MatBuild

source ·
pub struct MatBuild<L: LinAlgEx> { /* private fields */ }
Expand description

Matrix builder

Matrix struct which owns a Vec of data array and is able to be converted as totsu_core::MatOp. This struct relies on dynamic heap allocation.

Implementations§

Creates an instance.

Returns the MatBuild instance with zero data.

  • typ is Matrix type and size.

Size of the matrix.

Returns a tuple of a number of rows and columns.

Converted as totsu_core::MatOp.

Returns the totsu_core::MatOp borrowing the internal data array.

Checks if symmetric packed.

Returns true if MatType::SymPack, false otherwise.

Data by a function.

  • func takes a row and a column of the matrix and returns data of each element.

Builder pattern of MatBuild::set_by_fn.

Data by an iterator in column-major.

  • iter iterates matrix data in column-major.

Builder pattern of MatBuild::set_iter_colmaj.

Data by an iterator in row-major.

  • iter iterates matrix data in row-major.

Builder pattern of MatBuild::set_iter_rowmaj.

Scales by \(\alpha\).

  • alpha is a scalar \(\alpha\).

Builder pattern of MatBuild::set_scale.

Scales by \(\alpha\) except diagonal elements.

  • alpha is a scalar \(\alpha\).

Builder pattern of MatBuild::set_scale_nondiag.

Reshapes the internal data array as it is into a one-column matrix.

Builder pattern of MatBuild::set_reshape_colvec.

Calculates and converts the matrix \(A\) to \(A^{\frac12}\).

The matrix shall belong to MatType::SymPack.

Builder pattern of MatBuild::set_sqrt.

Trait Implementations§

Converts this type into a mutable reference of the (usually inferred) input type.
Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.