Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

lapack.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*
00002  *                                   IT++                                    *
00003  *---------------------------------------------------------------------------*
00004  * Copyright (c) 1995-2003 by Tony Ottosson, Thomas Eriksson, Pål Frenger,   *
00005  * Tobias Ringström, and Jonas Samuelsson.                                   *
00006  *                                                                           *
00007  * Permission to use, copy, modify, and distribute this software and its     *
00008  * documentation under the terms of the GNU General Public License is hereby *
00009  * granted. No representations are made about the suitability of this        *
00010  * software for any purpose. It is provided "as is" without expressed or     *
00011  * implied warranty. See the GNU General Public License for more details.    *
00012  *---------------------------------------------------------------------------*/
00016 //  SPUC - Signal processing using C++ - A DSP library
00017 
00028 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00029 namespace SPUC {
00030 extern "C" {
00031 
00032 // Fix for MKL Windows version so that naming is consistent with the 5.x MKL LAPACK libraries
00033 #ifdef LAPACK_NO_UNDERSCORE
00034 #define dgetrf_ dgetrf
00035 #define zgetrf_ zgetrf
00036 
00037 #define dgetri_ dgetri
00038 #define zgetri_ zgetri
00039 
00040 #define dgesvd_ dgesvd
00041 #define zgesvd_ zgesvd
00042 
00043 #define dsyev_ dsyev
00044 #define zheev_ zheev
00045 
00046 #define dgeev_ dgeev
00047 #define zgeev_ zgeev
00048 
00049 #define dpotrf_ dpotrf
00050 #define zpotrf_ zpotrf
00051 #endif
00052 
00053 typedef complex<double> double_complex;
00054 /* LU factorization
00055    a is of size m*n and with lda rows.
00056    ipiv is the permutation vector of rows. Row i should be replaced by row ipiv(i).
00057    info=0 if OK. info=-i if ith value is illegal. info=i factorization OK but the system is singular if solved.
00058 */
00059 void dgetrf_(int *m, int *n, double *a, int *lda, int *ipiv, int *info);
00060 void zgetrf_(int *m, int *n, double_complex *a, int *lda, int *ipiv, int *info);
00061 
00062 
00063 /* Inverting a matrix of an LU-factored general matrix (first call xGETRF)
00064    a is of square size n*n with lda rows containing the factorization as returned by xGETRF
00065    ipiv is vector as returned by xGETRF
00066    lwork >= n
00067    output: a is overwritten by the inverse
00068    info=0 if OK. info=-i if ith parameter is illegal. info=i the ith diagonal element = 0 and U is singular.
00069 */
00070 void dgetri_(int *n, double *a, int *lda, int *ipiv, double *work, int *lwork, int *info);
00071 void zgetri_(int *n, double_complex *a, int *lda, int *ipiv, double_complex *work, int *lwork, int *info);
00072 
00073 /* SVD of a general rectangular matrix A = U S V^H
00074    a is of size m*n and with lda rows.
00075    Output: s with sorted singular values (vector)
00076            u, and vt (for U and V^H). U is m*m, and V^H is n*n
00077    jobu='A','S','O','N'. Different versions. 'A' = all columns of U calculated and returned in u.
00078    jobvt='A','S','O','N'. Different versions. 'A' = all columns of V^H calculated and returned in vt.
00079    ldu = no rows in U
00080    ldvt = no rows in V^H
00081    info = 0 successful, =-i ith parameter is illegal, =i did not converge
00082 
00083    work is a workspace vector of size lwork.
00084    lwork >= max(3*min(m,n)+max(m,n), 5*min(m,n)) for double
00085    lwork >= 2*min(m,n)+max(m,n) for double_complex
00086    Good performance. Make lwork larger!
00087    rwork is a workspace array for complex version. Size max(1, 5*min(m,n)).
00088  
00089 */
00090 void dgesvd_(char *jobu, char *jobvt, int *m, int *n, double *a, int *lda, double *s, double *u, int *ldu, double *vt, int *ldvt, double *work, int *lwork, int *info);
00091 void zgesvd_(char *jobu, char *jobvt, int *m, int *n, double_complex *a, int *lda, double *s, double_complex *u, int *ldu, double_complex *vt, int *ldvt, double_complex *work, int *lwork, double *rwork, int *info);
00092 
00093 /* Eigenvalues and eigenvectors of a symmetric/hermitian matrix A
00094 
00095 */
00096 void dsyev_(char *jobz, char *uplo, int *n, double *a, int *lda, double *w, double *work, int *lwork, int *info);
00097 void zheev_(char *jobz, char *uplo, int *n, double_complex *a, int *lda, double *w, double_complex *work, int *lwork, double *rwork, int *info);
00098 
00099 
00100 /* Eigenvalues and eigenvectors of a general matrix A
00101 
00102 */
00103 void dgeev_(char *jobvl, char *jobvr, int *n, double *a, int *lda, double *wr, double *wi, double *vl, int *ldvl, double *vr, int *ldvr, double *work, int *lwork, int *info);
00104 void zgeev_(char *jobvl, char *jobvr, int *n, double_complex *a, int *lda, double_complex *w, double_complex *vl, int *ldvl, double_complex *vr, int *ldvr, double_complex *work, int *lwork, double *rwork, int *info);
00105 
00106 /* Cholesky factorization
00107 
00108 */
00109 void dpotrf_(char *uplo, int *n, double *a, int *lda, int *info);
00110 void zpotrf_(char *uplo, int *n, double_complex *a, int *lda, int *info);
00111 
00112 } // extern C
00113 }
00114 #endif //DOXYGEN_SHOULD_SKIP_THIS

Generated on Fri Sep 16 11:02:29 2005 for spuc by  doxygen 1.4.4