Teuchos - Trilinos Tools Package Version of the Day
Teuchos_LAPACK.cpp
00001 // @HEADER
00002 // ***********************************************************************
00003 //
00004 //                    Teuchos: Common Tools Package
00005 //                 Copyright (2004) Sandia Corporation
00006 //
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00038 //
00039 // ***********************************************************************
00040 // @HEADER
00041 
00042 #include "Teuchos_ConfigDefs.hpp"
00043 #include "Teuchos_ScalarTraits.hpp"
00044 #include "Teuchos_LAPACK.hpp"
00045 #include "Teuchos_LAPACK_wrappers.hpp"
00046 
00047 /* for INTEL_CXML, the second arg may need to be changed to 'one'.  If so
00048 the appropriate declaration of one will need to be added back into
00049 functions that include the macro:
00050 */
00051 #if defined (INTEL_CXML)
00052         unsigned int one=1;
00053 #endif
00054 
00055 #ifdef CHAR_MACRO
00056 #undef CHAR_MACRO
00057 #endif
00058 #if defined (INTEL_CXML)
00059 #define CHAR_MACRO(char_var) &char_var, one
00060 #else
00061 #define CHAR_MACRO(char_var) &char_var
00062 #endif
00063 
00064 extern "C" {
00065 
00066 
00067 typedef int (*gees_nullfptr_t)(double*,double*);
00068 
00069 
00070 } // extern "C"
00071 
00072 
00073 namespace Teuchos
00074 {
00075   // BEGIN INT, FLOAT SPECIALIZATION IMPLEMENTATION //
00076 
00077   void LAPACK<int, float>::PTTRF(const int n, float* d, float* e, int* info) const
00078   { SPTTRF_F77(&n,d,e,info); }
00079   
00080   
00081   void LAPACK<int, float>::PTTRS(const int n, const int nrhs, const float* d, const float* e, float* B, const int ldb, int* info) const
00082   { SPTTRS_F77(&n,&nrhs,d,e,B,&ldb,info); }
00083   
00084   
00085   void LAPACK<int, float>::POTRF(const char UPLO, const int n, float* A, const int lda, int* info) const
00086   { SPOTRF_F77(CHAR_MACRO(UPLO), &n, A, &lda, info); }
00087   
00088   
00089   void LAPACK<int, float>::POTRS(const char UPLO, const int n, const int nrhs, const float* A, const int lda, float* B, const int ldb, int* info) const
00090   { SPOTRS_F77(CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, B, &ldb, info); }
00091   
00092   
00093   void LAPACK<int, float>::POTRI(const char UPLO, const int n, float* A, const int lda, int* info) const
00094   { SPOTRI_F77(CHAR_MACRO(UPLO), &n, A, &lda, info); }
00095   
00096   
00097   void LAPACK<int, float>::POCON(const char UPLO, const int n, const float* A, const int lda, const float anorm, float* rcond, float* WORK, int* IWORK, int* info) const
00098   { SPOCON_F77(CHAR_MACRO(UPLO), &n, A, &lda, &anorm, rcond, WORK, IWORK, info); }
00099   
00100   
00101   void LAPACK<int, float>::POSV(const char UPLO, const int n, const int nrhs, float* A, const int lda, float* B, const int ldb, int* info) const
00102   { SPOSV_F77(CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, B, &ldb, info); }
00103   
00104   
00105   void LAPACK<int, float>::POEQU(const int n, const float* A, const int lda, float* S, float* scond, float* amax, int* info) const
00106   { SPOEQU_F77(&n, A, &lda, S, scond, amax, info); }
00107   
00108   
00109   void LAPACK<int, float>::PORFS(const char UPLO, const int n, const int nrhs, float* A, const int lda, const float* AF, const int ldaf, const float* B, const int ldb, float* X, const int ldx, float* FERR, float* BERR, float* WORK, int* IWORK, int* info) const
00110   { SPORFS_F77(CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, AF, &ldaf, B, &ldb, X, &ldx, FERR, BERR, WORK, IWORK, info); }
00111   
00112   
00113   void LAPACK<int, float>::POSVX(const char FACT, const char UPLO, const int n, const int nrhs, float* A, const int lda, float* AF, const int ldaf, char EQUED, float* S, float* B, const int ldb, float* X, const int ldx, float* rcond, float* FERR, float* BERR, float* WORK, int* IWORK, int* info) const
00114   { SPOSVX_F77(CHAR_MACRO(FACT), CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, AF, &ldaf, CHAR_MACRO(EQUED), S, B, &ldb, X, &ldx, rcond, FERR, BERR, WORK, IWORK, info); }
00115   
00116   
00117   void LAPACK<int,float>::GELS(const char TRANS, const int m, const int n, const int nrhs, float* A, const int lda, float* B, const int ldb, float* WORK, const int lwork, int* info) const
00118   { SGELS_F77(CHAR_MACRO(TRANS), &m, &n, &nrhs, A, &lda, B, &ldb, WORK, &lwork, info); }
00119   
00120   void LAPACK<int,float>::GELSS (const int m, const int n, const int nrhs, float* A, const int lda, float* B, const int ldb, float* S, const float rcond, int* rank, float* WORK, const int lwork, float* rwork, int* info) const 
00121   {
00122     (void) rwork;
00123     SGELSS_F77(&m, &n, &nrhs, A, &lda, B, &ldb, S, &rcond, rank, WORK, &lwork, info); 
00124   }
00125   
00126   void LAPACK<int,float>::GELSS(const int m, const int n, const int nrhs, float* A, const int lda, float* B, const int ldb, float* S, const float rcond, int* rank, float* WORK, const int lwork, int* info) const
00127   { SGELSS_F77(&m, &n, &nrhs, A, &lda, B, &ldb, S, &rcond, rank, WORK, &lwork, info); }
00128 
00129   
00130   void LAPACK<int,float>::GGLSE(const int m, const int n, const int p, float* A, const int lda, float* B, const int ldb, float* C, float* D, float* X, float* WORK, const int lwork, int* info) const
00131   { SGGLSE_F77(&m, &n, &p, A, &lda, B, &ldb, C, D, X, WORK, &lwork, info); }
00132 
00133     
00134   void LAPACK<int,float>::GEQRF( const int m, const int n, float* A, const int lda, float* TAU, float* WORK, const int lwork, int* info) const
00135   { SGEQRF_F77(&m, &n, A, &lda, TAU, WORK, &lwork, info); }
00136 
00137   
00138   void LAPACK<int,float>::GETRF(const int m, const int n, float* A, const int lda, int* IPIV, int* info) const
00139   { SGETRF_F77(&m, &n, A, &lda, IPIV, info); }
00140   
00141   
00142   void LAPACK<int,float>::GETRS(const char TRANS, const int n, const int nrhs, const float* A, const int lda, const int* IPIV, float* B, const int ldb, int* info) const
00143   { SGETRS_F77(CHAR_MACRO(TRANS), &n, &nrhs, A, &lda, IPIV, B, &ldb, info); }
00144 
00145   
00146   void LAPACK<int,float>::GTTRF(const int n, float* dl, float* d, float* du, float* du2, int* IPIV, int* info) const
00147   { SGTTRF_F77(&n, dl, d, du, du2, IPIV, info); }
00148 
00149   
00150   void LAPACK<int,float>::GTTRS(const char TRANS, const int n, const int nrhs, const float* dl, const float* d, const float* du, const float* du2, const int* IPIV, float* B, const int ldb, int* info) const
00151   { SGTTRS_F77(CHAR_MACRO(TRANS), &n, &nrhs, dl, d, du, du2, IPIV, B, &ldb, info); }
00152   
00153   
00154   void LAPACK<int,float>::GETRI(const int n, float* A, const int lda, const int* IPIV, float* WORK, const int lwork, int* info) const
00155   { SGETRI_F77(&n, A, &lda, IPIV, WORK, &lwork, info); }
00156 
00157   void 
00158   LAPACK<int, float>::LATRS (const char UPLO, 
00159            const char TRANS, 
00160            const char DIAG, 
00161            const char NORMIN, 
00162            const int N,
00163            float* A, 
00164            const int LDA,
00165            float* X, 
00166            float* SCALE,
00167            float* CNORM,
00168            int* INFO) const
00169   {
00170     SLATRS_F77(CHAR_MACRO(UPLO), 
00171          CHAR_MACRO(TRANS), 
00172          CHAR_MACRO(DIAG), 
00173          CHAR_MACRO(NORMIN), 
00174          &N,
00175          A,
00176          &LDA,
00177          X,
00178          SCALE,
00179          CNORM,
00180          INFO);
00181   }
00182   
00183   
00184   void LAPACK<int,float>::GECON(const char NORM, const int n, const float* A, const int lda, const float anorm, float* rcond, float* WORK, int* IWORK, int* info) const
00185   { SGECON_F77(CHAR_MACRO(NORM), &n, A, &lda, &anorm, rcond, WORK, IWORK, info); }
00186   
00187   
00188   void LAPACK<int,float>::GESV(const int n, const int nrhs, float* A, const int lda, int* IPIV, float* B, const int ldb, int* info) const
00189   { SGESV_F77(&n, &nrhs, A, &lda, IPIV, B, &ldb, info); }
00190   
00191   
00192   void LAPACK<int,float>::GEEQU(const int m, const int n, const float* A, const int lda, float* R, float* C, float* rowcond, float* colcond, float* amax, int* info) const
00193   { SGEEQU_F77(&m, &n, A, &lda, R, C, rowcond, colcond, amax, info); }
00194   
00195   
00196   void LAPACK<int,float>::GERFS(const char TRANS, const int n, const int nrhs, const float* A, const int lda, const float* AF, const int ldaf, const int* IPIV, const float* B, const int ldb, float* X, const int ldx, float* FERR, float* BERR, float* WORK, int* IWORK, int* info) const
00197   { SGERFS_F77(CHAR_MACRO(TRANS), &n, &nrhs, A, &lda, AF, &ldaf, IPIV, B, &ldb, X, &ldx, FERR, BERR, WORK, IWORK, info); }
00198   
00199   
00200   void LAPACK<int,float>::GESVX(const char FACT, const char TRANS, const int n, const int nrhs, float* A, const int lda, float* AF, const int ldaf, int* IPIV, char EQUED, float* R, float* C, float* B, const int ldb, float* X, const int ldx, float* rcond, float* FERR, float* BERR, float* WORK, int* IWORK, int* info) const
00201   { SGESVX_F77(CHAR_MACRO(FACT), CHAR_MACRO(TRANS), &n, &nrhs, A, &lda, AF, &ldaf, IPIV, CHAR_MACRO(EQUED), R, C, B, &ldb, X, &ldx, rcond, FERR, BERR, WORK, IWORK, info); }
00202   
00203   
00204   void LAPACK<int,float>::SYTRD(const char UPLO, const int n, float* A, const int lda, float* D, float* E, float* TAU, float* WORK, const int lwork, int* info) const
00205   { SSYTRD_F77(CHAR_MACRO(UPLO), &n, A, &lda, D, E, TAU, WORK, &lwork, info); }
00206 
00207   
00208   void LAPACK<int,float>::GEHRD(const int n, const int ilo, const int ihi, float* A, const int lda, float* TAU, float* WORK, const int lwork, int* info) const
00209   { SGEHRD_F77(&n, &ilo, &ihi, A, &lda, TAU, WORK, &lwork, info); }
00210   
00211   
00212   void LAPACK<int,float>::TRTRS(const char UPLO, const char TRANS, const char DIAG, const int n, const int nrhs, const float* A, const int lda, float* B, const int ldb, int* info) const 
00213   { STRTRS_F77(CHAR_MACRO(UPLO), CHAR_MACRO(TRANS), CHAR_MACRO(DIAG), &n, &nrhs, A, &lda, B, &ldb, info); }
00214   
00215   
00216   void LAPACK<int,float>::TRTRI(const char UPLO, const char DIAG, const int n, const float* A, const int lda, int* info) const 
00217   { STRTRI_F77(CHAR_MACRO(UPLO), CHAR_MACRO(DIAG), &n, A, &lda, info); }
00218   
00219   
00220   void LAPACK<int,float>::SPEV(const char JOBZ, const char UPLO, const int n, float* AP, float* W, float* Z, const int ldz, float* WORK, int* info) const
00221   { SSPEV_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &n, AP, W, Z, &ldz, WORK, info); }
00222 
00223   
00224   void LAPACK<int,float>::SYEV(const char JOBZ, const char UPLO, const int n, float* A, const int lda, float* W, float* WORK, const int lwork, int* info) const
00225   { SSYEV_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &n, A, &lda, W, WORK, &lwork, info); }
00226 
00227   
00228   void LAPACK<int,float>::SYGV(const int itype, const char JOBZ, const char UPLO, const int n, float* A, const int lda, float* B, const int ldb, float* W, float* WORK, const int lwork, int* info) const
00229   { SSYGV_F77(&itype, CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &n, A, &lda, B, &ldb, W, WORK, &lwork, info); }
00230 
00231   
00232   void LAPACK<int,float>::HEEV(const char JOBZ, const char UPLO, const int n, float* A, const int lda, float* W, float* WORK, const int lwork, float* RWORK, int* info) const
00233   { SSYEV_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &n, A, &lda, W, WORK, &lwork, info); }
00234 
00235   
00236   void LAPACK<int,float>::HEGV(const int itype, const char JOBZ, const char UPLO, const int n, float* A, const int lda, float* B, const int ldb, float* W, float* WORK, const int lwork, float *RWORK, int* info) const
00237   { SSYGV_F77(&itype, CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &n, A, &lda, B, &ldb, W, WORK, &lwork, info); }
00238 
00239   
00240   void LAPACK<int,float>::STEQR(const char COMPZ, const int n, float* D, float* E, float* Z, const int ldz, float* WORK, int* info) const
00241   { SSTEQR_F77(CHAR_MACRO(COMPZ), &n, D, E, Z, &ldz, WORK, info); }
00242 
00243   
00244   void LAPACK<int, float>::HSEQR(const char JOB, const char COMPZ, const int n, const int ilo, const int ihi, float* H, const int ldh, float* WR, float* WI, float* Z, const int ldz, float* WORK, const int lwork, int* info) const
00245   { SHSEQR_F77(CHAR_MACRO(JOB), CHAR_MACRO(COMPZ), &n, &ilo, &ihi, H, &ldh, WR, WI, Z, &ldz, WORK, &lwork, info); }
00246 
00247   
00248   void LAPACK<int, float>::GEES(const char JOBVS, const char SORT, int (*ptr2func)(float*, float*), const int n, float* A, const int lda, int* sdim, float* WR, float* WI, float* VS, const int ldvs, float* WORK, const int lwork, int* BWORK, int* info) const    
00249   { SGEES_F77(CHAR_MACRO(JOBVS), CHAR_MACRO(SORT), ptr2func, &n, A, &lda, sdim, WR, WI, VS, &ldvs, WORK, &lwork, BWORK, info); }
00250 
00251   
00252   void LAPACK<int, float>::GEES(const char JOBVS, const int n, float* A, const int lda, int* sdim, float* WR, float* WI, float* VS, const int ldvs, float* WORK, const int lwork, float* RWORK, int* BWORK, int* info) const    
00253   { 
00254     int (*nullfptr)(float*,float*) = NULL;
00255     const char sort = 'N';
00256     SGEES_F77(CHAR_MACRO(JOBVS), CHAR_MACRO(sort), nullfptr, &n, A, &lda, sdim, WR, WI, VS, &ldvs, WORK, &lwork, BWORK, info);
00257   }
00258 
00259   
00260   void LAPACK<int, float>::GEEV(const char JOBVL, const char JOBVR, const int n, float* A, const int lda, float* WR, float* WI, float* VL, const int ldvl, float* VR, const int ldvr, float* WORK, const int lwork, int* info) const
00261   { SGEEV_F77(CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), &n, A, &lda, WR, WI, VL, &ldvl, VR, &ldvr, WORK, &lwork, info); }
00262 
00263   
00264   void LAPACK<int, float>::GESVD(const char JOBU, const char JOBVT, const int m, const int n, float* A, const int lda, float* S, float* U, const int ldu, float* V, const int ldv, float* WORK, const int lwork, float* RWORK, int* info) const 
00265   { SGESVD_F77(CHAR_MACRO(JOBU), CHAR_MACRO(JOBVT), &m, &n, A, &lda, S, U, &ldu, V, &ldv, WORK, &lwork, info); }
00266 
00267   
00268   void LAPACK<int,float>::GGEVX(const char BALANC, const char JOBVL, const char JOBVR, const char SENSE, const int n, float* A, const int lda, float* B, const int ldb, float* ALPHAR, float* ALPHAI, float* BETA, float* VL, const int ldvl, float* VR, const int ldvr, int* ilo, int* ihi, float* LSCALE, float* RSCALE, float* abnrm, float* bbnrm, float* RCONDE, float* RCONDV, float* WORK, const int lwork, int* IWORK, int* BWORK, int* info) const
00269   { SGGEVX_F77(CHAR_MACRO(BALANC), CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), CHAR_MACRO(SENSE), &n, A, &lda, B, &ldb, ALPHAR, ALPHAI, BETA, VL, &ldvl, VR, &ldvr, ilo, ihi, LSCALE, RSCALE, abnrm, bbnrm, RCONDE, RCONDV, WORK, &lwork, IWORK, BWORK, info); }
00270 
00271   
00272   void LAPACK<int, float>::GGEV(const char JOBVL, const char JOBVR, const int n, float *A, const int lda, float *B, const int ldb, float *ALPHAR, float *ALPHAI, float *BETA, float *VL, const int ldvl, float *VR, const int ldvr, float *WORK, const int lwork, int *info) const
00273   { SGGEV_F77(CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), &n, A, &lda, B, &ldb, ALPHAR, ALPHAI, BETA, VL, &ldvl, VR, &ldvr, WORK, &lwork, info); }
00274 
00275   
00276   void LAPACK<int, float>::ORMQR(const char SIDE, const char TRANS, const int m, const int n, const int k, float* A, const int lda, const float* TAU, float* C, const int ldc, float* WORK, const int lwork, int* info) const
00277   { SORMQR_F77(CHAR_MACRO(SIDE), CHAR_MACRO(TRANS), &m, &n, &k, A, &lda, TAU, C, &ldc, WORK, &lwork, info); }
00278 
00279   
00280   void LAPACK<int, float>::ORGQR(const int m, const int n, const int k, float* A, const int lda, const float* TAU, float* WORK, const int lwork, int* info) const
00281   { SORGQR_F77( &m, &n, &k, A, &lda, TAU, WORK, &lwork, info); }
00282   
00283   
00284   void LAPACK<int, float>::UNGQR(const int m, const int n, const int k, float* A, const int lda, const float* TAU, float* WORK, const int lwork, int* info) const
00285   { SORGQR_F77( &m, &n, &k, A, &lda, TAU, WORK, &lwork, info); }
00286   
00287   
00288   void LAPACK<int, float>::ORGHR(const int n, const int ilo, const int ihi, float* A, const int lda, const float* TAU, float* WORK, const int lwork, int* info) const
00289   { SORGHR_F77(&n, &ilo, &ihi, A, &lda, TAU, WORK, &lwork, info); }
00290   
00291   
00292   void LAPACK<int, float>::ORMHR(const char SIDE, const char TRANS, const int m, const int n, const int ilo, const int ihi, const float* A, const int lda, const float* TAU, float* C, const int ldc, float* WORK, const int lwork, int* info) const
00293   { SORMHR_F77(CHAR_MACRO(SIDE), CHAR_MACRO(TRANS), &m, &n, &ilo, &ihi, A, &lda, TAU, C, &ldc, WORK, &lwork, info); }
00294   
00295   
00296   void LAPACK<int, float>::TREVC(const char SIDE, const char HOWMNY, int* select, const int n, const float* T, const int ldt, float* VL, const int ldvl, float* VR, const int ldvr, const int mm, int* m, float* WORK, int* info) const
00297   { STREVC_F77(CHAR_MACRO(SIDE), CHAR_MACRO(HOWMNY), select, &n, T, &ldt, VL, &ldvl, VR, &ldvr, &mm, m, WORK, info); }
00298   
00299   
00300   void LAPACK<int, float>::TREVC(const char SIDE, const int n, const float* T, const int ldt, float* VL, const int ldvl, float* VR, const int ldvr, const int mm, int* m, float* WORK, float* RWORK, int* info) const
00301   {
00302     std::vector<int> select(1);
00303     const char whch = 'A';
00304     STREVC_F77(CHAR_MACRO(SIDE), CHAR_MACRO(whch), &select[0], &n, T, &ldt, VL, &ldvl, VR, &ldvr, &mm, m, WORK, info);
00305   }
00306   
00307   
00308   void LAPACK<int, float>::TREXC(const char COMPQ, const int n, float* T, const int ldt, float* Q, const int ldq, int ifst, int ilst, float* WORK, int* info) const
00309   { STREXC_F77(CHAR_MACRO(COMPQ), &n, T, &ldt, Q, &ldq, &ifst, &ilst, WORK, info); }
00310 
00311   
00312   void LAPACK<int, float>::LARTG( const float f, const float g, float* c, float* s, float* r ) const
00313   { SLARTG_F77(&f, &g, c, s, r); }
00314 
00315   
00316   void LAPACK<int, float>::LARFG( const int n, float* alpha, float* x, const int incx, float* tau ) const
00317   { SLARFG_F77(&n, alpha, x, &incx, tau); }
00318 
00319   
00320   void LAPACK<int, float>::GEBAL(const char JOBZ, const int n, float* A, const int lda, int ilo, int ihi, float* scale, int* info) const
00321   { SGEBAL_F77(CHAR_MACRO(JOBZ),&n, A, &lda, &ilo, &ihi, scale, info); }
00322 
00323   
00324   void LAPACK<int, float>::GEBAK(const char JOBZ, const char SIDE, const int n, const int ilo, const int ihi, const float* scale, const int m, float* V, const int ldv, int* info) const
00325   { SGEBAK_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(SIDE), &n, &ilo, &ihi, scale, &m, V, &ldv, info); }
00326 
00327 #ifdef HAVE_TEUCHOS_LAPACKLARND 
00328   float LAPACK<int, float>::LARND( const int idist, int* seed ) const
00329   { return(SLARND_F77(&idist, seed)); }
00330 #endif
00331   
00332   void LAPACK<int, float>::LARNV( const int idist, int* seed, const int n, float* v ) const
00333   { SLARNV_F77(&idist, seed, &n, v); }
00334 
00335   
00336   float LAPACK<int, float>::LAMCH(const char CMACH) const
00337   { return(SLAMCH_F77(CHAR_MACRO(CMACH))); }
00338 
00339   
00340   int LAPACK<int, float>::ILAENV( const int ispec, const std::string& NAME, const std::string& OPTS, const int N1, const int N2, const int N3, const int N4 ) const
00341   {
00342     unsigned int opts_length = OPTS.length();
00343     // if user queries a Hermitian routine, change it to a symmetric routine
00344     std::string temp_NAME = "s" + NAME;
00345     if (temp_NAME.substr(1,2) == "he") {
00346       temp_NAME.replace(1,2,"sy");
00347     }
00348     unsigned int name_length = temp_NAME.length();
00349 #if defined (INTEL_CXML)
00350     return ILAENV_F77(&ispec, &temp_NAME[0], name_length, &OPTS[0], opts_length, &N1, &N2, &N3, &N4 );
00351 #else
00352     return ILAENV_F77(&ispec, &temp_NAME[0], &OPTS[0], &N1, &N2, &N3, &N4, name_length, opts_length );
00353 #endif
00354   }
00355  
00356   
00357   float LAPACK<int, float>::LAPY2(const float x, const float y) const
00358   {
00359 #ifdef HAVE_TEUCHOS_BLASFLOAT
00360     return SLAPY2_F77(&x, &y);
00361 #else
00362     typedef ScalarTraits<float> ST;
00363     const float xabs = ST::magnitude(x);
00364     const float yabs = ST::magnitude(y);
00365     const float w = TEUCHOS_MAX(xabs, yabs);
00366     const float z = TEUCHOS_MIN(xabs, yabs);
00367     if ( z == 0.0 ) {
00368       return w;
00369     }
00370     const float z_over_w = z/w;
00371     return w*ST::squareroot( 1.0+(z_over_w*z_over_w));
00372 #endif
00373   }
00374 
00375   // END INT, FLOAT SPECIALIZATION IMPLEMENTATION //
00376 
00377   // BEGIN INT, DOUBLE SPECIALIZATION IMPLEMENTATION //
00378 
00379 
00380   
00381   void LAPACK<int, double>::PTTRF(const int n, double* d, double* e, int* info) const
00382   { DPTTRF_F77(&n,d,e,info); }
00383   
00384   
00385   void LAPACK<int, double>::PTTRS(const int n, const int nrhs, const double* d, const double* e, double* B, const int ldb, int* info) const
00386   { DPTTRS_F77(&n,&nrhs,d,e,B,&ldb,info); }
00387   
00388   
00389   void LAPACK<int, double>::POTRF(const char UPLO, const int n, double* A, const int lda, int* info) const
00390   { DPOTRF_F77(CHAR_MACRO(UPLO), &n, A, &lda, info); }
00391   
00392   
00393   void LAPACK<int, double>::POTRS(const char UPLO, const int n, const int nrhs, const double* A, const int lda, double* B, const int ldb, int* info) const
00394   { DPOTRS_F77(CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, B, &ldb, info); }
00395   
00396   
00397   void LAPACK<int, double>::POTRI(const char UPLO, const int n, double* A, const int lda, int* info) const
00398   { DPOTRI_F77(CHAR_MACRO(UPLO), &n, A, &lda, info); }
00399   
00400   
00401   void LAPACK<int, double>::POCON(const char UPLO, const int n, const double* A, const int lda, const double anorm, double* rcond, double* WORK, int* IWORK, int* info) const
00402   { DPOCON_F77(CHAR_MACRO(UPLO), &n, A, &lda, &anorm, rcond, WORK, IWORK, info); }
00403   
00404   
00405   void LAPACK<int, double>::POSV(const char UPLO, const int n, const int nrhs, double* A, const int lda, double* B, const int ldb, int* info) const
00406   { DPOSV_F77(CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, B, &ldb, info); }
00407   
00408   
00409   void LAPACK<int, double>::POEQU(const int n, const double* A, const int lda, double* S, double* scond, double* amax, int* info) const
00410   { DPOEQU_F77(&n, A, &lda, S, scond, amax, info); }
00411   
00412   
00413   void LAPACK<int, double>::PORFS(const char UPLO, const int n, const int nrhs, double* A, const int lda, const double* AF, const int ldaf, const double* B, const int ldb, double* X, const int ldx, double* FERR, double* BERR, double* WORK, int* IWORK, int* info) const
00414   { DPORFS_F77(CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, AF, &ldaf, B, &ldb, X, &ldx, FERR, BERR, WORK, IWORK, info); }
00415   
00416   
00417   void LAPACK<int, double>::POSVX(const char FACT, const char UPLO, const int n, const int nrhs, double* A, const int lda, double* AF, const int ldaf, char EQUED, double* S, double* B, const int ldb, double* X, const int ldx, double* rcond, double* FERR, double* BERR, double* WORK, int* IWORK, int* info) const 
00418   { DPOSVX_F77(CHAR_MACRO(FACT), CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, AF, &ldaf, CHAR_MACRO(EQUED), S, B, &ldb, X, &ldx, rcond, FERR, BERR, WORK, IWORK, info); }
00419   
00420   
00421   void LAPACK<int,double>::GELS(const char TRANS, const int m, const int n, const int nrhs, double* A, const int lda, double* B, const int ldb, double* WORK, const int lwork, int* info) const
00422   { DGELS_F77(CHAR_MACRO(TRANS), &m, &n, &nrhs, A, &lda, B, &ldb, WORK, &lwork, info); }
00423 
00424 
00425   void LAPACK<int,double>::GELSS(const int m, const int n, const int nrhs, double* A, const int lda, double* B, const int ldb, double* S, const double rcond, int* rank, double* WORK, const int lwork, double* rwork, int* info) const
00426   { 
00427     (void) rwork;
00428     DGELSS_F77(&m, &n, &nrhs, A, &lda, B, &ldb, S, &rcond, rank, WORK, &lwork, info); 
00429   }
00430 
00431   
00432   void LAPACK<int,double>::GELSS(const int m, const int n, const int nrhs, double* A, const int lda, double* B, const int ldb, double* S, const double rcond, int* rank, double* WORK, const int lwork, int* info) const
00433   { DGELSS_F77(&m, &n, &nrhs, A, &lda, B, &ldb, S, &rcond, rank, WORK, &lwork, info); }
00434 
00435   
00436   void LAPACK<int,double>::GGLSE(const int m, const int n, const int p, double* A, const int lda, double* B, const int ldb, double* C, double* D, double* X, double* WORK, const int lwork, int* info) const
00437   { DGGLSE_F77(&m, &n, &p, A, &lda, B, &ldb, C, D, X, WORK, &lwork, info); }
00438 
00439     
00440   void LAPACK<int,double>::GEQRF( const int m, const int n, double* A, const int lda, double* TAU, double* WORK, const int lwork, int* info) const
00441   { DGEQRF_F77(&m, &n, A, &lda, TAU, WORK, &lwork, info); }
00442 
00443   
00444   void LAPACK<int,double>::GETRF(const int m, const int n, double* A, const int lda, int* IPIV, int* info) const
00445   { DGETRF_F77(&m, &n, A, &lda, IPIV, info); }
00446   
00447   
00448   void LAPACK<int,double>::GETRS(const char TRANS, const int n, const int nrhs, const double* A, const int lda, const int* IPIV, double* B, const int ldb, int* info) const
00449   { DGETRS_F77(CHAR_MACRO(TRANS), &n, &nrhs, A, &lda, IPIV, B, &ldb, info); }
00450   
00451   
00452   void LAPACK<int,double>::GTTRF(const int n, double* dl, double* d, double* du, double* du2, int* IPIV, int* info) const
00453   { DGTTRF_F77(&n, dl, d, du, du2, IPIV, info); }
00454 
00455   
00456   void LAPACK<int,double>::GTTRS(const char TRANS, const int n, const int nrhs, const double* dl, const double* d, const double* du, const double* du2, const int* IPIV, double* B, const int ldb, int* info) const
00457   { DGTTRS_F77(CHAR_MACRO(TRANS), &n, &nrhs, dl, d, du, du2, IPIV, B, &ldb, info); }
00458   
00459   
00460   void LAPACK<int,double>::GETRI(const int n, double* A, const int lda, const int* IPIV, double* WORK, const int lwork, int* info) const
00461   { DGETRI_F77(&n, A, &lda, IPIV, WORK, &lwork, info); }
00462 
00463   void 
00464   LAPACK<int, double>::LATRS (const char UPLO, 
00465             const char TRANS, 
00466             const char DIAG, 
00467             const char NORMIN, 
00468             const int N,
00469             double* A, 
00470             const int LDA,
00471             double* X, 
00472             double* SCALE,
00473             double* CNORM,
00474             int* INFO) const
00475   {
00476     DLATRS_F77(CHAR_MACRO(UPLO), 
00477          CHAR_MACRO(TRANS), 
00478          CHAR_MACRO(DIAG), 
00479          CHAR_MACRO(NORMIN), 
00480          &N,
00481          A,
00482          &LDA,
00483          X,
00484          SCALE,
00485          CNORM,
00486          INFO);
00487   }
00488   
00489   void LAPACK<int,double>::GECON(const char NORM, const int n, const double* A, const int lda, const double anorm, double* rcond, double* WORK, int* IWORK, int* info) const
00490   { DGECON_F77(CHAR_MACRO(NORM), &n, A, &lda, &anorm, rcond, WORK, IWORK, info); }
00491   
00492   
00493   void LAPACK<int,double>::GESV(const int n, const int nrhs, double* A, const int lda, int* IPIV, double* B, const int ldb, int* info) const
00494   { DGESV_F77(&n, &nrhs, A, &lda, IPIV, B, &ldb, info); }
00495   
00496   
00497   void LAPACK<int,double>::GEEQU(const int m, const int n, const double* A, const int lda, double* R, double* C, double* rowcond, double* colcond, double* amax, int* info) const
00498   { DGEEQU_F77(&m, &n, A, &lda, R, C, rowcond, colcond, amax, info); }
00499   
00500   
00501   void LAPACK<int,double>::GERFS(const char TRANS, const int n, const int nrhs, const double* A, const int lda, const double* AF, const int ldaf, const int* IPIV, const double* B, const int ldb, double* X, const int ldx, double* FERR, double* BERR, double* WORK, int* IWORK, int* info) const
00502   { DGERFS_F77(CHAR_MACRO(TRANS), &n, &nrhs, A, &lda, AF, &ldaf, IPIV, B, &ldb, X, &ldx, FERR, BERR, WORK, IWORK, info); }
00503   
00504   
00505   void LAPACK<int,double>::GESVX(const char FACT, const char TRANS, const int n, const int nrhs, double* A, const int lda, double* AF, const int ldaf, int* IPIV, char EQUED, double* R, double* C, double* B, const int ldb, double* X, const int ldx, double* rcond, double* FERR, double* BERR, double* WORK, int* IWORK, int* info) const
00506   { DGESVX_F77(CHAR_MACRO(FACT), CHAR_MACRO(TRANS), &n, &nrhs, A, &lda, AF, &ldaf, IPIV, CHAR_MACRO(EQUED), R, C, B, &ldb, X, &ldx, rcond, FERR, BERR, WORK, IWORK, info); }
00507   
00508   
00509   void LAPACK<int,double>::SYTRD(const char UPLO, const int n, double* A, const int lda, double* D, double* E, double* TAU, double* WORK, const int lwork, int* info) const
00510   { DSYTRD_F77(CHAR_MACRO(UPLO), &n, A, &lda, D, E, TAU, WORK, &lwork, info); }
00511 
00512   
00513   void LAPACK<int, double>::GEHRD(const int n, const int ilo, const int ihi, double* A, const int lda, double* TAU, double* WORK, const int lwork, int* info) const
00514   { DGEHRD_F77(&n, &ilo, &ihi, A, &lda, TAU, WORK, &lwork, info); }
00515 
00516   
00517   void LAPACK<int,double>::TRTRS(const char UPLO, const char TRANS, const char DIAG, const int n, const int nrhs, const double* A, const int lda, double* B, const int ldb, int* info) const 
00518   { DTRTRS_F77(CHAR_MACRO(UPLO), CHAR_MACRO(TRANS), CHAR_MACRO(DIAG), &n, &nrhs, A, &lda, B, &ldb, info); }
00519  
00520   
00521   void LAPACK<int,double>::TRTRI(const char UPLO, const char DIAG, const int n, const double* A, const int lda, int* info) const
00522   { DTRTRI_F77(CHAR_MACRO(UPLO), CHAR_MACRO(DIAG), &n, A, &lda, info); }
00523  
00524   
00525   void LAPACK<int,double>::SPEV(const char JOBZ, const char UPLO, const int n, double* AP, double* W, double* Z, const int ldz, double* WORK, int* info) const
00526   { DSPEV_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &n, AP, W, Z, &ldz, WORK, info); }
00527 
00528   
00529   void LAPACK<int,double>::SYEV(const char JOBZ, const char UPLO, const int n, double* A, const int lda, double* W, double* WORK, const int lwork, int* info) const
00530   {
00531     DSYEV_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &n, A, &lda, W, WORK, &lwork, info);
00532   }
00533 
00534   
00535   void LAPACK<int,double>::SYGV(const int itype, const char JOBZ, const char UPLO, const int n, double* A, const int lda, double* B, const int ldb, double* W, double* WORK, const int lwork, int* info) const
00536   {
00537     DSYGV_F77(&itype, CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &n, A, &lda, B, &ldb, W, WORK, &lwork, info);
00538   }
00539 
00540   
00541   void LAPACK<int,double>::HEEV(const char JOBZ, const char UPLO, const int n, double* A, const int lda, double* W, double* WORK, const int lwork, double* RWORK, int* info) const
00542   {
00543     DSYEV_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &n, A, &lda, W, WORK, &lwork, info);
00544   }
00545 
00546   
00547   void LAPACK<int,double>::HEGV(const int itype, const char JOBZ, const char UPLO, const int n, double* A, const int lda, double* B, const int ldb, double* W, double* WORK, const int lwork, double *RWORK, int* info) const
00548   {
00549     DSYGV_F77(&itype, CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &n, A, &lda, B, &ldb, W, WORK, &lwork, info);
00550   }
00551 
00552   
00553   void LAPACK<int,double>::STEQR(const char COMPZ, const int n, double* D, double* E, double* Z, const int ldz, double* WORK, int* info) const
00554   {
00555     DSTEQR_F77(CHAR_MACRO(COMPZ), &n, D, E, Z, &ldz, WORK, info);
00556   }
00557 
00558   
00559   void LAPACK<int, double>::HSEQR(const char JOB, const char COMPZ, const int n, const int ilo, const int ihi, double* H, const int ldh, double* WR, double* WI, double* Z, const int ldz, double* WORK, const int lwork, int* info) const
00560   {
00561     DHSEQR_F77(CHAR_MACRO(JOB), CHAR_MACRO(COMPZ), &n, &ilo, &ihi, H, &ldh, WR, WI, Z, &ldz, WORK, &lwork, info);
00562   }
00563   
00564   
00565   void LAPACK<int, double>::GEES(const char JOBVS, const char SORT, int (*ptr2func)(double*, double*), const int n, double* A, const int lda, int* sdim, double* WR, double* WI, double* VS, const int ldvs, double* WORK, const int lwork, int* BWORK, int* info) const    
00566   {
00567     DGEES_F77(CHAR_MACRO(JOBVS), CHAR_MACRO(SORT), ptr2func, &n, A, &lda, sdim, WR, WI, VS, &ldvs, WORK, &lwork, BWORK, info);
00568   }
00569 
00570   
00571   void LAPACK<int, double>::GEES(const char JOBVS, const int n, double* A, const int lda, int* sdim, double* WR, double* WI, double* VS, const int ldvs, double* WORK, const int lwork, double* RWORK, int* BWORK, int* info) const    
00572   {
00573     //int (*nullfptr)(double*,double*) = NULL;
00574     gees_nullfptr_t nullfptr = 0;
00575     const char sort = 'N';
00576     DGEES_F77(CHAR_MACRO(JOBVS), CHAR_MACRO(sort), nullfptr, &n, A, &lda, sdim, WR, WI, VS, &ldvs, WORK, &lwork, BWORK, info);
00577   }
00578 
00579   
00580   void LAPACK<int, double>::GEEV(const char JOBVL, const char JOBVR, const int n, double* A, const int lda, double* WR, double* WI, double* VL, const int ldvl, double* VR, const int ldvr, double* WORK, const int lwork, int* info) const
00581   {
00582     DGEEV_F77(CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), &n, A, &lda, WR, WI, VL, &ldvl, VR, &ldvr, WORK, &lwork, info);
00583   }
00584 
00585   
00586   void LAPACK<int, double>::GESVD(const char JOBU, const char JOBVT, const int m, const int n, double* A, const int lda, double* S, double* U, const int ldu, double* V, const int ldv, double* WORK, const int lwork, double* RWORK, int* info) const {
00587     DGESVD_F77(CHAR_MACRO(JOBU), CHAR_MACRO(JOBVT), &m, &n, A, &lda, S, U, &ldu, V, &ldv, WORK, &lwork, info);
00588   }
00589 
00590   
00591   void LAPACK<int, double>::GGEVX(const char BALANC, const char JOBVL, const char JOBVR, const char SENSE, const int n, double* A, const int lda, double* B, const int ldb, double* ALPHAR, double* ALPHAI, double* BETA, double* VL, const int ldvl, double* VR, const int ldvr, int* ilo, int* ihi, double* LSCALE, double* RSCALE, double* abnrm, double* bbnrm, double* RCONDE, double* RCONDV, double* WORK, const int lwork, int* IWORK, int* BWORK, int* info) const
00592   {
00593     DGGEVX_F77(CHAR_MACRO(BALANC), CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), CHAR_MACRO(SENSE), &n, A, &lda, B, &ldb, ALPHAR, ALPHAI, BETA, VL, &ldvl, VR, &ldvr, ilo, ihi, LSCALE, RSCALE, abnrm, bbnrm, RCONDE, RCONDV, WORK, &lwork, IWORK, BWORK, info);
00594   }
00595 
00596   
00597   void LAPACK<int, double>::GGEV(const char JOBVL, const char JOBVR, const int n, double *A, const int lda, double *B, const int ldb, double *ALPHAR, double *ALPHAI, double *BETA, double *VL, const int ldvl, double *VR, const int ldvr, double *WORK, const int lwork, int *info) const
00598   {
00599     DGGEV_F77(CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), &n, A, &lda, B, &ldb, ALPHAR, ALPHAI, BETA, VL, &ldvl, VR, &ldvr, WORK, &lwork, info);
00600   }
00601 
00602   
00603   void LAPACK<int, double>::ORMQR(const char SIDE, const char TRANS, const int m, const int n, const int k, double* A, const int lda, const double* TAU, double* C, const int ldc, double* WORK, const int lwork, int* info) const
00604   {
00605     DORMQR_F77(CHAR_MACRO(SIDE), CHAR_MACRO(TRANS), &m, &n, &k, A, &lda, TAU, C, &ldc, WORK, &lwork, info);
00606   }
00607 
00608   
00609   void LAPACK<int, double>::ORGQR(const int m, const int n, const int k, double* A, const int lda, const double* TAU, double* WORK, const int lwork, int* info) const
00610   {
00611     DORGQR_F77( &m, &n, &k, A, &lda, TAU, WORK, &lwork, info);
00612   }
00613   
00614   
00615   void LAPACK<int, double>::UNGQR(const int m, const int n, const int k, double* A, const int lda, const double* TAU, double* WORK, const int lwork, int* info) const
00616   {
00617     DORGQR_F77( &m, &n, &k, A, &lda, TAU, WORK, &lwork, info);
00618   }
00619   
00620   
00621   void LAPACK<int, double>::ORGHR(const int n, const int ilo, const int ihi, double* A, const int lda, const double* TAU, double* WORK, const int lwork, int* info) const
00622   {
00623     DORGHR_F77(&n, &ilo, &ihi, A, &lda, TAU, WORK, &lwork, info);
00624   }
00625   
00626   
00627   void LAPACK<int, double>::ORMHR(const char SIDE, const char TRANS, const int m, const int n, const int ilo, const int ihi, const double* A, const int lda, const double* TAU, double* C, const int ldc, double* WORK, const int lwork, int* info) const
00628   {
00629     DORMHR_F77(CHAR_MACRO(SIDE), CHAR_MACRO(TRANS), &m, &n, &ilo, &ihi, A, &lda, TAU, C, &ldc, WORK, &lwork, info);
00630   }
00631   
00632   
00633   void LAPACK<int, double>::TREVC(const char SIDE, const char HOWMNY, int* select, const int n, const double* T, const int ldt, double* VL, const int ldvl, double* VR, const int ldvr, const int mm, int* m, double* WORK, int* info) const
00634   {
00635     DTREVC_F77(CHAR_MACRO(SIDE), CHAR_MACRO(HOWMNY), select, &n, T, &ldt, VL, &ldvl, VR, &ldvr, &mm, m, WORK, info);
00636   }
00637   
00638   
00639   void LAPACK<int, double>::TREVC(const char SIDE, const int n, const double* T, const int ldt, double* VL, const int ldvl, double* VR, const int ldvr, const int mm, int* m, double* WORK, double* RWORK, int* info) const
00640   {
00641     std::vector<int> select(1);
00642     const char whch = 'A';
00643     DTREVC_F77(CHAR_MACRO(SIDE), CHAR_MACRO(whch), &select[0], &n, T, &ldt, VL, &ldvl, VR, &ldvr, &mm, m, WORK, info);
00644   }
00645   
00646   
00647   void LAPACK<int, double>::TREXC(const char COMPQ, const int n, double* T, const int ldt, double* Q, const int ldq, int ifst, int ilst, double* WORK, int* info) const
00648   {
00649     DTREXC_F77(CHAR_MACRO(COMPQ), &n, T, &ldt, Q, &ldq, &ifst, &ilst, WORK, info);
00650   }
00651 
00652   
00653   void LAPACK<int, double>::LARTG( const double f, const double g, double* c, double* s, double* r ) const
00654   {
00655     DLARTG_F77(&f, &g, c, s, r);
00656   }
00657 
00658   
00659   void LAPACK<int, double>::LARFG( const int n, double* alpha, double* x, const int incx, double* tau ) const
00660   {
00661     DLARFG_F77(&n, alpha, x, &incx, tau);
00662   }
00663 
00664   
00665   void LAPACK<int, double>::GEBAL(const char JOBZ, const int n, double* A, const int lda, int ilo, int ihi, double* scale, int* info) const
00666   {
00667     DGEBAL_F77(CHAR_MACRO(JOBZ),&n, A, &lda, &ilo, &ihi, scale, info);
00668   }
00669 
00670   
00671   void LAPACK<int, double>::GEBAK(const char JOBZ, const char SIDE, const int n, const int ilo, const int ihi, const double* scale, const int m, double* V, const int ldv, int* info) const
00672   {
00673     DGEBAK_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(SIDE), &n, &ilo, &ihi, scale, &m, V, &ldv, info);
00674   }
00675 
00676   
00677 #ifdef HAVE_TEUCHOS_LAPACKLARND 
00678   double LAPACK<int, double>::LARND( const int idist, int* seed ) const
00679   {
00680     return(DLARND_F77(&idist, seed));
00681   }
00682 #endif
00683   
00684   void LAPACK<int, double>::LARNV( const int idist, int* seed, const int n, double* v ) const
00685   {
00686     DLARNV_F77(&idist, seed, &n, v);
00687   }
00688 
00689   
00690   double LAPACK<int, double>::LAMCH(const char CMACH) const
00691   {
00692     return(DLAMCH_F77(CHAR_MACRO(CMACH)));
00693   }
00694 
00695   
00696   int LAPACK<int, double>::ILAENV( const int ispec, const std::string& NAME, const std::string& OPTS, const int N1, const int N2, const int N3, const int N4 ) const
00697   {
00698     unsigned int opts_length = OPTS.length();
00699     // if user queries a Hermitian routine, change it to a symmetric routine
00700     std::string temp_NAME = "d" + NAME;
00701     if (temp_NAME.substr(1,2) == "he") {
00702       temp_NAME.replace(1,2,"sy");
00703     }
00704     unsigned int name_length = temp_NAME.length();
00705 #if defined(INTEL_CXML)
00706     return ILAENV_F77(&ispec, &temp_NAME[0], name_length, &OPTS[0], opts_length, &N1, &N2, &N3, &N4 );
00707 #else
00708     return ::ILAENV_F77(&ispec, &temp_NAME[0], &OPTS[0], &N1, &N2, &N3, &N4, name_length, opts_length );
00709 #endif
00710   }
00711  
00712   
00713   double LAPACK<int, double>::LAPY2(const double x, const double y) const
00714   {
00715     return DLAPY2_F77(&x, &y);
00716   }
00717 
00718   // END INT, DOUBLE SPECIALIZATION IMPLEMENTATION //
00719 
00720 #ifdef HAVE_TEUCHOS_COMPLEX
00721 
00722   // BEGIN INT, COMPLEX<FLOAT> SPECIALIZATION IMPLEMENTATION //
00723 
00724   
00725   void LAPACK<int, std::complex<float> >::PTTRF(const int n, std::complex<float>* d, std::complex<float>* e, int* info) const
00726   {
00727     CPTTRF_F77(&n,d,e,info);
00728   }
00729   
00730   
00731   void LAPACK<int, std::complex<float> >::PTTRS(const int n, const int nrhs, const std::complex<float>* d, const std::complex<float>* e, std::complex<float>* B, const int ldb, int* info) const
00732   {
00733     CPTTRS_F77(&n,&nrhs,d,e,B,&ldb,info);
00734   }
00735   
00736   
00737   void LAPACK<int, std::complex<float> >::POTRF(const char UPLO, const int n, std::complex<float>* A, const int lda, int* info) const
00738   {
00739     CPOTRF_F77(CHAR_MACRO(UPLO), &n, A, &lda, info);
00740   }
00741   
00742   
00743   void LAPACK<int, std::complex<float> >::POTRS(const char UPLO, const int n, const int nrhs, const std::complex<float>* A, const int lda, std::complex<float>* B, const int ldb, int* info) const
00744   {
00745     CPOTRS_F77(CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, B, &ldb, info);
00746   }
00747   
00748   
00749   void LAPACK<int, std::complex<float> >::POTRI(const char UPLO, const int n, std::complex<float>* A, const int lda, int* info) const
00750   {
00751     CPOTRI_F77(CHAR_MACRO(UPLO), &n, A, &lda, info);
00752   }
00753   
00754   
00755   void LAPACK<int, std::complex<float> >::POCON(const char UPLO, const int n, const std::complex<float>* A, const int lda, const float anorm, float* rcond, std::complex<float>* WORK, float* RWORK, int* info) const
00756   {
00757     CPOCON_F77(CHAR_MACRO(UPLO), &n, A, &lda, &anorm, rcond, WORK, RWORK, info);
00758   }
00759   
00760   
00761   void LAPACK<int, std::complex<float> >::POSV(const char UPLO, const int n, const int nrhs, std::complex<float>* A, const int lda, std::complex<float>* B, const int ldb, int* info) const
00762   {
00763     CPOSV_F77(CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, B, &ldb, info);
00764   }
00765   
00766   
00767   void LAPACK<int, std::complex<float> >::POEQU(const int n, const std::complex<float>* A, const int lda, float* S, float* scond, float* amax, int* info) const
00768   {
00769     CPOEQU_F77(&n, A, &lda, S, scond, amax, info);
00770   }
00771   
00772   
00773   void LAPACK<int, std::complex<float> >::PORFS(const char UPLO, const int n, const int nrhs, std::complex<float>* A, const int lda, const std::complex<float>* AF, const int ldaf, const std::complex<float>* B, const int ldb, std::complex<float>* X, const int ldx, float* FERR, float* BERR, std::complex<float>* WORK, float* RWORK, int* info) const
00774   {
00775     CPORFS_F77(CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, AF, &ldaf, B, &ldb, X, &ldx, FERR, BERR, WORK, RWORK, info);
00776   }
00777   
00778   
00779   void LAPACK<int, std::complex<float> >::POSVX(const char FACT, const char UPLO, const int n, const int nrhs, std::complex<float>* A, const int lda, std::complex<float>* AF, const int ldaf, char EQUED, float* S, std::complex<float>* B, const int ldb, std::complex<float>* X, const int ldx, float* rcond, float* FERR, float* BERR, std::complex<float>* WORK, float* RWORK, int* info) const
00780   {
00781     CPOSVX_F77(CHAR_MACRO(FACT), CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, AF, &ldaf, CHAR_MACRO(EQUED), S, B, &ldb, X, &ldx, rcond, FERR, BERR, WORK, RWORK, info);
00782   }
00783   
00784   
00785   void LAPACK<int,std::complex<float> >::GELS(const char TRANS, const int m, const int n, const int nrhs, std::complex<float>* A, const int lda, std::complex<float>* B, const int ldb, std::complex<float>* WORK, const int lwork, int* info) const
00786   {
00787     CGELS_F77(CHAR_MACRO(TRANS), &m, &n, &nrhs, A, &lda, B, &ldb, WORK, &lwork, info);
00788   }
00789 
00790 
00791   void LAPACK<int, std::complex<float> >::GELSS(const int m, const int n, const int nrhs, std::complex<float>* A, const int lda, std::complex<float>* B, const int ldb, float* S, const float rcond, int* rank, std::complex<float>* WORK, const int lwork, float* rwork, int* info) const 
00792   {
00793     CGELSS_F77(&m, &n, &nrhs, A, &lda, B, &ldb, S, &rcond, rank, WORK, &lwork, rwork, info); 
00794   }
00795   
00796     
00797   void LAPACK<int,std::complex<float> >::GEQRF( const int m, const int n, std::complex<float>* A, const int lda, std::complex<float>* TAU, std::complex<float>* WORK, const int lwork, int* info) const
00798   {
00799     CGEQRF_F77(&m, &n, A, &lda, TAU, WORK, &lwork, info);
00800   }
00801 
00802   
00803   void LAPACK<int,std::complex<float> >::UNGQR(const int m, const int n, const int k, std::complex<float>* A, const int lda, const std::complex<float>* TAU, std::complex<float>* WORK, const int lwork, int* info) const
00804   {
00805     CUNGQR_F77( &m, &n, &k, A, &lda, TAU, WORK, &lwork, info);
00806   }
00807   
00808   
00809   void LAPACK<int,std::complex<float> >::GETRF(const int m, const int n, std::complex<float>* A, const int lda, int* IPIV, int* info) const
00810   {
00811     CGETRF_F77(&m, &n, A, &lda, IPIV, info);
00812   }
00813   
00814   
00815   void LAPACK<int,std::complex<float> >::GETRS(const char TRANS, const int n, const int nrhs, const std::complex<float>* A, const int lda, const int* IPIV, std::complex<float>* B , const int ldb, int* info) const
00816   {
00817     CGETRS_F77(CHAR_MACRO(TRANS), &n, &nrhs, A, &lda, IPIV, B, &ldb, info);
00818   }
00819   
00820   
00821   void LAPACK<int,std::complex<float> >::GTTRF(const int n, std::complex<float>* dl, std::complex<float>* d, std::complex<float>* du, std::complex<float>* du2, int* IPIV, int* info) const
00822   {
00823     CGTTRF_F77(&n, dl, d, du, du2, IPIV, info);
00824   }
00825 
00826   
00827   void LAPACK<int,std::complex<float> >::GTTRS(const char TRANS, const int n, const int nrhs, const std::complex<float>* dl, const std::complex<float>* d, const std::complex<float>* du, const std::complex<float>* du2, const int* IPIV, std::complex<float>* B, const int ldb, int* info) const
00828   {
00829     CGTTRS_F77(CHAR_MACRO(TRANS), &n, &nrhs, dl, d, du, du2, IPIV, B, &ldb, info);
00830   }
00831   
00832   
00833   void LAPACK<int,std::complex<float> >::GETRI(const int n, std::complex<float>* A, const int lda, const int* IPIV, std::complex<float>* WORK, const int lwork, int* info) const
00834   {
00835     CGETRI_F77(&n, A, &lda, IPIV, WORK, &lwork, info);
00836   }
00837   
00838 
00839   void 
00840   LAPACK<int, std::complex<float> >::LATRS (const char UPLO, 
00841               const char TRANS, 
00842               const char DIAG, 
00843               const char NORMIN, 
00844               const int N,
00845               std::complex<float>* A, 
00846               const int LDA,
00847               std::complex<float>* X, 
00848               float* SCALE,
00849               float* CNORM,
00850               int* INFO) const
00851   {
00852     CLATRS_F77(CHAR_MACRO(UPLO), 
00853          CHAR_MACRO(TRANS), 
00854          CHAR_MACRO(DIAG), 
00855          CHAR_MACRO(NORMIN), 
00856          &N,
00857          A,
00858          &LDA,
00859          X,
00860          SCALE,
00861          CNORM,
00862          INFO);
00863   }
00864 
00865   
00866   void LAPACK<int,std::complex<float> >::GECON(const char NORM, const int n, const std::complex<float>* A, const int lda, const float anorm, float* rcond, std::complex<float>* WORK, float* RWORK, int* info) const
00867   {
00868     CGECON_F77(CHAR_MACRO(NORM), &n, A, &lda, &anorm, rcond, WORK, RWORK, info);
00869   }
00870   
00871   
00872   void LAPACK<int,std::complex<float> >::GESV(const int n, const int nrhs, std::complex<float>* A, const int lda, int* IPIV, std::complex<float>* B, const int ldb, int* info) const
00873   {
00874     CGESV_F77(&n, &nrhs, A, &lda, IPIV, B, &ldb, info);
00875   }
00876   
00877   
00878   void LAPACK<int,std::complex<float> >::GEEQU(const int m, const int n, const std::complex<float>* A, const int lda, float* R, float* C, float* rowcond, float* colcond, float* amax, int* info) const
00879   {
00880     CGEEQU_F77(&m, &n, A, &lda, R, C, rowcond, colcond, amax, info);
00881   }
00882   
00883   
00884   void LAPACK<int,std::complex<float> >::GERFS(const char TRANS, const int n, const int nrhs, const std::complex<float>* A, const int lda, const std::complex<float>* AF, const int ldaf, const int* IPIV, const std::complex<float>* B, const int ldb, std::complex<float>* X, const int ldx, float* FERR, float* BERR, std::complex<float>* WORK, float* RWORK, int* info) const
00885   {
00886     CGERFS_F77(CHAR_MACRO(TRANS), &n, &nrhs, A, &lda, AF, &ldaf, IPIV, B, &ldb, X, &ldx, FERR, BERR, WORK, RWORK, info);
00887   }
00888   
00889   
00890   void LAPACK<int,std::complex<float> >::GESVX(const char FACT, const char TRANS, const int n, const int nrhs, std::complex<float>* A, const int lda, std::complex<float>* AF, const int ldaf, int* IPIV, char EQUED, float* R, float* C, std::complex<float>* B, const int ldb, std::complex<float>* X, const int ldx, float* rcond, float* FERR, float* BERR, std::complex<float>* WORK, float* RWORK, int* info) const
00891   {
00892     CGESVX_F77(CHAR_MACRO(FACT), CHAR_MACRO(TRANS), &n, &nrhs, A, &lda, AF, &ldaf, IPIV, CHAR_MACRO(EQUED), R, C, B, &ldb, X, &ldx, rcond, FERR, BERR, WORK, RWORK, info);
00893   }
00894   
00895   
00896   void LAPACK<int,std::complex<float> >::GEHRD(const int n, const int ilo, const int ihi, std::complex<float>* A, const int lda, std::complex<float>* TAU, std::complex<float>* WORK, const int lwork, int* info) const
00897   {
00898     CGEHRD_F77(&n, &ilo, &ihi, A, &lda, TAU, WORK, &lwork, info);
00899   }
00900   
00901   
00902   void LAPACK<int,std::complex<float> >::TRTRS(const char UPLO, const char TRANS, const char DIAG, const int n, const int nrhs, const std::complex<float>* A, const int lda, std::complex<float>* B, const int ldb, int* info) const 
00903   {
00904     CTRTRS_F77(CHAR_MACRO(UPLO), CHAR_MACRO(TRANS), CHAR_MACRO(DIAG), &n, &nrhs, A, &lda, B, &ldb, info);
00905   }
00906 
00907   
00908   void LAPACK<int,std::complex<float> >::TRTRI(const char UPLO, const char DIAG, const int n, const std::complex<float>* A, const int lda, int* info) const
00909   {
00910     CTRTRI_F77(CHAR_MACRO(UPLO), CHAR_MACRO(DIAG), &n, A, &lda, info);
00911   }
00912  
00913   
00914   void LAPACK<int,std::complex<float> >::STEQR(const char COMPZ, const int n, float* D, float* E, std::complex<float>* Z, const int ldz, float* WORK, int* info) const
00915   {
00916     CSTEQR_F77(CHAR_MACRO(COMPZ), &n, D, E, Z, &ldz, WORK, info);
00917   }
00918 
00919   
00920   void LAPACK<int,std::complex<float> >::HEEV(const char JOBZ, const char UPLO, const int n, std::complex<float> * A, const int lda, float * W, std::complex<float> * WORK, const int lwork, float* RWORK, int* info) const
00921   {
00922     CHEEV_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &n, A, &lda, W, WORK, &lwork, RWORK, info);
00923   }
00924 
00925   
00926   void LAPACK<int,std::complex<float> >::HEGV(const int itype, const char JOBZ, const char UPLO, const int n, std::complex<float> * A, const int lda, std::complex<float> * B, const int ldb, float * W, std::complex<float> * WORK, const int lwork, float *RWORK, int* info) const
00927   {
00928     CHEGV_F77(&itype, CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &n, A, &lda, B, &ldb, W, WORK, &lwork, RWORK, info);
00929   }
00930 
00931   
00932   void LAPACK<int, std::complex<float> >::HSEQR(const char JOB, const char COMPZ, const int n, const int ilo, const int ihi, std::complex<float>* H, const int ldh, std::complex<float>* W, std::complex<float>* Z, const int ldz, std::complex<float>* WORK, const int lwork, int* info) const
00933   {
00934     CHSEQR_F77(CHAR_MACRO(JOB), CHAR_MACRO(COMPZ), &n, &ilo, &ihi, H, &ldh, W, Z, &ldz, WORK, &lwork, info);
00935   }
00936 
00937   
00938   void LAPACK<int, std::complex<float> >::GEES(const char JOBVS, const char SORT, int (*ptr2func)(std::complex<float>*), const int n, std::complex<float>* A, const int lda, int* sdim, std::complex<float>* W, std::complex<float>* VS, const int ldvs, std::complex<float>* WORK, const int lwork, float* RWORK, int* BWORK, int* info) const    
00939   {
00940     CGEES_F77(CHAR_MACRO(JOBVS), CHAR_MACRO(SORT), ptr2func, &n, A, &lda, sdim, W, VS, &ldvs, WORK, &lwork, RWORK, BWORK, info);
00941   }
00942 
00943   
00944   void LAPACK<int, std::complex<float> >::GEES(const char JOBVS, const int n, std::complex<float>* A, const int lda, int* sdim, float* WR, float* WI, std::complex<float>* VS, const int ldvs, std::complex<float>* WORK, const int lwork, float* RWORK, int* BWORK, int* info) const    
00945   {
00946     int (*nullfptr)(std::complex<float>*) = NULL;
00947     std::vector< std::complex<float> > W(n);
00948     const char sort = 'N';
00949     CGEES_F77(CHAR_MACRO(JOBVS), CHAR_MACRO(sort), nullfptr, &n, A, &lda, sdim, &W[0], VS, &ldvs, WORK, &lwork, RWORK, BWORK, info);
00950     for (int i=0; i<n; i++) {
00951       WR[i] = W[i].real();
00952       WI[i] = W[i].imag();
00953     }
00954   }
00955 
00956   
00957   void LAPACK<int, std::complex<float> >::GEEV(const char JOBVL, const char JOBVR, const int n, std::complex<float>* A, const int lda, std::complex<float>* W, std::complex<float>* VL, const int ldvl, std::complex<float>* VR, const int ldvr, std::complex<float>* WORK, const int lwork, float* RWORK, int* info) const
00958   {
00959     CGEEV_F77(CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), &n, A, &lda, W, VL, &ldvl, VR, &ldvr, WORK, &lwork, RWORK, info);
00960   }
00961 
00962   
00963   void LAPACK<int, std::complex<float> >::GESVD(const char JOBU, const char JOBVT, const int m, const int n, std::complex<float> * A, const int lda, float* S, std::complex<float> * U, const int ldu, std::complex<float> * V, const int ldv, std::complex<float> * WORK, const int lwork, float* RWORK, int* info) const {
00964     CGESVD_F77(CHAR_MACRO(JOBU), CHAR_MACRO(JOBVT), &m, &n, A, &lda, S, U, &ldu, V, &ldv, WORK, &lwork, RWORK, info);
00965   }
00966 
00967 /*
00968   void LAPACK<int, std::complex<float> >::GGEVX(const char BALANC, const char JOBVL, const char JOBVR, const char SENSE, const int n, std::complex<float>* A, const int lda, std::complex<float>* B, const int ldb, float* ALPHAR, float* ALPHAI, std::complex<float>* BETA, std::complex<float>* VL, const int ldvl, std::complex<float>* VR, const int ldvr, int* ilo, int* ihi, float* LSCALE, float* RSCALE, float* abnrm, float* bbnrm, float* RCONDE, float* RCONDV, std::complex<float>* WORK, const int lwork, int* IWORK, int* BWORK, int* info) const
00969   {
00970     std::vector< std::complex<float> > ALPHA(n);
00971     CGGEVX_F77(CHAR_MACRO(BALANC), CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), CHAR_MACRO(SENSE), &n, A, &lda, B, &ldb, &ALPHA[0], BETA, VL, &ldvl, VR, &ldvr, ilo, ihi, LSCALE, RSCALE, abnrm, bbnrm, RCONDE, RCONDV, WORK, &lwork, IWORK, BWORK, info);
00972     for (int i=0; i<n; i++) {
00973       ALPHAR[i] = ALPHA[i].real();
00974       ALPHAI[i] = ALPHA[i].imag();
00975     }
00976   }
00977 */  
00978 
00979   
00980   void LAPACK<int, std::complex<float> >::TREVC(const char SIDE, const char HOWMNY, int* select, const int n, const std::complex<float>* T, const int ldt, std::complex<float>* VL, const int ldvl, std::complex<float>* VR, const int ldvr, const int mm, int* m, std::complex<float>* WORK, float* RWORK, int* info) const
00981   {
00982     CTREVC_F77(CHAR_MACRO(SIDE), CHAR_MACRO(HOWMNY), select, &n, T, &ldt, VL, &ldvl, VR, &ldvr, &mm, m, WORK, RWORK, info);
00983   }
00984   
00985   
00986   void LAPACK<int, std::complex<float> >::TREVC(const char SIDE, const int n, const std::complex<float>* T, const int ldt, std::complex<float>* VL, const int ldvl, std::complex<float>* VR, const int ldvr, const int mm, int* m, std::complex<float>* WORK, float* RWORK, int* info) const
00987   {
00988     std::vector<int> select(1);
00989     const char whch = 'A';
00990     CTREVC_F77(CHAR_MACRO(SIDE), CHAR_MACRO(whch), &select[0], &n, T, &ldt, VL, &ldvl, VR, &ldvr, &mm, m, WORK, RWORK, info);
00991   }
00992   
00993   
00994   void LAPACK<int, std::complex<float> >::TREXC(const char COMPQ, const int n, std::complex<float>* T, const int ldt, std::complex<float>* Q, const int ldq, int ifst, int ilst, std::complex<float>* WORK, int* info) const
00995   {
00996     CTREXC_F77(CHAR_MACRO(COMPQ), &n, T, &ldt, Q, &ldq, &ifst, &ilst, info);
00997   }
00998 
00999   
01000   void LAPACK<int, std::complex<float> >::LARTG( const std::complex<float> f, const std::complex<float> g, float* c, std::complex<float>* s, std::complex<float>* r ) const
01001   {
01002     CLARTG_F77(&f, &g, c, s, r);
01003   }
01004 
01005   
01006   void LAPACK<int, std::complex<float> >::LARFG( const int n, std::complex<float>* alpha, std::complex<float>* x, const int incx, std::complex<float>* tau ) const
01007   {
01008     CLARFG_F77(&n, alpha, x, &incx, tau);
01009   }
01010 
01011   
01012   void LAPACK<int, std::complex<float> >::GEBAL(const char JOBZ, const int n, std::complex<float>* A, const int lda, int ilo, int ihi, float* scale, int* info) const
01013   {
01014     CGEBAL_F77(CHAR_MACRO(JOBZ),&n, A, &lda, &ilo, &ihi, scale, info);
01015   }
01016 
01017   
01018   void LAPACK<int, std::complex<float> >::GEBAK(const char JOBZ, const char SIDE, const int n, const int ilo, const int ihi, const float* scale, const int m, std::complex<float>* V, const int ldv, int* info) const
01019   {
01020     CGEBAK_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(SIDE), &n, &ilo, &ihi, scale, &m, V, &ldv, info);
01021   }
01022 
01023   
01024 #ifdef HAVE_TEUCHOS_LAPACKLARND 
01025   std::complex<float> LAPACK<int, std::complex<float> >::LARND( const int idist, int* seed ) const
01026   {
01027     return(CLARND_F77(&idist, seed));
01028   }
01029 #endif
01030   
01031   void LAPACK<int, std::complex<float> >::LARNV( const int idist, int* seed, const int n, std::complex<float>* v ) const
01032   {
01033     CLARNV_F77(&idist, seed, &n, v);
01034   }
01035 
01036   
01037   int LAPACK<int, std::complex<float> >::ILAENV( const int ispec, const std::string& NAME, const std::string& OPTS, const int N1, const int N2, const int N3, const int N4 ) const
01038   {
01039     unsigned int opts_length = OPTS.length();
01040     std::string temp_NAME = "c" + NAME;
01041     unsigned int name_length = temp_NAME.length();
01042 #if defined (INTEL_CXML)
01043     return ILAENV_F77(&ispec, &temp_NAME[0], name_length, &OPTS[0], opts_length, &N1, &N2, &N3, &N4 );
01044 #else
01045     return ILAENV_F77(&ispec, &temp_NAME[0], &OPTS[0], &N1, &N2, &N3, &N4, name_length, opts_length );
01046 #endif
01047   }
01048 
01049   // END INT, COMPLEX<FLOAT> SPECIALIZATION IMPLEMENTATION //
01050 
01051   // BEGIN INT, COMPLEX<DOUBLE> SPECIALIZATION IMPLEMENTATION //
01052 
01053   
01054   void LAPACK<int, std::complex<double> >::PTTRF(const int n, std::complex<double>* d, std::complex<double>* e, int* info) const
01055   {
01056     ZPTTRF_F77(&n,d,e,info);
01057   }
01058   
01059   
01060   void LAPACK<int, std::complex<double> >::PTTRS(const int n, const int nrhs, const std::complex<double>* d, const std::complex<double>* e, std::complex<double>* B, const int ldb, int* info) const
01061   {
01062     ZPTTRS_F77(&n,&nrhs,d,e,B,&ldb,info);
01063   }
01064   
01065   
01066   void LAPACK<int, std::complex<double> >::POTRF(const char UPLO, const int n, std::complex<double>* A, const int lda, int* info) const
01067   {
01068     ZPOTRF_F77(CHAR_MACRO(UPLO), &n, A, &lda, info);
01069   }
01070   
01071   
01072   void LAPACK<int, std::complex<double> >::POTRS(const char UPLO, const int n, const int nrhs, const std::complex<double>* A, const int lda, std::complex<double>* B, const int ldb, int* info) const
01073   {
01074     ZPOTRS_F77(CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, B, &ldb, info);
01075   }
01076   
01077   
01078   void LAPACK<int, std::complex<double> >::POTRI(const char UPLO, const int n, std::complex<double>* A, const int lda, int* info) const
01079   {
01080     ZPOTRI_F77(CHAR_MACRO(UPLO), &n, A, &lda, info);
01081   }
01082   
01083   
01084   void LAPACK<int, std::complex<double> >::POCON(const char UPLO, const int n, const std::complex<double>* A, const int lda, const double anorm, double* rcond, std::complex<double>* WORK, double* RWORK, int* info) const
01085   {
01086     ZPOCON_F77(CHAR_MACRO(UPLO), &n, A, &lda, &anorm, rcond, WORK, RWORK, info);
01087   }
01088   
01089   
01090   void LAPACK<int, std::complex<double> >::POSV(const char UPLO, const int n, const int nrhs, std::complex<double>* A, const int lda, std::complex<double>* B, const int ldb, int* info) const
01091   {
01092     ZPOSV_F77(CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, B, &ldb, info);
01093   }
01094   
01095   
01096   void LAPACK<int, std::complex<double> >::POEQU(const int n, const std::complex<double>* A, const int lda, double* S, double* scond, double* amax, int* info) const
01097   {
01098     ZPOEQU_F77(&n, A, &lda, S, scond, amax, info);
01099   }
01100   
01101   
01102   void LAPACK<int, std::complex<double> >::PORFS(const char UPLO, const int n, const int nrhs, std::complex<double>* A, const int lda, const std::complex<double>* AF, const int ldaf, const std::complex<double>* B, const int ldb, std::complex<double>* X, const int ldx, double* FERR, double* BERR, std::complex<double>* WORK, double* RWORK, int* info) const
01103   {
01104     ZPORFS_F77(CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, AF, &ldaf, B, &ldb, X, &ldx, FERR, BERR, WORK, RWORK, info);
01105   }
01106   
01107   
01108   void LAPACK<int, std::complex<double> >::POSVX(const char FACT, const char UPLO, const int n, const int nrhs, std::complex<double>* A, const int lda, std::complex<double>* AF, const int ldaf, char EQUED, double* S, std::complex<double>* B, const int ldb, std::complex<double>* X, const int ldx, double* rcond, double* FERR, double* BERR, std::complex<double>* WORK, double* RWORK, int* info) const
01109   {
01110     ZPOSVX_F77(CHAR_MACRO(FACT), CHAR_MACRO(UPLO), &n, &nrhs, A, &lda, AF, &ldaf, CHAR_MACRO(EQUED), S, B, &ldb, X, &ldx, rcond, FERR, BERR, WORK, RWORK, info);
01111   }
01112   
01113   
01114   void LAPACK<int,std::complex<double> >::GELS(const char TRANS, const int m, const int n, const int nrhs, std::complex<double>* A, const int lda, std::complex<double>* B, const int ldb, std::complex<double>* WORK, const int lwork, int* info) const
01115   {
01116     ZGELS_F77(CHAR_MACRO(TRANS), &m, &n, &nrhs, A, &lda, B, &ldb, WORK, &lwork, info);
01117   }
01118 
01119 
01120   void LAPACK<int, std::complex<double> >::GELSS(const int m, const int n, const int nrhs, std::complex<double>* A, const int lda, std::complex<double>* B, const int ldb, double* S, const double rcond, int* rank, std::complex<double>* WORK, const int lwork, double* rwork, int* info) const 
01121   {
01122     ZGELSS_F77(&m, &n, &nrhs, A, &lda, B, &ldb, S, &rcond, rank, WORK, &lwork, rwork, info); 
01123   }
01124   
01125     
01126   void LAPACK<int,std::complex<double> >::GEQRF( const int m, const int n, std::complex<double>* A, const int lda, std::complex<double>* TAU, std::complex<double>* WORK, const int lwork, int* info) const
01127   {
01128     ZGEQRF_F77(&m, &n, A, &lda, TAU, WORK, &lwork, info);
01129   }
01130 
01131   
01132   void LAPACK<int,std::complex<double> >::UNGQR(const int m, const int n, const int k, std::complex<double>* A, const int lda, const std::complex<double>* TAU, std::complex<double>* WORK, const int lwork, int* info) const
01133   {
01134     ZUNGQR_F77( &m, &n, &k, A, &lda, TAU, WORK, &lwork, info);
01135   }
01136   
01137   
01138   void LAPACK<int,std::complex<double> >::GETRF(const int m, const int n, std::complex<double>* A, const int lda, int* IPIV, int* info) const
01139   {
01140     ZGETRF_F77(&m, &n, A, &lda, IPIV, info);
01141   }
01142   
01143   
01144   void LAPACK<int,std::complex<double> >::GETRS(const char TRANS, const int n, const int nrhs, const std::complex<double>* A, const int lda, const int* IPIV, std::complex<double>* B, const int ldb, int* info) const
01145   {
01146     ZGETRS_F77(CHAR_MACRO(TRANS), &n, &nrhs, A, &lda, IPIV, B, &ldb, info);
01147   }
01148   
01149   
01150   void LAPACK<int,std::complex<double> >::GTTRF(const int n, std::complex<double>* dl, std::complex<double>* d, std::complex<double>* du, std::complex<double>* du2, int* IPIV, int* info) const
01151   {
01152     ZGTTRF_F77(&n, dl, d, du, du2, IPIV, info);
01153   }
01154 
01155   
01156   void LAPACK<int,std::complex<double> >::GTTRS(const char TRANS, const int n, const int nrhs, const std::complex<double>* dl, const std::complex<double>* d, const std::complex<double>* du, const std::complex<double>* du2, const int* IPIV, std::complex<double>* B, const int ldb, int* info) const
01157   {
01158     ZGTTRS_F77(CHAR_MACRO(TRANS), &n, &nrhs, dl, d, du, du2, IPIV, B, &ldb, info);
01159   }
01160   
01161   
01162   void LAPACK<int,std::complex<double> >::GETRI(const int n, std::complex<double>* A, const int lda, const int* IPIV, std::complex<double>* WORK, const int lwork, int* info) const
01163   {
01164     ZGETRI_F77(&n, A, &lda, IPIV, WORK, &lwork, info);
01165   }
01166 
01167   void 
01168   LAPACK<int, std::complex<double> >::LATRS (const char UPLO, 
01169                const char TRANS, 
01170                const char DIAG, 
01171                const char NORMIN, 
01172                const int N,
01173                std::complex<double>* A, 
01174                const int LDA,
01175                std::complex<double>* X, 
01176                double* SCALE,
01177                double* CNORM,
01178                int* INFO) const
01179   {
01180     ZLATRS_F77(CHAR_MACRO(UPLO), 
01181          CHAR_MACRO(TRANS), 
01182          CHAR_MACRO(DIAG), 
01183          CHAR_MACRO(NORMIN), 
01184          &N,
01185          A,
01186          &LDA,
01187          X,
01188          SCALE,
01189          CNORM,
01190          INFO);
01191   }
01192   
01193   void LAPACK<int,std::complex<double> >::GECON(const char NORM, const int n, const std::complex<double>* A, const int lda, const double anorm, double* rcond, std::complex<double>* WORK, double* RWORK, int* info) const
01194   {
01195     ZGECON_F77(CHAR_MACRO(NORM), &n, A, &lda, &anorm, rcond, WORK, RWORK, info);
01196   }
01197   
01198   
01199   void LAPACK<int,std::complex<double> >::GESV(const int n, const int nrhs, std::complex<double>* A, const int lda, int* IPIV, std::complex<double>* B, const int ldb, int* info) const
01200   {
01201     ZGESV_F77(&n, &nrhs, A, &lda, IPIV, B, &ldb, info);
01202   }
01203   
01204   
01205   void LAPACK<int,std::complex<double> >::GEEQU(const int m, const int n, const std::complex<double>* A, const int lda, double* R, double* C, double* rowcond, double* colcond, double* amax, int* info) const
01206   {
01207     ZGEEQU_F77(&m, &n, A, &lda, R, C, rowcond, colcond, amax, info);
01208   }
01209   
01210   
01211   void LAPACK<int,std::complex<double> >::GERFS(const char TRANS, const int n, const int nrhs, const std::complex<double>* A, const int lda, const std::complex<double>* AF, const int ldaf, const int* IPIV, const std::complex<double>* B, const int ldb, std::complex<double>* X, const int ldx, double* FERR, double* BERR, std::complex<double>* WORK, double* RWORK, int* info) const
01212   {
01213     ZGERFS_F77(CHAR_MACRO(TRANS), &n, &nrhs, A, &lda, AF, &ldaf, IPIV, B, &ldb, X, &ldx, FERR, BERR, WORK, RWORK, info);
01214   }
01215   
01216   
01217   void LAPACK<int,std::complex<double> >::GESVX(const char FACT, const char TRANS, const int n, const int nrhs, std::complex<double>* A, const int lda, std::complex<double>* AF, const int ldaf, int* IPIV, char EQUED, double* R, double* C, std::complex<double>* B, const int ldb, std::complex<double>* X, const int ldx, double* rcond, double* FERR, double* BERR, std::complex<double>* WORK, double* RWORK, int* info) const
01218   {
01219     ZGESVX_F77(CHAR_MACRO(FACT), CHAR_MACRO(TRANS), &n, &nrhs, A, &lda, AF, &ldaf, IPIV, CHAR_MACRO(EQUED), R, C, B, &ldb, X, &ldx, rcond, FERR, BERR, WORK, RWORK, info);
01220   }
01221   
01222   
01223   void LAPACK<int,std::complex<double> >::GEHRD(const int n, const int ilo, const int ihi, std::complex<double>* A, const int lda, std::complex<double>* TAU, std::complex<double>* WORK, const int lwork, int* info) const
01224   {
01225     ZGEHRD_F77(&n, &ilo, &ihi, A, &lda, TAU, WORK, &lwork, info);
01226   }
01227   
01228   
01229   void LAPACK<int,std::complex<double> >::TRTRS(const char UPLO, const char TRANS, const char DIAG, const int n, const int nrhs, const std::complex<double>* A, const int lda, std::complex<double>* B, const int ldb, int* info) const 
01230   {
01231     ZTRTRS_F77(CHAR_MACRO(UPLO), CHAR_MACRO(TRANS), CHAR_MACRO(DIAG), &n, &nrhs, A, &lda, B, &ldb, info);
01232   }
01233  
01234   
01235   void LAPACK<int,std::complex<double> >::TRTRI(const char UPLO, const char DIAG, const int n, const std::complex<double>* A, const int lda, int* info) const
01236   {
01237     ZTRTRI_F77(CHAR_MACRO(UPLO), CHAR_MACRO(DIAG), &n, A, &lda, info);
01238   }
01239  
01240   
01241   void LAPACK<int,std::complex<double> >::STEQR(const char COMPZ, const int n, double* D, double* E, std::complex<double>* Z, const int ldz, double* WORK, int* info) const
01242   {
01243     ZSTEQR_F77(CHAR_MACRO(COMPZ), &n, D, E, Z, &ldz, WORK, info);
01244   }
01245 
01246   
01247   void LAPACK<int,std::complex<double> >::HEEV(const char JOBZ, const char UPLO, const int n, std::complex<double> * A, const int lda, double * W, std::complex<double> * WORK, const int lwork, double* RWORK, int* info) const
01248   {
01249     ZHEEV_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &n, A, &lda, W, WORK, &lwork, RWORK, info);
01250   }
01251 
01252   
01253   void LAPACK<int,std::complex<double> >::HEGV(const int itype, const char JOBZ, const char UPLO, const int n, std::complex<double> * A, const int lda, std::complex<double> * B, const int ldb, double * W, std::complex<double> * WORK, const int lwork, double *RWORK, int* info) const
01254   {
01255     ZHEGV_F77(&itype, CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &n, A, &lda, B, &ldb, W, WORK, &lwork, RWORK, info);
01256   }
01257 
01258   
01259   void LAPACK<int, std::complex<double> >::HSEQR(const char JOB, const char COMPZ, const int n, const int ilo, const int ihi, std::complex<double>* H, const int ldh, std::complex<double>* W, std::complex<double>* Z, const int ldz, std::complex<double>* WORK, const int lwork, int* info) const
01260   {
01261     ZHSEQR_F77(CHAR_MACRO(JOB), CHAR_MACRO(COMPZ), &n, &ilo, &ihi, H, &ldh, W, Z, &ldz, WORK, &lwork, info);
01262   }
01263 
01264   
01265   void LAPACK<int, std::complex<double> >::GEES(const char JOBVS, const char SORT, int (*ptr2func)(std::complex<double>*), const int n, std::complex<double>* A, const int lda, int* sdim, std::complex<double>* W, std::complex<double>* VS, const int ldvs, std::complex<double>* WORK, const int lwork, double* RWORK, int* BWORK, int* info) const    
01266   {
01267     ZGEES_F77(CHAR_MACRO(JOBVS), CHAR_MACRO(SORT), ptr2func, &n, A, &lda, sdim, W, VS, &ldvs, WORK, &lwork, RWORK, BWORK, info);
01268   }
01269 
01270   
01271   void LAPACK<int, std::complex<double> >::GEES(const char JOBVS, const int n, std::complex<double>* A, const int lda, int* sdim, double* WR, double* WI, std::complex<double>* VS, const int ldvs, std::complex<double>* WORK, const int lwork, double* RWORK, int* BWORK, int* info) const    
01272   {
01273     int (*nullfptr)(std::complex<double>*) = NULL;
01274     std::vector< std::complex<double> > W(n);
01275     const char sort = 'N';
01276     ZGEES_F77(CHAR_MACRO(JOBVS), CHAR_MACRO(sort), nullfptr, &n, A, &lda, sdim, &W[0], VS, &ldvs, WORK, &lwork, RWORK, BWORK, info);
01277     for (int i=0; i<n; i++) {
01278       WR[i] = W[i].real();
01279       WI[i] = W[i].imag();
01280     }
01281   }
01282 
01283   
01284   void LAPACK<int, std::complex<double> >::GEEV(const char JOBVL, const char JOBVR, const int n, std::complex<double>* A, const int lda, std::complex<double>* W, std::complex<double>* VL, const int ldvl, std::complex<double>* VR, const int ldvr, std::complex<double>* WORK, const int lwork, double* RWORK, int* info) const
01285   {
01286     ZGEEV_F77(CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), &n, A, &lda, W, VL, &ldvl, VR, &ldvr, WORK, &lwork, RWORK, info);
01287   }
01288 
01289   
01290   void LAPACK<int, std::complex<double> >::GESVD(const char JOBU, const char JOBVT, const int m, const int n, std::complex<double> * A, const int lda, double* S, std::complex<double> * U, const int ldu, std::complex<double> * V, const int ldv, std::complex<double> * WORK, const int lwork, double* RWORK, int* info) const {
01291     ZGESVD_F77(CHAR_MACRO(JOBU), CHAR_MACRO(JOBVT), &m, &n, A, &lda, S, U, &ldu, V, &ldv, WORK, &lwork, RWORK, info);
01292   }
01293 
01294 /*
01295   void LAPACK<int, std::complex<double> >::GGEVX(const char BALANC, const char JOBVL, const char JOBVR, const char SENSE, const int n, std::complex<double>* A, const int lda, std::complex<double>* B, const int ldb, double* ALPHAR, double* ALPHAI, std::complex<double>* BETA, std::complex<double>* VL, const int ldvl, std::complex<double>* VR, const int ldvr, int* ilo, int* ihi, double* LSCALE, double* RSCALE, double* abnrm, double* bbnrm, double* RCONDE, double* RCONDV, std::complex<double>* WORK, const int lwork, int* IWORK, int* BWORK, int* info) const
01296   {
01297     std::vector< std::complex<double> > ALPHA(n);
01298     ZGGEVX_F77(CHAR_MACRO(BALANC), CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), CHAR_MACRO(SENSE), &n, A, &lda, B, &ldb, &ALPHA[0], BETA, VL, &ldvl, VR, &ldvr, ilo, ihi, LSCALE, RSCALE, abnrm, bbnrm, RCONDE, RCONDV, WORK, &lwork, IWORK, BWORK, info);
01299     for (int i=0; i<n; i++) {
01300       ALPHAR[i] = ALPHA[i].real();
01301       ALPHAI[i] = ALPHA[i].imag();
01302     }
01303   }
01304 */
01305 
01306   
01307   void LAPACK<int, std::complex<double> >::TREVC(const char SIDE, const char HOWMNY, int* select, const int n, const std::complex<double>* T, const int ldt, std::complex<double>* VL, const int ldvl, std::complex<double>* VR, const int ldvr, const int mm, int* m, std::complex<double>* WORK, double* RWORK, int* info) const
01308   {
01309     ZTREVC_F77(CHAR_MACRO(SIDE), CHAR_MACRO(HOWMNY), select, &n, T, &ldt, VL, &ldvl, VR, &ldvr, &mm, m, WORK, RWORK, info);
01310   }
01311   
01312   
01313   void LAPACK<int, std::complex<double> >::TREVC(const char SIDE, const int n, const std::complex<double>* T, const int ldt, std::complex<double>* VL, const int ldvl, std::complex<double>* VR, const int ldvr, const int mm, int* m, std::complex<double>* WORK, double* RWORK, int* info) const
01314   {
01315     std::vector<int> select(1);
01316     const char whch = 'A';
01317     ZTREVC_F77(CHAR_MACRO(SIDE), CHAR_MACRO(whch), &select[0], &n, T, &ldt, VL, &ldvl, VR, &ldvr, &mm, m, WORK, RWORK, info);
01318   }
01319   
01320   
01321   void LAPACK<int, std::complex<double> >::TREXC(const char COMPQ, const int n, std::complex<double>* T, const int ldt, std::complex<double>* Q, const int ldq, int ifst, int ilst, std::complex<double>* WORK, int* info) const
01322   {
01323     ZTREXC_F77(CHAR_MACRO(COMPQ), &n, T, &ldt, Q, &ldq, &ifst, &ilst, info);
01324   }
01325 
01326   
01327   void LAPACK<int, std::complex<double> >::LARTG( const std::complex<double> f, const std::complex<double> g, double* c, std::complex<double>* s, std::complex<double>* r ) const
01328   {
01329     ZLARTG_F77(&f, &g, c, s, r);
01330   }
01331 
01332   
01333   void LAPACK<int, std::complex<double> >::LARFG( const int n, std::complex<double>* alpha, std::complex<double>* x, const int incx, std::complex<double>* tau ) const
01334   {
01335     ZLARFG_F77(&n, alpha, x, &incx, tau);
01336   }
01337 
01338   
01339   void LAPACK<int, std::complex<double> >::GEBAL(const char JOBZ, const int n, std::complex<double>* A, const int lda, int ilo, int ihi, double* scale, int* info) const
01340   {
01341     ZGEBAL_F77(CHAR_MACRO(JOBZ),&n, A, &lda, &ilo, &ihi, scale, info);
01342   }
01343 
01344   
01345   void LAPACK<int, std::complex<double> >::GEBAK(const char JOBZ, const char SIDE, const int n, const int ilo, const int ihi, const double* scale, const int m, std::complex<double>* V, const int ldv, int* info) const
01346   {
01347     ZGEBAK_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(SIDE), &n, &ilo, &ihi, scale, &m, V, &ldv, info);
01348   }
01349 
01350   
01351 #ifdef HAVE_TEUCHOS_LAPACKLARND 
01352   std::complex<double> LAPACK<int, std::complex<double> >::LARND( const int idist, int* seed ) const
01353   {
01354     return(ZLARND_F77(&idist, seed));
01355   }
01356 #endif
01357   
01358   void LAPACK<int, std::complex<double> >::LARNV( const int idist, int* seed, const int n, std::complex<double>* v ) const
01359   {
01360     ZLARNV_F77(&idist, seed, &n, v);
01361   }
01362 
01363   
01364   int LAPACK<int, std::complex<double> >::ILAENV( const int ispec, const std::string& NAME, const std::string& OPTS, const int N1, const int N2, const int N3, const int N4 ) const
01365   {
01366     unsigned int opts_length = OPTS.length();
01367     std::string temp_NAME = "z" + NAME;
01368     unsigned int name_length = temp_NAME.length();
01369 #if defined (INTEL_CXML)
01370     return ILAENV_F77(&ispec, &temp_NAME[0], name_length, &OPTS[0], opts_length, &N1, &N2, &N3, &N4 );
01371 #else
01372     return ::ILAENV_F77(&ispec, &temp_NAME[0], &OPTS[0], &N1, &N2, &N3, &N4, name_length, opts_length );
01373 #endif
01374   }
01375 
01376   // END INT, COMPLEX<DOUBLE> SPECIALIZATION IMPLEMENTATION //
01377 
01378 #endif // HAVE_TEUCHOS_COMPLEX
01379 
01380 } // namespace Teuchos
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines