MADNESS  version 0.9
Namespaces | Macros | Functions | Variables
lapack.cc File Reference

Partial interface from Tensor to LAPACK. More...

#include <madness/madness_config.h>
#include <madness/tensor/tensor.h>
#include <iostream>
#include <algorithm>
#include <madness/tensor/tensor_lapack.h>
#include <madness/tensor/clapack.h>
Include dependency graph for lapack.cc:

Namespaces

 madness
 Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
 

Macros

#define STATIC
 

Functions

STATIC void dgesvd_ (const char *jobu, const char *jobvt, integer *m, integer *n, real4 *a, integer *lda, real4 *s, real4 *u, integer *ldu, real4 *vt, integer *ldvt, real4 *work, integer *lwork, integer *info, char_len jobulen, char_len jobvtlen)
 
STATIC void dgesvd_ (const char *jobu, const char *jobvt, integer *m, integer *n, complex_real4 *a, integer *lda, real4 *s, complex_real4 *u, integer *ldu, complex_real4 *vt, integer *ldvt, complex_real4 *work, integer *lwork, integer *info, char_len jobulen, char_len jobvtlen)
 
STATIC void dgesvd_ (const char *jobu, const char *jobvt, integer *m, integer *n, complex_real8 *a, integer *lda, real8 *s, complex_real8 *u, integer *ldu, complex_real8 *vt, integer *ldvt, complex_real8 *work, integer *lwork, integer *info, char_len jobulen, char_len jobvtlen)
 
STATIC void dgesv_ (integer *n, integer *nrhs, float *AT, integer *lda, integer *piv, float *x, integer *ldx, integer *info)
 
STATIC void dgesv_ (integer *n, integer *nrhs, float_complex *AT, integer *lda, integer *piv, float_complex *x, integer *ldx, integer *info)
 
STATIC void dgesv_ (integer *n, integer *nrhs, double_complex *AT, integer *lda, integer *piv, double_complex *x, integer *ldx, integer *info)
 
STATIC void dgelss_ (integer *m, integer *n, integer *nrhs, float *a, integer *lda, float *b, integer *ldb, float *sOUT, float *rcondIN, integer *rankOUT, float *work, integer *lwork, integer *infoOUT)
 
STATIC void dgelss_ (integer *m, integer *n, integer *nrhs, float_complex *a, integer *lda, float_complex *b, integer *ldb, float *sOUT, float *rcondIN, integer *rankOUT, float_complex *work, integer *lwork, integer *infoOUT)
 
STATIC void dgelss_ (integer *m, integer *n, integer *nrhs, double_complex *a, integer *lda, double_complex *b, integer *ldb, double *sOUT, double *rcondIN, integer *rankOUT, double_complex *work, integer *lwork, integer *infoOUT)
 
STATIC void dsygv_ (integer *itype, const char *jobz, const char *uplo, integer *n, real4 *a, integer *lda, real4 *b, integer *ldb, real4 *w, real4 *work, integer *lwork, integer *info, char_len jobzlen, char_len uplo_len)
 
STATIC void dsygv_ (integer *itype, const char *jobz, const char *uplo, integer *n, complex_real4 *a, integer *lda, complex_real4 *b, integer *ldb, real4 *w, complex_real4 *work, integer *lwork, integer *info, char_len jobzlen, char_len uplo_len)
 
STATIC void dsygv_ (integer *itype, const char *jobz, const char *uplo, integer *n, complex_real8 *a, integer *lda, complex_real8 *b, integer *ldb, real8 *w, complex_real8 *work, integer *lwork, integer *info, char_len jobzlen, char_len uplo_len)
 
STATIC void dsyev_ (const char *jobz, const char *uplo, integer *n, real4 *a, integer *lda, real4 *w, real4 *work, integer *lwork, integer *info, char_len jobzlen, char_len uplo_len)
 
STATIC void dsyev_ (const char *jobz, const char *uplo, integer *n, complex_real4 *a, integer *lda, real4 *w, complex_real4 *work, integer *lwork, integer *info, char_len jobzlen, char_len uplo_len)
 
STATIC void dsyev_ (const char *jobz, const char *uplo, integer *n, complex_real8 *a, integer *lda, real8 *w, complex_real8 *work, integer *lwork, integer *info, char_len jobzlen, char_len uplo_len)
 
STATIC void dorgqr_ (integer *m, integer *n, integer *k, real4 *a, integer *lda, real4 *tau, real4 *work, integer *lwork, integer *info)
 
STATIC void dorgqr_ (integer *m, integer *n, integer *k, complex_real4 *a, integer *lda, complex_real4 *tau, complex_real4 *work, integer *lwork, integer *info)
 
STATIC void dorgqr_ (integer *m, integer *n, integer *k, complex_real8 *a, integer *lda, complex_real8 *tau, complex_real8 *work, integer *lwork, integer *info)
 
template<typename T >
void madness::svd (const Tensor< T > &a, Tensor< T > &U, Tensor< typename Tensor< T >::scalar_type > &s, Tensor< T > &VT)
 Compute the singluar value decomposition of an n-by-m matrix using *gesvd. More...
 
template<typename T >
void madness::svd_result (Tensor< T > &a, Tensor< T > &U, Tensor< typename Tensor< T >::scalar_type > &s, Tensor< T > &VT, Tensor< T > &work)
 same as svd, but it optimizes away the tensor construction: a = U * diag(s) * VT More...
 
template<typename T >
void madness::gesv (const Tensor< T > &a, const Tensor< T > &b, Tensor< T > &x)
 Solve Ax = b for general A using the LAPACK *gesv routines. More...
 
template<typename T >
void madness::gelss (const Tensor< T > &a, const Tensor< T > &b, double rcond, Tensor< T > &x, Tensor< typename Tensor< T >::scalar_type > &s, long &rank, Tensor< typename Tensor< T >::scalar_type > &sumsq)
 Solve Ax = b for general A using the LAPACK *gelss routines. More...
 
template<typename T >
void madness::syev (const Tensor< T > &A, Tensor< T > &V, Tensor< typename Tensor< T >::scalar_type > &e)
 Real-symmetric or complex-Hermitian eigenproblem. More...
 
template<typename T >
void madness::sygv (const Tensor< T > &A, const Tensor< T > &B, int itype, Tensor< T > &V, Tensor< typename Tensor< T >::scalar_type > &e)
 Generalized real-symmetric or complex-Hermitian eigenproblem. More...
 
template<typename T >
void madness::cholesky (Tensor< T > &A)
 Compute the Cholesky factorization. More...
 
template<typename T >
void madness::geqp3 (Tensor< T > &A, Tensor< T > &tau, Tensor< integer > &jpvt)
 Compute the QR factorization. More...
 
template<typename T >
void madness::geqp3_result (Tensor< T > &A, Tensor< T > &tau, Tensor< integer > &jpvt, Tensor< T > &work)
 
template<typename T >
void madness::qr (Tensor< T > &A, Tensor< T > &R)
 compute the QR decomposition of the matrix A More...
 
template<typename T >
void madness::lq (Tensor< T > &A, Tensor< T > &R)
 compute the LQ decomposition of the matrix A = L Q More...
 
template<typename T >
void madness::lq_result (Tensor< T > &A, Tensor< T > &R, Tensor< T > &tau, Tensor< T > &work, bool do_qr)
 compute the LQ decomposition of the matrix A = L Q More...
 
template<typename T >
void madness::orgqr (Tensor< T > &A, const Tensor< T > &tau)
 reconstruct the orthogonal matrix Q (e.g. from QR factorization) More...
 
STATIC Tensor< float > madness::my_conj_transpose (Tensor< float > a)
 
STATIC Tensor< double > madness::my_conj_transpose (Tensor< double > a)
 
STATIC Tensor< float_complexmadness::my_conj_transpose (Tensor< float_complex > a)
 
STATIC Tensor< double_complexmadness::my_conj_transpose (Tensor< double_complex > a)
 
template<typename T >
double madness::test_svd (int n, int m)
 Example and test code for interface to LAPACK SVD interfae. More...
 
template<typename T >
double madness::test_gesv (int n, int nrhs)
 
template<typename T >
double madness::test_syev (int n)
 
template<typename T >
double madness::test_gelss (int n, int nrhs)
 
template<typename T >
double madness::test_sygv (int n)
 
template<typename T >
double madness::test_cholesky (int n)
 
template<typename T >
double madness::test_qr ()
 
void madness::init_tensor_lapack ()
 World/MRA initialization calls this before going multithreaded due to static data in dlamch. More...
 
bool madness::test_tensor_lapack ()
 Test the Tensor-LAPACK interface ... currently always returns true! More...
 
template void madness::svd_result (Tensor< float > &a, Tensor< float > &U, Tensor< Tensor< float >::scalar_type > &s, Tensor< float > &VT, Tensor< float > &work)
 
template void madness::orgqr (Tensor< float > &A, const Tensor< float > &tau)
 
template void madness::svd (const Tensor< double > &a, Tensor< double > &U, Tensor< Tensor< double >::scalar_type > &s, Tensor< double > &VT)
 
template void madness::svd_result (Tensor< double > &a, Tensor< double > &U, Tensor< Tensor< double >::scalar_type > &s, Tensor< double > &VT, Tensor< double > &work)
 
template void madness::gelss (const Tensor< double > &a, const Tensor< double > &b, double rcond, Tensor< double > &x, Tensor< Tensor< double >::scalar_type > &s, long &rank, Tensor< Tensor< double >::scalar_type > &sumsq)
 
template void madness::syev (const Tensor< double > &A, Tensor< double > &V, Tensor< Tensor< double >::scalar_type > &e)
 
template void madness::cholesky (Tensor< double > &A)
 
template void madness::qr (Tensor< double > &A, Tensor< double > &R)
 
template void madness::lq (Tensor< double > &A, Tensor< double > &L)
 
template void madness::geqp3 (Tensor< double > &A, Tensor< double > &tau, Tensor< integer > &jpvt)
 
template void madness::orgqr (Tensor< double > &A, const Tensor< double > &tau)
 
template void madness::svd_result (Tensor< float_complex > &a, Tensor< float_complex > &U, Tensor< Tensor< float_complex >::scalar_type > &s, Tensor< float_complex > &VT, Tensor< float_complex > &work)
 
template void madness::svd (const Tensor< double_complex > &a, Tensor< double_complex > &U, Tensor< Tensor< double_complex >::scalar_type > &s, Tensor< double_complex > &VT)
 
template void madness::svd_result (Tensor< double_complex > &a, Tensor< double_complex > &U, Tensor< Tensor< double_complex >::scalar_type > &s, Tensor< double_complex > &VT, Tensor< double_complex > &work)
 
template void madness::gelss (const Tensor< double_complex > &a, const Tensor< double_complex > &b, double rcond, Tensor< double_complex > &x, Tensor< Tensor< double_complex >::scalar_type > &s, long &rank, Tensor< Tensor< double_complex >::scalar_type > &sumsq)
 
template void madness::syev (const Tensor< double_complex > &A, Tensor< double_complex > &V, Tensor< Tensor< double_complex >::scalar_type > &e)
 
template void madness::gesv (const Tensor< double > &a, const Tensor< double > &b, Tensor< double > &x)
 
template void madness::gesv (const Tensor< double_complex > &a, const Tensor< double_complex > &b, Tensor< double_complex > &x)
 
template void madness::sygv (const Tensor< double > &A, const Tensor< double > &B, int itype, Tensor< double > &V, Tensor< Tensor< double >::scalar_type > &e)
 
template void madness::sygv (const Tensor< double_complex > &A, const Tensor< double_complex > &B, int itype, Tensor< double_complex > &V, Tensor< Tensor< double_complex >::scalar_type > &e)
 
template void madness::orgqr (Tensor< complex_real4 > &A, const Tensor< complex_real4 > &tau)
 
template void madness::orgqr (Tensor< double_complex > &A, const Tensor< double_complex > &tau)
 

Variables

double tt1
 
double ss1
 

Detailed Description

Partial interface from Tensor to LAPACK.

Macro Definition Documentation

#define STATIC

Function Documentation

STATIC void dgelss_ ( integer m,
integer n,
integer nrhs,
float *  a,
integer lda,
float *  b,
integer ldb,
float *  sOUT,
float *  rcondIN,
integer rankOUT,
float *  work,
integer lwork,
integer infoOUT 
)
inline

These oddly-named wrappers enable the generic gelss iterface to get the correct LAPACK routine based upon the argument type. Internal use only.

References sgelss_().

Referenced by madness::gelss().

STATIC void dgelss_ ( integer m,
integer n,
integer nrhs,
float_complex a,
integer lda,
float_complex b,
integer ldb,
float *  sOUT,
float *  rcondIN,
integer rankOUT,
float_complex work,
integer lwork,
integer infoOUT 
)
inline

References cgelss_(), and mpfr::min().

STATIC void dgelss_ ( integer m,
integer n,
integer nrhs,
double_complex a,
integer lda,
double_complex b,
integer ldb,
double *  sOUT,
double *  rcondIN,
integer rankOUT,
double_complex work,
integer lwork,
integer infoOUT 
)
inline

References mpfr::min(), and zgelss_().

STATIC void dgesv_ ( integer n,
integer nrhs,
float *  AT,
integer lda,
integer piv,
float *  x,
integer ldx,
integer info 
)
inline

These oddly-named wrappers enable the generic gesv iterface to get the correct LAPACK routine based upon the argument type. Internal use only.

References sgesv_().

Referenced by madness::gesv().

STATIC void dgesv_ ( integer n,
integer nrhs,
float_complex AT,
integer lda,
integer piv,
float_complex x,
integer ldx,
integer info 
)
inline

References cgesv_().

STATIC void dgesv_ ( integer n,
integer nrhs,
double_complex AT,
integer lda,
integer piv,
double_complex x,
integer ldx,
integer info 
)
inline

References zgesv_().

STATIC void dgesvd_ ( const char *  jobu,
const char *  jobvt,
integer m,
integer n,
real4 a,
integer lda,
real4 s,
real4 u,
integer ldu,
real4 vt,
integer ldvt,
real4 work,
integer lwork,
integer info,
char_len  jobulen,
char_len  jobvtlen 
)
inline

These oddly-named wrappers enable the generic svd iterface to get the correct LAPACK routine based upon the argument type. Internal use only.

References sgesvd_().

Referenced by madness::svd(), and madness::svd_result().

STATIC void dgesvd_ ( const char *  jobu,
const char *  jobvt,
integer m,
integer n,
complex_real4 a,
integer lda,
real4 s,
complex_real4 u,
integer ldu,
complex_real4 vt,
integer ldvt,
complex_real4 work,
integer lwork,
integer info,
char_len  jobulen,
char_len  jobvtlen 
)
inline

References cgesvd_(), and mpfr::min().

STATIC void dgesvd_ ( const char *  jobu,
const char *  jobvt,
integer m,
integer n,
complex_real8 a,
integer lda,
real8 s,
complex_real8 u,
integer ldu,
complex_real8 vt,
integer ldvt,
complex_real8 work,
integer lwork,
integer info,
char_len  jobulen,
char_len  jobvtlen 
)
inline

References mpfr::min(), and zgesvd_().

STATIC void dorgqr_ ( integer m,
integer n,
integer k,
real4 a,
integer lda,
real4 tau,
real4 work,
integer lwork,
integer info 
)
inline

These oddly-named wrappers enable the generic orgqr/unggr iterface to get the correct LAPACK routine based upon the argument type. Internal use only.

References sorgqr_().

Referenced by madness::lq_result(), and madness::orgqr().

STATIC void dorgqr_ ( integer m,
integer n,
integer k,
complex_real4 a,
integer lda,
complex_real4 tau,
complex_real4 work,
integer lwork,
integer info 
)

References cungqr_().

STATIC void dorgqr_ ( integer m,
integer n,
integer k,
complex_real8 a,
integer lda,
complex_real8 tau,
complex_real8 work,
integer lwork,
integer info 
)

References zungqr_().

STATIC void dsyev_ ( const char *  jobz,
const char *  uplo,
integer n,
real4 a,
integer lda,
real4 w,
real4 work,
integer lwork,
integer info,
char_len  jobzlen,
char_len  uplo_len 
)
inline

These oddly-named wrappers enable the generic syev/heev iterface to get the correct LAPACK routine based upon the argument type. Internal use only.

References ssyev_().

Referenced by madness::syev().

STATIC void dsyev_ ( const char *  jobz,
const char *  uplo,
integer n,
complex_real4 a,
integer lda,
real4 w,
complex_real4 work,
integer lwork,
integer info,
char_len  jobzlen,
char_len  uplo_len 
)

References cheev_(), and max.

STATIC void dsyev_ ( const char *  jobz,
const char *  uplo,
integer n,
complex_real8 a,
integer lda,
real8 w,
complex_real8 work,
integer lwork,
integer info,
char_len  jobzlen,
char_len  uplo_len 
)

References max, and zheev_().

STATIC void dsygv_ ( integer itype,
const char *  jobz,
const char *  uplo,
integer n,
real4 a,
integer lda,
real4 b,
integer ldb,
real4 w,
real4 work,
integer lwork,
integer info,
char_len  jobzlen,
char_len  uplo_len 
)
inline

These oddly-named wrappers enable the generic sygv/hegv iterface to get the correct LAPACK routine based upon the argument type. Internal use only.

References ssygv_().

Referenced by madness::sygv().

STATIC void dsygv_ ( integer itype,
const char *  jobz,
const char *  uplo,
integer n,
complex_real4 a,
integer lda,
complex_real4 b,
integer ldb,
real4 w,
complex_real4 work,
integer lwork,
integer info,
char_len  jobzlen,
char_len  uplo_len 
)
inline

References chegv_(), and max.

STATIC void dsygv_ ( integer itype,
const char *  jobz,
const char *  uplo,
integer n,
complex_real8 a,
integer lda,
complex_real8 b,
integer ldb,
real8 w,
complex_real8 work,
integer lwork,
integer info,
char_len  jobzlen,
char_len  uplo_len 
)
inline

References max, and zhegv_().

Variable Documentation

double ss1

Referenced by c_uks_vwn5__().

double tt1