Epetra Package Browser (Single Doxygen Collection) Development
Epetra_LAPACK.cpp
Go to the documentation of this file.
00001 
00002 //@HEADER
00003 // ************************************************************************
00004 // 
00005 //               Epetra: Linear Algebra Services Package 
00006 //                 Copyright 2001 Sandia Corporation
00007 // 
00008 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00009 // the U.S. Government retains certain rights in this software.
00010 //
00011 // Redistribution and use in source and binary forms, with or without
00012 // modification, are permitted provided that the following conditions are
00013 // met:
00014 //
00015 // 1. Redistributions of source code must retain the above copyright
00016 // notice, this list of conditions and the following disclaimer.
00017 //
00018 // 2. Redistributions in binary form must reproduce the above copyright
00019 // notice, this list of conditions and the following disclaimer in the
00020 // documentation and/or other materials provided with the distribution.
00021 //
00022 // 3. Neither the name of the Corporation nor the names of the
00023 // contributors may be used to endorse or promote products derived from
00024 // this software without specific prior written permission.
00025 //
00026 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00027 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00029 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00030 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00031 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00032 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00033 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00034 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00035 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00036 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 //
00038 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00039 // 
00040 // ************************************************************************
00041 //@HEADER
00042 
00043 #ifdef CHAR_MACRO
00044 #undef CHAR_MACRO
00045 #endif
00046 #if defined (INTEL_CXML)
00047 #define CHAR_MACRO(char_var) &char_var, 1
00048 #else
00049 #define CHAR_MACRO(char_var) &char_var
00050 #endif
00051 
00052 #include "Epetra_LAPACK.h"
00053 #include "Epetra_LAPACK_wrappers.h"
00054 
00055 
00056 // Symmetric positive definite linear systems
00057 
00058 //=============================================================================
00059 void Epetra_LAPACK::POTRF( const char UPLO, const int N, float * A, const int LDA, int * INFO) const {
00060   SPOTRF_F77(CHAR_MACRO(UPLO), &N, A, &LDA, INFO);
00061 }
00062 //=============================================================================
00063 void Epetra_LAPACK::POTRF( const char UPLO, const int N, double * A, const int LDA, int * INFO) const {
00064   DPOTRF_F77(CHAR_MACRO(UPLO), &N, A, &LDA, INFO);
00065 }
00066 //=============================================================================
00067 void Epetra_LAPACK::POTRS( const char UPLO, const int N, const int NRHS, const float * A, const int LDA, 
00068         float * X, const int LDX, int * INFO) const {
00069   SPOTRS_F77(CHAR_MACRO(UPLO), &N, &NRHS, A, &LDA, X, &LDX, INFO);
00070 }
00071 //=============================================================================
00072 void Epetra_LAPACK::POTRS( const char UPLO, const int N, const int NRHS, const double * A, const int LDA, 
00073         double * X, const int LDX, int * INFO) const {
00074   DPOTRS_F77(CHAR_MACRO(UPLO), &N, &NRHS, A, &LDA, X, &LDX, INFO);
00075 }
00076 //=============================================================================
00077 void Epetra_LAPACK::POTRI( const char UPLO, const int N, float * A, const int LDA, int * INFO) const {
00078   SPOTRI_F77(CHAR_MACRO(UPLO), &N, A, &LDA, INFO);
00079 }
00080 //=============================================================================
00081 void Epetra_LAPACK::POTRI( const char UPLO, const int N, double * A, const int LDA, int * INFO) const {
00082   DPOTRI_F77(CHAR_MACRO(UPLO), &N, A, &LDA, INFO);
00083 }
00084 //=============================================================================
00085 void Epetra_LAPACK::POCON( const char UPLO, const int N, const float * A, const int LDA, const float ANORM, 
00086         float * RCOND, float * WORK, int * IWORK, 
00087         int * INFO) const {
00088   SPOCON_F77(CHAR_MACRO(UPLO), &N, A, &LDA, &ANORM, RCOND, WORK, IWORK, INFO);
00089 }
00090 //=============================================================================
00091 void Epetra_LAPACK::POCON( const char UPLO, const int N, const double * A, const int LDA, const double ANORM, 
00092         double * RCOND, double * WORK, int * IWORK, 
00093         int * INFO) const {
00094   DPOCON_F77(CHAR_MACRO(UPLO), &N, A, &LDA, &ANORM, RCOND, WORK, IWORK, INFO);
00095 }
00096 //=============================================================================
00097 void Epetra_LAPACK::POSV( const char UPLO, const int N, const int NRHS, float * A, const int LDA, 
00098         float * X, const int LDX, int * INFO) const {
00099   SPOSV_F77(CHAR_MACRO(UPLO), &N, &NRHS, A, &LDA, X, &LDX, INFO);
00100 }
00101 //=============================================================================
00102 void Epetra_LAPACK::POSV( const char UPLO, const int N, const int NRHS, double * A, const int LDA, 
00103         double * X, const int LDX, int * INFO) const {
00104   DPOSV_F77(CHAR_MACRO(UPLO), &N, &NRHS, A, &LDA, X, &LDX, INFO);
00105 }
00106 //=============================================================================
00107 void Epetra_LAPACK::POEQU(const int N, const float * A, const int LDA, float * S, float * SCOND, 
00108        float * AMAX, int * INFO) const {
00109   SPOEQU_F77(&N, A, &LDA, S, SCOND, AMAX, INFO);
00110 }
00111 //=============================================================================
00112 void Epetra_LAPACK::POEQU(const int N, const double * A, const int LDA, double * S, double * SCOND,
00113       double * AMAX, int * INFO) const {     
00114   DPOEQU_F77(&N, A, &LDA, S, SCOND, AMAX, INFO);
00115 }
00116 //=============================================================================
00117 void Epetra_LAPACK::PORFS(const char UPLO, const int N, const int NRHS, const float * A, const int LDA, const float * AF, const int LDAF, 
00118        const float * B, const int LDB, float * X, const int LDX,
00119        float * FERR, float * BERR, float * WORK, int * IWORK, int * INFO) const {
00120   SPORFS_F77(CHAR_MACRO(UPLO), &N, &NRHS, A, &LDA, AF, &LDAF, B, &LDB, X, &LDX,
00121     FERR, BERR, WORK, IWORK, INFO);
00122 }
00123 //=============================================================================
00124 void Epetra_LAPACK::PORFS(const char UPLO, const int N, const int NRHS, const double * A, const int LDA, const double * AF, const int LDAF, 
00125        const double * B, const int LDB, double * X, const int LDX,
00126        double * FERR, double * BERR, double * WORK, int * IWORK, int * INFO) const {
00127   DPORFS_F77( CHAR_MACRO(UPLO), &N, &NRHS, A, &LDA, AF, &LDAF,B, &LDB, X, &LDX,
00128     FERR, BERR, WORK, IWORK, INFO);
00129 }
00130 //=============================================================================
00131 void Epetra_LAPACK::POSVX(const char FACT, const char UPLO, const int N, const int NRHS, float * A, const int LDA, float * AF, const int LDAF, 
00132        const char EQUED, float * S, float * B, const int LDB, float * X, const int LDX, float * RCOND, 
00133        float * FERR, float * BERR, float * WORK, int * IWORK, int * INFO) const {
00134   SPOSVX_F77(CHAR_MACRO(FACT), CHAR_MACRO(UPLO), &N, &NRHS, A, &LDA, AF, &LDAF, CHAR_MACRO(EQUED), S, B, &LDB, X, &LDX, 
00135     RCOND, FERR, BERR, WORK, IWORK, INFO);
00136 }
00137 //=============================================================================
00138 void Epetra_LAPACK::POSVX(const char FACT, const char UPLO, const int N, const int NRHS, double * A, const int LDA, double * AF, const int LDAF, 
00139        const char EQUED, double * S, double * B, const int LDB, double * X, const int LDX, double * RCOND, 
00140        double * FERR, double * BERR, double * WORK, int * IWORK, int * INFO) const {
00141   DPOSVX_F77(CHAR_MACRO(FACT), CHAR_MACRO(UPLO), &N, &NRHS, A, &LDA, AF, &LDAF, CHAR_MACRO(EQUED), S, B, &LDB, X, &LDX, RCOND, 
00142     FERR, BERR, WORK, IWORK, INFO);
00143 }
00144 
00145 // General linear systems
00146 //=============================================================================
00147 void Epetra_LAPACK::GELS( const char TRANS, const int M, const int N, const int NRHS,
00148         double* A, const int LDA, double* B, const int LDB, double* WORK, const int LWORK, 
00149         int * INFO) const {
00150   DGELS_F77 (CHAR_MACRO(TRANS), &M, &N, &NRHS, A, &LDA, B, &LDB, WORK, &LWORK, INFO );
00151         
00152 }
00153 //=============================================================================
00154 void Epetra_LAPACK::GETRF( const int M, const int N, float * A, const int LDA, int * IPIV, int * INFO) const {
00155   SGETRF_F77(&M, &N, A, &LDA, IPIV, INFO);
00156 }
00157 //=============================================================================
00158 void Epetra_LAPACK::GETRF( const int M, const int N, double * A, const int LDA, int * IPIV, int * INFO) const {
00159   DGETRF_F77(&M, &N, A, &LDA, IPIV, INFO);
00160 }
00161 //=============================================================================
00162 void Epetra_LAPACK::GEQRF( const int M, const int N,  float * A, const int LDA,  float * TAU,  float * WORK, const int LWORK, int * INFO) const {
00163   SGEQRF_F77(&M, &N, A, &LDA, TAU, WORK, &LWORK, INFO);
00164 }
00165 //=============================================================================
00166 void Epetra_LAPACK::GEQRF( const int M, const int N, double * A, const int LDA, double * TAU, double * WORK, const int LWORK, int * INFO) const {
00167   DGEQRF_F77(&M, &N, A, &LDA, TAU, WORK, &LWORK, INFO);
00168 }
00169 //=============================================================================
00170 void Epetra_LAPACK::GESVD(const char JOBU, const char JOBVT, const int M, const int N, float * A, 
00171         const int LDA, float * S, float * U,
00172         const int LDU, float * VT, const int LDVT, float * WORK, 
00173         const int * LWORK, int * INFO) const {
00174   SGESVD_F77(CHAR_MACRO(JOBU), CHAR_MACRO(JOBVT), &M, &N, A, &LDA, S, U, &LDU,
00175        VT, &LDVT, WORK, LWORK, INFO);
00176 }
00177 //=============================================================================
00178 void Epetra_LAPACK::GESVD(const char JOBU, const char JOBVT, const int M, const int N, double * A, 
00179         const int LDA, double * S, double * U,
00180         const int LDU, double * VT, const int LDVT, double * WORK, 
00181         const int * LWORK, int * INFO) const {
00182   DGESVD_F77(CHAR_MACRO(JOBU), CHAR_MACRO(JOBVT), &M, &N, A, &LDA, S, U, &LDU,
00183        VT, &LDVT, WORK, LWORK, INFO);
00184 }
00185 //=============================================================================
00186 void Epetra_LAPACK::GETRS( const char TRANS, const int N, const int NRHS, const float * A, const int LDA, 
00187         const int * IPIV, float * X, const int LDX, int * INFO) const {
00188   SGETRS_F77(CHAR_MACRO(TRANS), &N, &NRHS, A, &LDA, IPIV, X, &LDX, INFO);
00189 }
00190 //=============================================================================
00191 void Epetra_LAPACK::GETRS( const char TRANS, const int N, const int NRHS, const double * A, const int LDA, 
00192         const int * IPIV, double * X, const int LDX, int * INFO) const {
00193   DGETRS_F77(CHAR_MACRO(TRANS), &N, &NRHS, A, &LDA, IPIV, X, &LDX, INFO);
00194 }
00195 //=============================================================================
00196 void Epetra_LAPACK::GETRI( const int N, float * A, const int LDA, int * IPIV, 
00197         float * WORK, const int * LWORK, int * INFO) const {
00198   SGETRI_F77(&N, A, &LDA, IPIV, WORK, LWORK, INFO);
00199 }
00200 //=============================================================================
00201 void Epetra_LAPACK::GETRI( const int N, double * A, const int LDA, int * IPIV, 
00202         double * WORK, const int * LWORK, int * INFO) const {
00203   DGETRI_F77(&N, A, &LDA, IPIV, WORK, LWORK, INFO);
00204 }
00205 //=============================================================================
00206 void Epetra_LAPACK::GECON( const char NORM, const int N, const float  * A, const int LDA, const float ANORM, 
00207         float * RCOND, float * WORK, int * IWORK, 
00208         int * INFO) const {
00209   SGECON_F77(CHAR_MACRO(NORM), &N, A, &LDA, &ANORM, RCOND, WORK, IWORK, INFO);
00210 }
00211 //=============================================================================
00212 void Epetra_LAPACK::GECON( const char NORM, const int N, const double * A, const int LDA, const double ANORM, 
00213         double * RCOND, double * WORK, int * IWORK, 
00214         int * INFO) const {
00215   DGECON_F77(CHAR_MACRO(NORM), &N, A, &LDA, &ANORM, RCOND, WORK, IWORK, INFO);
00216 }
00217 //=============================================================================
00218 void Epetra_LAPACK::GESV( const int N, const int NRHS, float * A, const int LDA, int * IPIV, 
00219         float * X, const int LDX, int * INFO) const {
00220   SGESV_F77(&N, &NRHS, A, &LDA, IPIV, X, &LDX, INFO);
00221 }
00222 //=============================================================================
00223 void Epetra_LAPACK::GESV( const int N, const int NRHS, double * A, const int LDA, int * IPIV, 
00224         double * X, const int LDX, int * INFO) const {
00225   DGESV_F77(&N, &NRHS, A, &LDA, IPIV, X, &LDX, INFO);
00226 }
00227 //=============================================================================
00228 void Epetra_LAPACK::GEEQU(const int M, const int N, const float * A, const int LDA, float * R, float * C, 
00229        float * ROWCND, float * COLCND, float * AMAX, int * INFO) const {
00230   SGEEQU_F77(&M, &N, A, &LDA, R, C, ROWCND, COLCND, AMAX, INFO);
00231 }
00232 //=============================================================================
00233 void Epetra_LAPACK::GEEQU(const int M, const int N, const double * A, const int LDA, double * R, double * C,  
00234        double * ROWCND, double * COLCND, double * AMAX, int * INFO) const {
00235   DGEEQU_F77(&M, &N, A, &LDA, R, C, ROWCND, COLCND, AMAX, INFO);
00236 }
00237 //=============================================================================
00238 void Epetra_LAPACK::GERFS(const char TRANS, const int N, const int NRHS, const float * A, const int LDA, const float * AF, const int LDAF, 
00239         const int * IPIV, const float * B, const int LDB, float * X, const int LDX,
00240        float * FERR, float * BERR, float * WORK, int * IWORK, int * INFO) const {
00241   SGERFS_F77(CHAR_MACRO(TRANS), &N, &NRHS, A, &LDA, AF, &LDAF, IPIV, B, &LDB, X, &LDX,
00242     FERR, BERR, WORK, IWORK, INFO);
00243 }
00244 //=============================================================================
00245 void Epetra_LAPACK::GERFS(const char TRANS, const int N, const int NRHS, const double * A, const int LDA, const double * AF, const int LDAF, 
00246        const int * IPIV, const double * B, const int LDB, double * X, const int LDX,
00247        double * FERR, double * BERR, double * WORK, int * IWORK, int * INFO) const {
00248   DGERFS_F77( CHAR_MACRO(TRANS), &N, &NRHS, A, &LDA, AF, &LDAF, IPIV, B, &LDB, X, &LDX,
00249     FERR, BERR, WORK, IWORK, INFO);
00250 }
00251 //=============================================================================
00252 void Epetra_LAPACK::GESVX(const char FACT, const char TRANS, const int N, const int NRHS, float * A, const int LDA, float * AF, const int LDAF, 
00253        int * IPIV, const char EQUED, float * R, float * C, float * B, const int LDB, float * X, const int LDX, float * RCOND, 
00254        float * FERR, float * BERR, float * WORK, int * IWORK, int * INFO) const {
00255   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, 
00256     FERR, BERR, WORK, IWORK, INFO);
00257 }
00258 //=============================================================================
00259 void Epetra_LAPACK::GESVX(const char FACT, const char TRANS, const int N, const int NRHS, double * A, const int LDA, double * AF, const int LDAF, 
00260        int * IPIV, const char EQUED, double * R, double * C, double * B, const int LDB, double * X, const int LDX, double * RCOND, 
00261        double * FERR, double * BERR, double * WORK, int * IWORK, int * INFO) const {
00262  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, 
00263     FERR, BERR, WORK, IWORK, INFO);
00264 }
00265 
00266 
00267 
00268 
00269 //=============================================================================
00270 void Epetra_LAPACK::GEHRD(const int N, const int ILO, const int IHI, float * A, const int LDA, float * TAU, 
00271        float * WORK, const int LWORK, int * INFO) const {
00272   SGEHRD_F77(&N, &ILO, &IHI, A, &LDA, TAU, WORK, &LWORK, INFO);
00273 }
00274 //=============================================================================
00275 void Epetra_LAPACK::GEHRD(const int N, const int ILO, const int IHI, double * A, const int LDA, double * TAU, 
00276        double * WORK, const int LWORK, int * INFO) const {
00277   DGEHRD_F77(&N, &ILO, &IHI, A, &LDA, TAU, WORK, &LWORK, INFO);
00278 }
00279 //=============================================================================
00280 void Epetra_LAPACK::HSEQR( const char JOB, const char COMPZ, const int N, const int ILO, const int IHI, float * H, const int LDH, 
00281         float * WR, float * WI, float * Z, const int LDZ, float * WORK, const int LWORK, 
00282         int * INFO) const {
00283   SHSEQR_F77(CHAR_MACRO(JOB), CHAR_MACRO(COMPZ), &N, &ILO, &IHI, H, &LDH, WR, WI, Z, &LDZ, WORK, &LWORK, INFO);
00284 }
00285 //=============================================================================
00286 void Epetra_LAPACK::HSEQR( const char JOB, const char COMPZ, const int N, const int ILO, const int IHI, double * H, const int LDH, 
00287         double * WR, double * WI, double * Z, const int LDZ, double * WORK, const int LWORK, 
00288         int * INFO) const {
00289   DHSEQR_F77(CHAR_MACRO(JOB), CHAR_MACRO(COMPZ), &N, &ILO, &IHI, H, &LDH, WR, WI, Z, &LDZ, WORK, &LWORK, INFO);
00290 }
00291 //=============================================================================
00292 void Epetra_LAPACK::ORGQR( const int M, const int N, const int K, float * A, const int LDA, float * TAU, 
00293         float * WORK, const int LWORK, int * INFO) const {
00294   SORGQR_F77( &M, &N, &K, A, &LDA, TAU, WORK, &LWORK, INFO);
00295 }
00296 //=============================================================================
00297 void Epetra_LAPACK::ORGQR( const int M, const int N, const int K, double * A, const int LDA, double * TAU, 
00298         double * WORK, const int LWORK, int * INFO) const {
00299   DORGQR_F77( &M, &N, &K, A, &LDA, TAU, WORK, &LWORK, INFO);
00300 }
00301 //=============================================================================
00302 void Epetra_LAPACK::ORGHR( const int N, const int ILO, const int IHI, float * A, const int LDA, float * TAU, 
00303         float * WORK, const int LWORK, int * INFO) const {
00304   SORGHR_F77( &N, &ILO, &IHI, A, &LDA, TAU, WORK, &LWORK, INFO);
00305 }
00306 //=============================================================================
00307 void Epetra_LAPACK::ORGHR( const int N, const int ILO, const int IHI, double * A, const int LDA, double * TAU, 
00308         double * WORK, const int LWORK, int * INFO) const {
00309   DORGHR_F77( &N, &ILO, &IHI, A, &LDA, TAU, WORK, &LWORK, INFO);
00310 }
00311 //=============================================================================
00312 void Epetra_LAPACK::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, 
00313         const float * TAU, float * C, const int LDC, float * WORK, const int LWORK, int * INFO) const {
00314   SORMHR_F77(CHAR_MACRO(SIDE), CHAR_MACRO(TRANS), &M, &N, &ILO, &IHI, A, &LDA, TAU, C, &LDC, WORK, &LWORK, INFO);
00315 }
00316 //=============================================================================
00317 void Epetra_LAPACK::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, 
00318         const double * TAU, double * C, const int LDC, double * WORK, const int LWORK, int * INFO) const {
00319   DORMHR_F77(CHAR_MACRO(SIDE), CHAR_MACRO(TRANS), &M, &N, &ILO, &IHI, A, &LDA, TAU, C, &LDC, WORK, &LWORK, INFO);
00320 }
00321 //=============================================================================
00322 void Epetra_LAPACK::LARFT( const char DIRECT, const char STOREV, const int N, const int K, float * V, const int LDV, float * TAU, float * T, const int LDT) const {
00323   SLARFT_F77(CHAR_MACRO(DIRECT), CHAR_MACRO(STOREV), &N, &K, V, &LDV, TAU, T, &LDT);
00324 }
00325 //=============================================================================
00326 void Epetra_LAPACK::LARFT( const char DIRECT, const char STOREV, const int N, const int K, double * V, const int LDV, double * TAU, double * T, const int LDT) const {
00327   DLARFT_F77(CHAR_MACRO(DIRECT), CHAR_MACRO(STOREV), &N, &K, V, &LDV, TAU, T, &LDT);
00328 }
00329 //=============================================================================
00330 void Epetra_LAPACK::TREVC( const char SIDE, const char HOWMNY, int * SELECT, const int N, const float * T, const int LDT, float *VL, const int LDVL,
00331         float * VR, const int LDVR, const int MM, int * M, float * WORK, int * INFO) const {
00332 
00333   if (HOWMNY=='S') *INFO = -3; // We do not support 'S' since it requires a logical array (yuck!)
00334 
00335   else  STREVC_F77(CHAR_MACRO(SIDE), CHAR_MACRO(HOWMNY), SELECT, &N, T, &LDT, VL, &LDVL, VR, &LDVR, &MM, M, WORK, INFO);
00336 }
00337 //=============================================================================
00338 void Epetra_LAPACK::TREVC( const char SIDE, const char HOWMNY, int * SELECT, const int N, const double * T, const int LDT, double *VL, const int LDVL,
00339         double * VR, const int LDVR, const int MM, int * M, double * WORK, int * INFO) const {
00340 
00341   if (HOWMNY=='S') *INFO = -3; // We do not support 'S' since it requires a logical array (yuck!)
00342 
00343   else  DTREVC_F77(CHAR_MACRO(SIDE), CHAR_MACRO(HOWMNY), SELECT, &N, T, &LDT, VL, &LDVL, VR, &LDVR, &MM, M, WORK, INFO);
00344 }
00345 //=============================================================================
00346 void Epetra_LAPACK::TREXC( const char COMPQ, const int N, float * T, const int LDT, float * Q, const int LDQ, int IFST, int ILST, 
00347         float * WORK, int * INFO) const {
00348   STREXC_F77( CHAR_MACRO(COMPQ), &N, T, &LDT, Q, &LDQ, &IFST, &ILST, WORK, INFO);
00349 }
00350 //=============================================================================
00351 void Epetra_LAPACK::TREXC( const char COMPQ, const int N, double * T, const int LDT, double * Q, const int LDQ, int IFST, int ILST, 
00352         double * WORK, int * INFO) const {
00353   DTREXC_F77( CHAR_MACRO(COMPQ), &N, T, &LDT, Q, &LDQ, &IFST, &ILST, WORK, INFO);
00354 }
00355 //=============================================================================
00356 void Epetra_LAPACK::LAMCH( const char CMACH, float & T) const {
00357   T = SLAMCH_F77( CHAR_MACRO(CMACH));
00358 }
00359 //=============================================================================
00360 void Epetra_LAPACK::LAMCH( const char CMACH, double & T) const {
00361   T = DLAMCH_F77( CHAR_MACRO(CMACH));
00362 }
00363 //=============================================================================
00364 void Epetra_LAPACK::GGSVD(const char JOBU, const char JOBV, const char JOBQ, const int M, const int N, const int P, int * K, int * L,  
00365         double* A,  const int LDA,  double* B,  const int LDB,
00366                           double* ALPHA,  double* BETA,  double* U,  const int LDU, double* V, const int LDV, double* Q, const int LDQ, double* WORK, int* IWORK,
00367                           int* INFO) const {
00368   DGGSVD_F77(CHAR_MACRO(JOBU), CHAR_MACRO(JOBV), CHAR_MACRO(JOBQ), &M, &N, &P, K, L,  A,  &LDA,  B,  &LDB,
00369        ALPHA,  BETA,  U,  &LDU, V, &LDV, Q, &LDQ, WORK, IWORK, INFO);
00370 }
00371   
00372 //=============================================================================
00373 void Epetra_LAPACK::GGSVD(const char JOBU, const char JOBV, const char JOBQ, const int M, const int N, const int P, int * K, int * L,  
00374         float* A,  const int LDA,  float* B,  const int LDB,
00375                           float* ALPHA,  float* BETA,  float* U,  const int LDU, float* V, const int LDV, float* Q, const int LDQ, float* WORK, int* IWORK,
00376                           int* INFO) const {
00377   SGGSVD_F77(CHAR_MACRO(JOBU), CHAR_MACRO(JOBV), CHAR_MACRO(JOBQ), &M, &N, &P, K, L,  A,  &LDA,  B,  &LDB,
00378        ALPHA,  BETA,  U,  &LDU, V, &LDV, Q, &LDQ, WORK, IWORK, INFO);
00379 }
00380   
00381 //=============================================================================
00382 void Epetra_LAPACK::GEEV(const char JOBVL, const char JOBVR, const int N, double* A, const int LDA, double* WR, double* WI, 
00383        double* VL, const int LDVL, double* VR, const int LDVR, double* WORK, const int LWORK, int* INFO) const {
00384 
00385   DGEEV_F77(CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), &N, A, &LDA, WR, WI, VL, &LDVL, VR,  &LDVR,
00386       WORK, &LWORK, INFO);
00387 }
00388 //=============================================================================
00389 void Epetra_LAPACK::GEEV(const char JOBVL, const char JOBVR, const int N, float* A, const int LDA, float* WR, float* WI, 
00390        float* VL, const int LDVL, float* VR, const int LDVR, float* WORK, const int LWORK, int* INFO) const {
00391 
00392   SGEEV_F77(CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), &N, A, &LDA, WR, WI, VL, &LDVL, VR,  &LDVR,
00393       WORK, &LWORK, INFO);
00394 }
00395 //=============================================================================
00396 void Epetra_LAPACK::SPEV(const char JOBZ, const char UPLO, const int N, double* AP, double* W, double* Z, int LDZ, double* WORK, int* INFO) const {
00397 
00398   DSPEV_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &N, AP, W, Z, &LDZ, WORK, INFO);
00399 }
00400 //=============================================================================
00401 void Epetra_LAPACK::SPEV(const char JOBZ, const char UPLO, const int N, float* AP, float* W, float* Z, int LDZ, float* WORK, int* INFO) const {
00402 
00403   SSPEV_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &N, AP, W, Z, &LDZ, WORK, INFO);
00404 }
00405 //=============================================================================
00406 void Epetra_LAPACK::SPGV(const int ITYPE, const char JOBZ, const char UPLO, const int N, double* AP, double* BP, double* W, double* Z, const int LDZ, double* WORK, int* INFO) const {
00407 
00408   DSPGV_F77(&ITYPE, CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &N, AP, BP, W, Z, &LDZ, WORK, INFO);
00409 }
00410 //=============================================================================
00411 void Epetra_LAPACK::SPGV(const int ITYPE, const char JOBZ, const char UPLO, const int N, float* AP, float* BP, float* W, float* Z, const int LDZ, float* WORK, int* INFO) const {
00412 
00413   SSPGV_F77(&ITYPE, CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &N, AP, BP, W, Z, &LDZ, WORK, INFO);
00414 }
00415 //=============================================================================
00416 void Epetra_LAPACK::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{
00417 
00418   DSYEV_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &N, A, &LDA, W, WORK, &LWORK, INFO);
00419 
00420 }
00421 //=============================================================================
00422 void Epetra_LAPACK::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{
00423 
00424   SSYEV_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &N, A, &LDA, W, WORK, &LWORK, INFO);
00425 
00426 }
00427 //=============================================================================
00428 void Epetra_LAPACK::SYEVD(const char JOBZ, const char UPLO,  const int N,  double* A,  const int LDA,  double* W,  double* WORK,  
00429         const int LWORK,  int* IWORK, const int LIWORK, int* INFO) const {
00430 
00431   DSYEVD_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &N, A, &LDA, W, WORK, &LWORK, IWORK, &LIWORK, INFO);
00432 }
00433 //=============================================================================
00434 void Epetra_LAPACK::SYEVD(const char JOBZ, const char UPLO,  const int N,  float* A,  const int LDA,  float* W,  float* WORK,  
00435         const int LWORK,  int* IWORK, const int LIWORK, int* INFO) const {
00436 
00437   SSYEVD_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &N, A, &LDA, W, WORK, &LWORK, IWORK, &LIWORK, INFO);
00438 }
00439 //=============================================================================
00440 void Epetra_LAPACK::SYEVX(const char JOBZ, const char RANGE, const char UPLO,  const int N,  double* A,  const int LDA,  
00441          const double* VL,  const double* VU,  const int* IL,  const int* IU,
00442          const double ABSTOL,  int * M,  double* W,  double* Z,  const int LDZ, double* WORK, 
00443         const int LWORK, int* IWORK, int* IFAIL,
00444         int* INFO) const {
00445 
00446   DSYEVX_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(RANGE), CHAR_MACRO(UPLO), &N,  A,  &LDA,  VL,  VU,  IL,  IU,
00447    &ABSTOL,  M,  W,  Z,  &LDZ, WORK, &LWORK, IWORK, IFAIL, INFO);
00448 }
00449 //=============================================================================
00450 void Epetra_LAPACK::SYEVX(const char JOBZ, const char RANGE, const char UPLO,  const int N,  float* A,  const int LDA,  
00451          const float* VL,  const float* VU,  const int* IL,  const int* IU,
00452          const float ABSTOL,  int * M,  float* W,  float* Z,  const int LDZ, float* WORK, 
00453         const int LWORK, int* IWORK, int* IFAIL,
00454         int* INFO) const {
00455 
00456   SSYEVX_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(RANGE), CHAR_MACRO(UPLO), &N,  A,  &LDA,  VL,  VU,  IL,  IU,
00457    &ABSTOL,  M,  W,  Z,  &LDZ, WORK, &LWORK, IWORK, IFAIL, INFO);
00458 }
00459 //=============================================================================
00460 void Epetra_LAPACK::SYGV(const int ITYPE, const char JOBZ, const char UPLO, const int N, double* A, 
00461        const int LDA, double* B, const int LDB, double* W, double* WORK, const int LWORK, int* INFO) const{
00462 
00463   DSYGV_F77(&ITYPE, CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &N, A, &LDA, B, &LDB, W, WORK, &LWORK, INFO);
00464 }
00465 //=============================================================================
00466 void Epetra_LAPACK::SYGV(const int ITYPE, const char JOBZ, const char UPLO, const int N, float* A, 
00467        const int LDA, float* B, const int LDB, float* W, float* WORK, const int LWORK, int* INFO) const{
00468 
00469   SSYGV_F77(&ITYPE, CHAR_MACRO(JOBZ), CHAR_MACRO(UPLO), &N, A, &LDA, B, &LDB, W, WORK, &LWORK, INFO);
00470 }
00471 //=============================================================================
00472 void Epetra_LAPACK::SYGVX(const int ITYPE, const char JOBZ, const char RANGE, const char UPLO, const int N, 
00473        double* A, const int LDA, double* B, const int LDB, const double* VL, const double* VU,
00474        const int* IL, const int* IU, const double ABSTOL, int* M, double* W, double* Z, 
00475        const int LDZ,  double* WORK,  const int LWORK,  int* IWORK,
00476         int* IFAIL, int* INFO) const {
00477 
00478 #ifdef EPETRA_LAPACK3
00479   DSYGVX_F77(&ITYPE, CHAR_MACRO(JOBZ), CHAR_MACRO(RANGE), CHAR_MACRO(UPLO), &N,  A,  &LDA, B, &LDB, VL, VU,
00480        IL, IU, &ABSTOL, M, W, Z, &LDZ,  WORK,  &LWORK,  IWORK,
00481        IFAIL, INFO);
00482 #else
00483 
00484   Epetra_Object obj;
00485   obj.ReportError("SYGVX requires LAPACK Version 3.  Compile Epetra with -DEPETRA_LAPACK3 and link with LAPACK 3 library", -1);
00486 #endif
00487 }
00488 //=============================================================================
00489 void Epetra_LAPACK::SYGVX(const int ITYPE, const char JOBZ, const char RANGE, const char UPLO, const int N, 
00490        float* A, const int LDA, float* B, const int LDB, const float* VL, const float* VU,
00491        const int* IL, const int* IU, const float ABSTOL, int* M, float* W, float* Z, 
00492        const int LDZ,  float* WORK,  const int LWORK,  int* IWORK,
00493         int* IFAIL, int* INFO) const {
00494 
00495 #ifdef EPETRA_LAPACK3
00496   SSYGVX_F77(&ITYPE, CHAR_MACRO(JOBZ), CHAR_MACRO(RANGE), CHAR_MACRO(UPLO), &N,  A,  &LDA, B, &LDB, VL, VU,
00497                           IL, IU, &ABSTOL, M, W, Z, &LDZ,  WORK,  &LWORK,  IWORK,
00498        IFAIL, INFO);
00499 #else
00500 
00501   Epetra_Object obj;
00502   obj.ReportError("SYGVX requires LAPACK Version 3.  Compile Epetra with -DEPETRA_LAPACK3 and link with LAPACK 3 library", -1);
00503 #endif
00504 }
00505 //=============================================================================
00506 void Epetra_LAPACK::SYEVR(const char JOBZ, const char RANGE, const char UPLO,  const int N,  double* A,  const int LDA,  
00507         const double* VL,  const double* VU,  const int *IL,  const int *IU,
00508                           const double ABSTOL,  int* M,  double* W,  double* Z, const int LDZ, int* ISUPPZ, double* WORK, const int LWORK, int* IWORK,
00509                           const int LIWORK, int* INFO) const { 
00510 
00511 #ifdef EPETRA_LAPACK3
00512   DSYEVR_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(RANGE), CHAR_MACRO(UPLO), &N,  A,  &LDA, VL,  VU,  IL,  IU,
00513        &ABSTOL,  M,  W,  Z, &LDZ, ISUPPZ, WORK, &LWORK, IWORK,
00514        &LIWORK, INFO);
00515 #else
00516   Epetra_Object obj;
00517   obj.ReportError("SYEVR requires LAPACK Version 3.  Compile Epetra with -DEPETRA_LAPACK3 and link with LAPACK 3 library", -1);
00518 #endif
00519 }
00520 //=============================================================================
00521 void Epetra_LAPACK::SYEVR(const char JOBZ, const char RANGE, const char UPLO,  const int N,  float* A,  const int LDA,  
00522         const float* VL,  const float* VU,  const int *IL,  const int *IU,
00523                           const float ABSTOL,  int* M,  float* W,  float* Z, const int LDZ, int* ISUPPZ, float* WORK, const int LWORK, int* IWORK,
00524                           const int LIWORK, int* INFO) const { 
00525 
00526 #ifdef EPETRA_LAPACK3
00527   SSYEVR_F77(CHAR_MACRO(JOBZ), CHAR_MACRO(RANGE), CHAR_MACRO(UPLO), &N,  A,  &LDA, VL,  VU,  IL,  IU,
00528        &ABSTOL,  M,  W,  Z, &LDZ, ISUPPZ, WORK, &LWORK, IWORK,
00529        &LIWORK, INFO);
00530 #else
00531   Epetra_Object obj;
00532   obj.ReportError("SYEVR requires LAPACK Version 3.  Compile Epetra with -DEPETRA_LAPACK3 and link with LAPACK 3 library", -1);
00533 #endif
00534 }
00535 //=============================================================================
00536 void Epetra_LAPACK::GEEVX(const char BALANC, const char JOBVL, const char JOBVR, const char SENSE, const int N, double* A, const int LDA, double* WR, double* WI,  double* VL,
00537        const int LDVL,  double* VR,  const int LDVR,  int* ILO,  int* IHI,  double* SCALE, double* ABNRM, double* RCONDE,
00538         double* RCONDV, double* WORK, const int LWORK, int* IWORK, int* INFO) const{
00539 
00540   DGEEVX_F77(CHAR_MACRO(BALANC), CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), CHAR_MACRO(SENSE), &N, A, &LDA, WR, WI,  VL,
00541        &LDVL,  VR,  &LDVR,  ILO,  IHI,  SCALE, ABNRM, RCONDE,
00542        RCONDV, WORK, &LWORK, IWORK, INFO);
00543 }
00544 //=============================================================================
00545 void Epetra_LAPACK::GEEVX(const char BALANC, const char JOBVL, const char JOBVR, const char SENSE, const int N, float* A, const int LDA, float* WR, float* WI,  float* VL,
00546        const int LDVL,  float* VR,  const int LDVR,  int* ILO,  int* IHI,  float* SCALE, float* ABNRM, float* RCONDE,
00547         float* RCONDV, float* WORK, const int LWORK, int* IWORK, int* INFO) const{
00548 
00549   SGEEVX_F77(CHAR_MACRO(BALANC), CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), CHAR_MACRO(SENSE), &N, A, &LDA, WR, WI,  VL,
00550        &LDVL,  VR,  &LDVR,  ILO,  IHI,  SCALE, ABNRM, RCONDE,
00551        RCONDV, WORK, &LWORK, IWORK, INFO);
00552 }
00553 //=============================================================================
00554 void Epetra_LAPACK::GESDD(const char JOBZ, const int M, const int N, double* A, const int LDA,  double* S,  
00555         double* U,  const int LDU,  double* VT,  const int LDVT,  double* WORK,
00556         const int LWORK, int* IWORK, int* INFO) const{
00557 
00558 #ifdef EPETRA_LAPACK3
00559   DGESDD_F77(CHAR_MACRO(JOBZ), &M, &N, A, &LDA,  S,  U,  &LDU,  VT,  &LDVT,  WORK,
00560        &LWORK, IWORK, INFO);
00561 #else
00562   Epetra_Object obj;
00563   obj.ReportError("GESDD requires LAPACK Version 3.  Compile Epetra with -DEPETRA_LAPACK3 and link with LAPACK 3 library", -1);
00564 #endif
00565 }
00566 //=============================================================================
00567 void Epetra_LAPACK::GESDD(const char JOBZ, const int M, const int N, float* A, const int LDA,  float* S,  
00568         float* U,  const int LDU,  float* VT,  const int LDVT,  float* WORK,
00569         const int LWORK, int* IWORK, int* INFO) const{
00570 
00571 #ifdef EPETRA_LAPACK3
00572   SGESDD_F77(CHAR_MACRO(JOBZ), &M, &N, A, &LDA,  S,  U,  &LDU,  VT,  &LDVT,  WORK,
00573        &LWORK, IWORK, INFO);
00574 #else
00575   Epetra_Object obj;
00576   obj.ReportError("GESDD requires LAPACK Version 3.  Compile Epetra with -DEPETRA_LAPACK3 and link with LAPACK 3 library", -1);
00577 #endif
00578 }
00579 //=============================================================================
00580 void Epetra_LAPACK::GGEV(const char JOBVL,  const char JOBVR,  const int N,  double* A,  
00581        const int LDA,  double* B, const int LDB, double* ALPHAR, double* ALPHAI,
00582        double* BETA, double* VL, const int LDVL, double* VR, const int 
00583        LDVR, double* WORK, const int LWORK, int* INFO) const{
00584 
00585 #ifdef EPETRA_LAPACK3
00586   DGGEV_F77(CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), &N,  A,  &LDA,  B, &LDB, ALPHAR, ALPHAI,
00587       BETA, VL, &LDVL, VR, &LDVR, WORK, &LWORK, INFO);
00588 #else
00589   Epetra_Object obj;
00590   obj.ReportError("GGEV requires LAPACK Version 3.  Compile Epetra with -DEPETRA_LAPACK3 and link with LAPACK 3 library", -1);
00591 #endif
00592 }
00593 //=============================================================================
00594 void Epetra_LAPACK::GGEV(const char JOBVL,  const char JOBVR,  const int N,  float* A,  
00595        const int LDA,  float* B, const int LDB, float* ALPHAR, float* ALPHAI,
00596        float* BETA, float* VL, const int LDVL, float* VR, const int 
00597        LDVR, float* WORK, const int LWORK, int* INFO) const {
00598 
00599 #ifdef EPETRA_LAPACK3
00600   SGGEV_F77(CHAR_MACRO(JOBVL), CHAR_MACRO(JOBVR), &N,  A,  &LDA,  B, &LDB, ALPHAR, ALPHAI,
00601       BETA, VL, &LDVL, VR, &LDVR, WORK, &LWORK, INFO);
00602 #else
00603   Epetra_Object obj;
00604   obj.ReportError("GGEV requires LAPACK Version 3.  Compile Epetra with -DEPETRA_LAPACK3 and link with LAPACK 3 library", -1);
00605 #endif
00606 }
00607 //=============================================================================
00608 void Epetra_LAPACK::GGLSE(const int M, const int N, const int P, double* A, const int LDA, double* B, const int LDB, 
00609         double* C, double* D, double* X, double* WORK, const int LWORK, int* INFO) const{
00610   DGGLSE_F77(&M, &N, &P, A, &LDA, B, &LDB, C, D, X, WORK, &LWORK,  INFO);
00611 }
00612 //=============================================================================
00613 void Epetra_LAPACK::GGLSE(const int M, const int N, const int P, float* A, const int LDA, float* B, const int LDB, 
00614         float* C, float* D, float* X, float* WORK, const int LWORK, int* INFO) const{
00615   SGGLSE_F77(&M, &N, &P, A, &LDA, B, &LDB, C, D, X, WORK, &LWORK,  INFO);
00616 }
00617 //=============================================================================
00618 void Epetra_LAPACK::TRTRS(const char UPLO, const char TRANS, const char DIAG, const int N, const int NRHS, const float *A,
00619                           const int LDA, float *B, const int LDB, int *INFO) const{
00620   STRTRS_F77(CHAR_MACRO(UPLO), CHAR_MACRO(TRANS), CHAR_MACRO(DIAG), &N, &NRHS, A, &LDA, B, &LDB, INFO);
00621 }
00622 //=============================================================================
00623 void Epetra_LAPACK::TRTRS(const char UPLO, const char TRANS, const char DIAG, const int N, const int NRHS, const double *A,
00624                           const int LDA, double *B, const int LDB, int *INFO) const{
00625   DTRTRS_F77(CHAR_MACRO(UPLO), CHAR_MACRO(TRANS), CHAR_MACRO(DIAG), &N, &NRHS, A, &LDA, B, &LDB, INFO);
00626 }
00627 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines