[][src]Module modcholesky::utils

Utility functions

Functions

diag_mat_from_arr

Builds a diagonal matrix from a 1D slice

eigenvalues_2x2

Computes the Eigenvalues of a 2x2 matrix

index_of_largest

Returns the index of the largest element in a 1D array

index_of_largest_abs

Returns the index of the element with the largest absolute value in a 1D array

index_to_permutation_mat

Returns the permutation matrix for a vector of permuted indices

random_diagonal

Returns a random diagonal matrix with Eigenvalues inbetween eig_range_min and eig_range_max. The minimum number of negative eigenvalues can be specified with min_neg_eigenvalues. Takes a seed for random values.

random_householder

Returns a random Householder matrix of dimension dim and with seed seed.

swap_columns

Swaps columns idx1 and idx2 of matrix mat

swap_rows

Swaps rows idx1 and idx2 of matrix mat