H2Lib
3.0
|
Solve symmetric eigenproblems and compute singular value decompositions. More...
Data Structures | |
struct | _tridiag |
Real tridiagonal matrix , represented by vectors containing the diagonal, sub- and superdiagonal. More... | |
Typedefs | |
typedef struct _tridiag | tridiag |
Tridiagonal matrix. | |
typedef tridiag * | ptridiag |
Pointer to a tridiag object. | |
typedef const tridiag * | pctridiag |
Pointer to a constant tridiag object. | |
Functions | |
ptridiag | init_tridiag (ptridiag T, uint size) |
Initialize a tridiag object. More... | |
ptridiag | init_sub_tridiag (ptridiag T, ptridiag src, uint size, uint off) |
Initialize a tridiag object to represent a submatrix. More... | |
ptridiag | init_vec_tridiag (ptridiag T, prealavector src, uint size) |
Initialize a tridiag object using pre-allocated storage. More... | |
void | uninit_tridiag (ptridiag T) |
Uninitialize a tridiag object. More... | |
ptridiag | new_tridiag (uint size) |
Create a new tridiag object. More... | |
void | del_tridiag (ptridiag T) |
Delete a tridiag object. More... | |
void | copy_tridiag (pctridiag T, ptridiag Tcopy) |
Copy a matrix into another matrix, . More... | |
real | check_tridiag (pctridiag T, pcamatrix Ts) |
Compute the Frobenius norm of the difference of a tridiagonal matrix and a general matrix . More... | |
real | check_lower_tridiag (pctridiag T, pcamatrix Ts) |
Compute the Frobenius norm of the difference of a lower bidiagonal matrix and a general matrix . More... | |
void | diageval_tridiag_amatrix (field alpha, bool atrans, pctridiag a, bool xtrans, pamatrix x) |
Multiply a matrix by the diagonal part of a tridiagonal matrix, . More... | |
void | lowereval_tridiag_amatrix (field alpha, bool atrans, pctridiag a, bool xtrans, pamatrix x) |
Multiply a matrix by the lower bidiagonal part of a tridiagonal matrix, . More... | |
void | qrstep_tridiag (ptridiag T, field shift, pamatrix Q) |
Perform one implicit QR step on a self-adjoint tridiagonal matrix. More... | |
uint | sb_muleig_tridiag (ptridiag T, pamatrix Q, uint maxiter) |
Solve a self-adjoint tridiagonal eigenproblem, self-made implementation without BLAS or LAPACK. More... | |
uint | muleig_tridiag (ptridiag T, pamatrix Q) |
Solve a self-adjoint tridiagonal eigenproblem. More... | |
uint | eig_tridiag (ptridiag T, pamatrix Q) |
Solve a self-adjoint tridiagonal eigenproblem. More... | |
void | sb_tridiagonalize_amatrix (pamatrix A, ptridiag T, pamatrix Q) |
Hessenberg tridiagonalization of a self-adjoint matrix, self-made implementation without BLAS or LAPACK. More... | |
void | tridiagonalize_amatrix (pamatrix A, ptridiag T, pamatrix Q) |
Hessenberg tridiagonalization of a self-adjoint matrix. More... | |
uint | sb_eig_amatrix (pamatrix A, prealavector lambda, pamatrix Q, uint maxiter) |
Solve a self-adjoint eigenproblem, self-made implementation without BLAS or LAPACK. More... | |
uint | eig_amatrix (pamatrix A, prealavector lambda, pamatrix Q) |
Solve a self-adjoint eigenproblem, . More... | |
uint | geig_amatrix (pamatrix A, pamatrix M, prealavector lambda, pamatrix Q) |
Solve self-adjoint generalized eigenproblem, . More... | |
void | svdstep_tridiag (ptridiag T, field shift, pamatrix U, pamatrix Vt) |
Perform one step of the Golub-Kahan iteration on a lower bidiagonal matrix. More... | |
uint | sb_mulsvd_tridiag (ptridiag T, pamatrix U, pamatrix Vt, uint maxiter) |
Compute the SVD of a bidiagonal matrix, self-made implementation without BLAS or LAPACK. More... | |
uint | mulsvd_tridiag (ptridiag T, pamatrix U, pamatrix Vt) |
Compute the SVD of a bidiagonal matrix. More... | |
uint | svd_tridiag (ptridiag T, pamatrix U, pamatrix Vt) |
Compute the SVD of a bidiagonal matrix. More... | |
void | sb_bidiagonalize_amatrix (pamatrix A, ptridiag T, pamatrix U, pamatrix Vt) |
Golub-Kahan bidiagonalization of a matrix, self-made implementation without BLAS or LAPACK. More... | |
void | bidiagonalize_amatrix (pamatrix A, ptridiag T, pamatrix U, pamatrix Vt) |
Golub-Kahan bidiagonalization of a matrix. More... | |
uint | sb_svd_amatrix (pamatrix A, prealavector sigma, pamatrix U, pamatrix Vt, uint maxiter) |
Compute the SVD of a matrix, self-made implementation without BLAS or LAPACK. More... | |
uint | svd_amatrix (pamatrix A, prealavector sigma, pamatrix U, pamatrix Vt) |
Compute the SVD of a matrix. More... | |
Solve symmetric eigenproblems and compute singular value decompositions.
Golub-Kahan bidiagonalization of a matrix.
Compute unitary matrices and and a lower bidiagonal matrix such that .
A | Matrix , will be overwritten by the function. |
T | Bidiagonal matrix . |
U | If U!=0 , this matrix will be filled with the unitary transformation . |
Vt | If Vt!=0 , this matrix will be filled with the adjoint unitary transformation . |
Copy a matrix into another matrix, .
T | Source matrix . |
Tcopy | Target matrix . |
void del_tridiag | ( | ptridiag | T | ) |
Delete a tridiag object.
Releases the storage corresponding to the object.
T | Object to be deleted. |
Multiply a matrix by the diagonal part of a tridiagonal matrix, .
alpha | Scaling factor . |
atrans | Set if is to be used instead of . |
a | Matrix , only its diagonal will be used. |
xtrans | Set if is to be used instead of . |
x | Matrix , will be overwritten by the result. |
uint eig_amatrix | ( | pamatrix | A, |
prealavector | lambda, | ||
pamatrix | Q | ||
) |
Solve a self-adjoint eigenproblem, .
A | Matrix , will be overwritten by the function. |
lambda | Eigenvalues of , in ascending order. |
Q | If Q!=0 , the columns of this matrix will contain an orthonormal basis of eigenvectors corresponding to the eigenvalues in lambda . |
Solve a self-adjoint tridiagonal eigenproblem.
Eigenvalues will be on the diagonal of T
, in ascending order.
T | Matrix , will be overwritten by a diagonal matrix such that with a unitary matrix . |
Q | If Q!=0 , this matrix will be filled with an orthonormal basis of eigenvectors. |
uint geig_amatrix | ( | pamatrix | A, |
pamatrix | M, | ||
prealavector | lambda, | ||
pamatrix | Q | ||
) |
Solve self-adjoint generalized eigenproblem, .
A | Matrix , will be overwritten by the function. |
M | Matrix , will be overwritten by the Cholesky factorization of . |
lambda | Eigenvalues of , in ascending order. |
Q | If Q!=0 , the columns of this matrix will contain an -orthonormal basis of eigenvectors corresponding to the eigenvalues in lambda . |
Initialize a tridiag object to represent a submatrix.
Sets up the components of the object and uses part of the storage of another amatrix for the coefficient vectors, leading to a new matrix representing a submatrix of the source.
T | Object to be initialized. |
src | Source matrix . |
size | Dimension of submatrix. |
off | Row and column offset. |
Initialize a tridiag object.
Sets up the components of the object and allocates storage for the coefficient vectors.
T | Object to be initialized. |
size | Dimension of the new matrix. |
ptridiag init_vec_tridiag | ( | ptridiag | T, |
prealavector | src, | ||
uint | size | ||
) |
Initialize a tridiag object using pre-allocated storage.
Sets up the components of the object and uses the storage of a vector of at least dimension 3*dim-2
for the coefficient vectors.
T | Object to be initialized. |
src | Source vector. |
size | Dimension of the new matrix. |
Multiply a matrix by the lower bidiagonal part of a tridiagonal matrix, .
alpha | Scaling factor . |
atrans | Set if is to be used instead of . |
a | Matrix , only its diagonal and lower subdiagonal will be used. |
xtrans | Set if is to be used instead of . |
x | Matrix , will be overwritten by the result. |
Solve a self-adjoint tridiagonal eigenproblem.
Eigenvalues will be on the diagonal of T
, in ascending order.
T | Matrix , will be overwritten by a diagonal matrix such that with a unitary matrix . |
Q | Unitary matrix used to accumulate transformations, will be overwritten by . If Q==0 , the transformations will not be accumulated. |
Compute the SVD of a bidiagonal matrix.
Compute the factorization with a real diagonal matrix and unitary matrices and .
T | Bidiagonal matrix , will be overwritten by a diagonal matrix such that with unitary matrices and . |
U | Unitary matrix used to accumulate transformations, will be overwritten by . If U==0 , the transformations will not be accumulated. |
Vt | Adjoint of unitary matrix used to accumulate transformations, will be overwritten by . If Vt==0 , the transformations will not be accumulated. |
Create a new tridiag object.
Allocates storage for the object and sets up its components.
size | Dimension of the new matrix. |
Perform one implicit QR step on a self-adjoint tridiagonal matrix.
T | Matrix , will be overwritten by , where is the unitary transformation corresponding to the QR step. |
shift | Shift parameter , the matrix is shifted to before computing the QR factorization. |
Q | Can be used to accumulate transformations, will be overwritten by . If Q==0 , the transformations will not be accumulated. |
Golub-Kahan bidiagonalization of a matrix, self-made implementation without BLAS or LAPACK.
Compute unitary matrices and and a lower bidiagonal matrix such that .
A | Matrix , will be overwritten by the function. |
T | Bidiagonal matrix . |
U | If U!=0 , this matrix will be filled with the unitary transformation . |
Vt | If Vt!=0 , this matrix will be filled with the adjoint unitary transformation . |
uint sb_eig_amatrix | ( | pamatrix | A, |
prealavector | lambda, | ||
pamatrix | Q, | ||
uint | maxiter | ||
) |
Solve a self-adjoint eigenproblem, self-made implementation without BLAS or LAPACK.
A | Matrix , will be overwritten by the function. |
lambda | Eigenvalues of , in ascending order. |
Q | If Q!=0 , the columns of this matrix will contain an orthonormal basis of eigenvectors corresponding to the eigenvalues in lambda . |
maxiter | Upper bound for the number of QR steps. |
Solve a self-adjoint tridiagonal eigenproblem, self-made implementation without BLAS or LAPACK.
Eigenvalues will be on the diagonal of T
, in ascending order.
T | Matrix , will be overwritten by a diagonal matrix such that with a unitary matrix . |
Q | Unitary matrix used to accumulate transformations, will be overwritten by . If Q==0 , the transformations will not be accumulated. |
maxiter | Upper bound for the number of QR steps. |
Compute the SVD of a bidiagonal matrix, self-made implementation without BLAS or LAPACK.
Singular values will be on the diagonal of T
, in descending order.
T | Bidiagonal matrix , will be overwritten by a diagonal matrix such that with unitary matrices and . |
U | Unitary matrix used to accumulate transformations, will be overwritten by . If U==0 , the transformations will not be accumulated. |
Vt | Adjoint of unitary matrix used to accumulate transformations, will be overwritten by . If Vt==0 , the transformations will not be accumulated. |
maxiter | Upper bound for the number of Golub-Kahan steps. |
Compute the SVD of a matrix, self-made implementation without BLAS or LAPACK.
Compute the factorization with a real diagonal matrix , and unitary matrices and .
A | Matrix , will be overwritten by the function. |
sigma | Singular values . |
U | If U!=0 , this matrix will be filled with the unitary transformation . |
Vt | If Vt!=0 , this matrix will be filled with the adjoint unitary transformation . |
maxiter | Upper bound for the number of Golub-Kahan steps. |
Hessenberg tridiagonalization of a self-adjoint matrix, self-made implementation without BLAS or LAPACK.
Compute a unitary matrix and a tridiagonal self-adjoint matrix such that .
A | Matrix , will be overwritten by the function. |
T | Tridiagonal matrix . |
Q | If Q!=0 , this matrix will be filled with the unitary transformation . |
uint svd_amatrix | ( | pamatrix | A, |
prealavector | sigma, | ||
pamatrix | U, | ||
pamatrix | Vt | ||
) |
Compute the SVD of a matrix.
Compute the factorization with a real diagonal matrix , and unitary matrices and .
A | Matrix , will be overwritten by the function. |
sigma | Singular values . |
U | If U!=0 , this matrix will be filled with the unitary transformation . |
Vt | If Vt!=0 , this matrix will be filled with the adjoint unitary transformation . |
Compute the SVD of a bidiagonal matrix.
Singular values will be on the diagonal of T
, in descending order.
T | Bidiagonal matrix , will be overwritten by a diagonal matrix such that with unitary matrices and . |
U | If U!=0 , the columns will filled by the leading left singular vectors. |
Vt | If Vt!=0 , the rows will be filled by the conjugated leading right singular vectors. |
Perform one step of the Golub-Kahan iteration on a lower bidiagonal matrix.
T | Bidiagonal matrix , will be overwritten by . |
shift | Shift parameter , the matrix is shifted to before computing the QR factorization. |
U | Can be used to accumulate transformations, will be overwritten by . If U==0 , the transformations will not be accumulated. |
Vt | Can be used to accumulate transformations, will be overwritten by . If Vt==0 , the transformations will not be accumulated. |
Hessenberg tridiagonalization of a self-adjoint matrix.
Compute a unitary matrix and a tridiagonal self-adjoint matrix such that .
A | Matrix , will be overwritten by the function. |
T | Tridiagonal matrix . |
Q | If Q!=0 , this matrix will be filled with the unitary transformation . |