Struct linxal::generate::matgen::RandomSymmetric
[−]
[src]
pub struct RandomSymmetric<T: MG> { /* fields omitted */ }
Structure for creating symmetric matrices.
Methods
impl<T: MG> RandomSymmetric<T>
[src]
fn new<Rand: Rng>(n: usize, rand: &mut Rand) -> RandomSymmetric<T>
Create a new matrix generator for random semi-positive definite matrices.
fn rank(&mut self, n: usize) -> &mut Self
Set the rank of the matrix.
The rank is capped to the size of the matrix.
Remarks
The rank is ignored when the eigenvalues / singular values are given as input.
fn full_rank(&mut self) -> &mut Self
Set the matrix to be full rank.
Remarks
The rank is ignored when the eigenvalues / singular values are given as input.
fn bands(&mut self, band: usize) -> &mut Self
Set the upper and lower band of the matrix.
If the band is larger than the matrix, it is interpreted as a full-sized matrix.
fn full_bands(&mut self) -> &mut Self
Set the matrix to be full bandwidth.
fn diagonal(&mut self) -> &mut Self
Set the matrix to be diagonal.
fn packing(&mut self, packing: Packing) -> &mut Self
Set how the entries of the matrix are packed.
fn eigenvalues(&mut self, values: &[T::RealPart]) -> &mut Self
Set the eigenvalues to the specified values.
When the rank of the matrix is specified as k
, any values
after the k
th are ignored and set to zero when the matrix is
generated.
fn ev(&mut self, values: &[T::RealPart]) -> &mut Self
Set the eigenvalues to the specified values.
Equivalent to the eigenvalues
function.
fn ev_random_uniform<F: Into<T::RealPart>>(&mut self,
min: F,
max: F)
-> &mut Self
min: F,
max: F)
-> &mut Self
Draw the eigenvalues from a uniform distribution.
fn generate(&mut self) -> Result<Array<T, Ix2>, GenerateError>
Generate a matrix matching the specifications previously specified.
fn generate_with_ev(&mut self)
-> Result<(Array<T, Ix2>, Array<T::RealPart, Ix1>), GenerateError>
-> Result<(Array<T, Ix2>, Array<T::RealPart, Ix1>), GenerateError>
Generate a matrix matching the specifications, and return the eigenvalues of the generated matrix.
The returned eigenvalues include any changes made