H2Lib  3.0
eigensolvers.h
Go to the documentation of this file.
1 
2 /* ------------------------------------------------------------
3  This is the file "eigensolvers.h" of the H2Lib package.
4  All rights reserved, Steffen Boerm 2009
5  ------------------------------------------------------------ */
6 
10 #ifndef EIGENSOLVERS_H
11 #define EIGENSOLVERS_H
12 
19 typedef struct _tridiag tridiag;
20 
22 typedef tridiag *ptridiag;
23 
25 typedef const tridiag *pctridiag;
26 
27 #include "amatrix.h"
28 #include "realavector.h"
29 #include "settings.h"
30 
33 struct _tridiag {
38 
43 
48 
51 
55 };
56 
57 /* ------------------------------------------------------------
58  Constructors and destructors
59  ------------------------------------------------------------ */
60 
73 
90 
107 
114 HEADER_PREFIX void
116 
127 
137 HEADER_PREFIX void
139 
140 /* ------------------------------------------------------------
141  Simple utility functions
142  ------------------------------------------------------------ */
143 
148 HEADER_PREFIX void
150 
159 
169 
178 HEADER_PREFIX void
180  bool atrans, pctridiag a,
181  bool xtrans, pamatrix x);
182 
192 HEADER_PREFIX void
194  bool atrans, pctridiag a,
195  bool xtrans, pamatrix x);
196 
197 /* ------------------------------------------------------------
198  Compute eigenvalues and eigenvectors,
199  only for self-adjoint tridiagonal matrices
200  ------------------------------------------------------------ */
201 
213 HEADER_PREFIX void
215 
235 sb_muleig_tridiag(ptridiag T, pamatrix Q, uint maxiter);
236 
251 
265 
279 HEADER_PREFIX void
281  ptridiag T, pamatrix Q);
282 
295 HEADER_PREFIX void
297  ptridiag T, pamatrix Q);
298 
315 sb_eig_amatrix(pamatrix A, prealavector lambda, pamatrix Q, uint maxiter);
316 
328 
343 
344 /* ------------------------------------------------------------
345  Singular value decomposition of a sub-bidiagonal matrix
346  ------------------------------------------------------------ */
347 
361 HEADER_PREFIX void
363 
387 sb_mulsvd_tridiag(ptridiag T, pamatrix U, pamatrix Vt, uint maxiter);
388 
408 
424 
440 HEADER_PREFIX void
442  ptridiag T, pamatrix U, pamatrix Vt);
443 
458 HEADER_PREFIX void
460  ptridiag T, pamatrix U, pamatrix Vt);
461 
483  prealavector sigma, pamatrix U, pamatrix Vt, uint maxiter);
484 
502 
505 #endif
Real tridiagonal matrix , represented by vectors containing the diagonal, sub- and superdiagonal...
Definition: eigensolvers.h:33
uint eig_tridiag(ptridiag T, pamatrix Q)
Solve a self-adjoint tridiagonal eigenproblem.
Definition: realavector.h:48
uint sb_muleig_tridiag(ptridiag T, pamatrix Q, uint maxiter)
Solve a self-adjoint tridiagonal eigenproblem, self-made implementation without BLAS or LAPACK...
void bidiagonalize_amatrix(pamatrix A, ptridiag T, pamatrix U, pamatrix Vt)
Golub-Kahan bidiagonalization of a matrix.
void qrstep_tridiag(ptridiag T, field shift, pamatrix Q)
Perform one implicit QR step on a self-adjoint tridiagonal matrix.
uint size
Matrix dimension.
Definition: eigensolvers.h:50
preal l
Subdiagonal represented by the vector , dimension dim-1.
Definition: eigensolvers.h:42
real check_lower_tridiag(pctridiag T, pcamatrix Ts)
Compute the Frobenius norm of the difference of a lower bidiagonal matrix and a general matrix ...
void copy_tridiag(pctridiag T, ptridiag Tcopy)
Copy a matrix into another matrix, .
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.
ptridiag init_tridiag(ptridiag T, uint size)
Initialize a tridiag object.
unsigned uint
Unsigned integer type.
Definition: settings.h:70
uint mulsvd_tridiag(ptridiag T, pamatrix U, pamatrix Vt)
Compute the SVD of a bidiagonal matrix.
void tridiagonalize_amatrix(pamatrix A, ptridiag T, pamatrix Q)
Hessenberg tridiagonalization of a self-adjoint matrix.
double _Complex field
Field type.
Definition: settings.h:171
uint geig_amatrix(pamatrix A, pamatrix M, prealavector lambda, pamatrix Q)
Solve self-adjoint generalized eigenproblem, .
uint svd_tridiag(ptridiag T, pamatrix U, pamatrix Vt)
Compute the SVD of a bidiagonal matrix.
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, .
ptridiag owner
If this a submatrix, this points to the supermatrix it was taken from.
Definition: eigensolvers.h:54
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...
void del_tridiag(ptridiag T)
Delete a tridiag object.
uint eig_amatrix(pamatrix A, prealavector lambda, pamatrix Q)
Solve a self-adjoint eigenproblem, .
void svdstep_tridiag(ptridiag T, field shift, pamatrix U, pamatrix Vt)
Perform one step of the Golub-Kahan iteration on a lower bidiagonal matrix.
uint svd_amatrix(pamatrix A, prealavector sigma, pamatrix U, pamatrix Vt)
Compute the SVD of a matrix.
#define HEADER_PREFIX
Prefix for function declarations.
Definition: settings.h:43
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.
double real
real floating point type.
Definition: settings.h:97
ptridiag new_tridiag(uint size)
Create a new tridiag object.
preal u
Superdiagonal represented by the vector , dimension dim-1.
Definition: eigensolvers.h:47
uint sb_eig_amatrix(pamatrix A, prealavector lambda, pamatrix Q, uint maxiter)
Solve a self-adjoint eigenproblem, self-made implementation without BLAS or LAPACK.
real * preal
Pointer to real array.
Definition: settings.h:145
ptridiag init_sub_tridiag(ptridiag T, ptridiag src, uint size, uint off)
Initialize a tridiag object to represent a submatrix.
uint muleig_tridiag(ptridiag T, pamatrix Q)
Solve a self-adjoint tridiagonal eigenproblem.
real check_tridiag(pctridiag T, pcamatrix Ts)
Compute the Frobenius norm of the difference of a tridiagonal matrix and a general matrix ...
preal d
Diagonal represented by the vector , dimension dim.
Definition: eigensolvers.h:37
Representation of a matrix as an array in column-major order.
Definition: amatrix.h:43
const tridiag * pctridiag
Pointer to a constant tridiag object.
Definition: eigensolvers.h:25
void sb_tridiagonalize_amatrix(pamatrix A, ptridiag T, pamatrix Q)
Hessenberg tridiagonalization of a self-adjoint matrix, self-made implementation without BLAS or LAPA...
void uninit_tridiag(ptridiag T)
Uninitialize a tridiag object.
tridiag * ptridiag
Pointer to a tridiag object.
Definition: eigensolvers.h:22
ptridiag init_vec_tridiag(ptridiag T, prealavector src, uint size)
Initialize a tridiag object using pre-allocated storage.
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, .