DenseLinAlgPack_BLAS_Cpp.cpp

Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
00005 //                  Copyright (2003) 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 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #include "DenseLinAlgPack_BLAS_Cpp.hpp"
00030 
00031 // /////////////////////////////////////
00032 // Fortran function declarations.
00033 
00034 namespace BLAS_C_Decl {
00035 
00036 using namespace std;
00037 typedef FortranTypes::f_int     f_int;
00038 typedef FortranTypes::f_real    f_real;
00039 typedef FortranTypes::f_dbl_prec  f_dbl_prec;
00040 
00041 // function declarations 
00042 // (don't use these directly, use the later overloaded wrappers in namespace BLAS)
00043 extern "C" {
00044 
00045 // ////////////////////////////////////////
00046 // Level 1 BLAS (vector-vector operations)
00047 
00048 // Generate plane rotation
00049 FORTRAN_FUNC_DECL_UL(void,DROTG,drotg)(f_dbl_prec* A, f_dbl_prec* B, f_dbl_prec* C, f_dbl_prec* S);
00050  
00051 // Apply plane rotation
00052 FORTRAN_FUNC_DECL_UL(void,DROT,drot)(const f_int& N, f_dbl_prec* X, const f_int& INCX, f_dbl_prec* Y, const f_int& INCY,
00053       const f_dbl_prec& C, const f_dbl_prec& S);
00054 
00055 // Interchange vectors
00056 FORTRAN_FUNC_DECL_UL(void,DSWAP,dswap)(const f_int& N, f_dbl_prec* X, const f_int& INCX, f_dbl_prec* Y, const f_int& INCY);
00057 
00058 // DVector scaling
00059 FORTRAN_FUNC_DECL_UL(void,DSCAL,dscal)(const f_int& N, const f_dbl_prec& ALPHA, f_dbl_prec* X, const f_int& INCX);
00060 
00061 // DVector copy 
00062 FORTRAN_FUNC_DECL_UL(void,DCOPY,dcopy)(const f_int& N, const f_dbl_prec* X, const f_int& INCX, f_dbl_prec* Y, const f_int& INCY);
00063 
00064 // y = a*x + y
00065 FORTRAN_FUNC_DECL_UL(void,DAXPY,daxpy)(const f_int& N, const f_dbl_prec& A, const f_dbl_prec* X, const f_int& INCX, f_dbl_prec* Y,
00066        const f_int& INCY);
00067 
00068 // Dot product
00069 FORTRAN_FUNC_DECL_UL(f_dbl_prec,DDOT,ddot)(const f_int& N, const f_dbl_prec* X, const f_int& INCX, const f_dbl_prec* Y, const f_int& INCY);
00070 FORTRAN_FUNC_DECL_UL(f_dbl_prec,DSDOT,dsdot)(const f_int& N, const f_real* X, const f_int& INCX, const f_real* Y, const f_int& INCY);
00071 
00072 // 2-Norm
00073 FORTRAN_FUNC_DECL_UL(f_dbl_prec,DNRM2,dnrm2)(const f_int& N, const f_dbl_prec* X, const f_int& INCX);
00074 
00075 // Sum of magnitudes
00076 FORTRAN_FUNC_DECL_UL(f_dbl_prec,DASUM,dasum)(const f_int& N, const f_dbl_prec* X, const f_int& INCX);
00077 
00078 // Largest component of vector
00079 FORTRAN_FUNC_DECL_UL(f_dbl_prec,IDAMAX,idamax)(const f_int& N, const f_dbl_prec* X, const f_int& INCX);
00080 
00081 // ////////////////////////////////////////
00082 // Level 2 BLAS (matrix-vector operations)
00083 
00084 // General rectangular matrix-vector products
00085 FORTRAN_FUNC_DECL_UL(void,DGEMV,dgemv)(FORTRAN_CONST_CHAR_1_ARG(TRANSA)
00086   , const f_int& M, const f_int& N, const f_dbl_prec& ALPHA
00087   , const f_dbl_prec* A, const f_int& LDA, const f_dbl_prec* X, const f_int& INCX
00088   , const f_dbl_prec& BETA, f_dbl_prec* Y, const f_int& INCY
00089   );
00090 
00091 // General band matrix-vector products
00092 FORTRAN_FUNC_DECL_UL(void,DGBMV,dgbmv)(FORTRAN_CONST_CHAR_1_ARG(TRANSA)
00093   , const f_int& M, const f_int& N, const f_int& KL, const f_int& KU
00094   , const f_dbl_prec& ALPHA,  const f_dbl_prec* A, const f_int& LDA, const f_dbl_prec* X
00095   , const f_int& INCX, const f_dbl_prec& BETA, f_dbl_prec* Y, const f_int& INCY
00096   );
00097 
00098 // Hermitian matrix-vector products
00099 
00100 // Hermitian band matrix-vector products
00101 
00102 // Hermitian packed matrix-vector products
00103 
00104 // Symmetric matrix-vector products
00105 FORTRAN_FUNC_DECL_UL(void,DSYMV,dsymv)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00106   , const f_int& N
00107   , const f_dbl_prec& ALPHA, const f_dbl_prec* A, const f_int& LDA
00108   , const f_dbl_prec* X, const f_int& INCX, const f_dbl_prec& BETA
00109   , f_dbl_prec* Y, const f_int& INCY
00110   );
00111 
00112 // Symmetric band matrix-vector products
00113 FORTRAN_FUNC_DECL_UL(void,DSBMV,dsbmv)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00114   , const f_int& N, const f_int& K
00115   , const f_dbl_prec& ALPHA, const f_dbl_prec* A, const f_int& LDA
00116   , const f_dbl_prec* X, const f_int& INCX, const f_dbl_prec& BETA
00117   , f_dbl_prec* Y, const f_int& INCY
00118   );
00119 
00120 // Symmetric packed matrix-vector products
00121 FORTRAN_FUNC_DECL_UL(void,DSPMV,dspmv)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00122   , const f_int& N
00123   , const f_dbl_prec& ALPHA, const f_dbl_prec* AP
00124   , const f_dbl_prec* X, const f_int& INCX, const f_dbl_prec& BETA
00125   , f_dbl_prec* Y, const f_int& INCY
00126   );
00127 
00128 // Triangular matrix-vector products
00129 FORTRAN_FUNC_DECL_UL(void,DTRMV,dtrmv)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00130   , FORTRAN_CONST_CHAR_1_ARG(TRANS), FORTRAN_CONST_CHAR_1_ARG(DIAG), const f_int& N
00131   , const f_dbl_prec* A, const f_int& LDA, f_dbl_prec* X, const f_int& INCX);
00132 
00133 // Triangular band matrix-vector products
00134 FORTRAN_FUNC_DECL_UL(void,DTBMV,dtbmv)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00135   , FORTRAN_CONST_CHAR_1_ARG(TRANS), FORTRAN_CONST_CHAR_1_ARG(DIAG)
00136   , const f_int& N, const f_int& K
00137   , const f_dbl_prec* A, const f_int& LDA, f_dbl_prec* X, const f_int& INCX);
00138 
00139 // Triangular packed matrix-vector products
00140 FORTRAN_FUNC_DECL_UL(void,DTPMV,dtpmv)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00141   , FORTRAN_CONST_CHAR_1_ARG(TRANS), FORTRAN_CONST_CHAR_1_ARG(DIAG), const f_int& N
00142   , const f_dbl_prec* AP, f_dbl_prec* X, const f_int& INCX);
00143 
00144 // Triangular equation solve
00145 FORTRAN_FUNC_DECL_UL(void,DTRSV,dtrsv)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00146   , FORTRAN_CONST_CHAR_1_ARG(TRANS), FORTRAN_CONST_CHAR_1_ARG(DIAG), const f_int& N
00147   , const f_dbl_prec* A, const f_int& LDA, f_dbl_prec* X, const f_int& INCX);
00148 
00149 // Triangular band equation solve
00150 FORTRAN_FUNC_DECL_UL(void,DTBSV,dtbsv)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00151   , FORTRAN_CONST_CHAR_1_ARG(TRANS), FORTRAN_CONST_CHAR_1_ARG(DIAG), const f_int& N
00152   , const f_int& K
00153   , const f_dbl_prec* A, const f_int& LDA, f_dbl_prec* X, const f_int& INCX);
00154 
00155 // Triangular packed equation solve
00156 FORTRAN_FUNC_DECL_UL(void,DTPSV,dtpsv)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00157   , FORTRAN_CONST_CHAR_1_ARG(TRANS), FORTRAN_CONST_CHAR_1_ARG(DIAG), const f_int& N
00158   , const f_dbl_prec* AP, f_dbl_prec* X, const f_int& INCX);
00159 
00160 // General rank-1 update
00161 FORTRAN_FUNC_DECL_UL(void,DGER,dger)(const f_int& M, const f_int& N, const f_dbl_prec& ALPHA, const f_dbl_prec* X, const f_int& INCX,
00162       const f_dbl_prec* Y, const f_int& INCY, f_dbl_prec* A, const f_int& LDA);
00163 
00164 // Hermitian rank-1 update
00165 
00166 // Hermitian packed rank-1 update
00167 
00168 // Hermitian rank-2 update
00169 
00170 // Hermitian packed rank-2 update
00171 
00172 // Symmetric rank-1 update
00173 FORTRAN_FUNC_DECL_UL(void,DSYR,dsyr)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00174   , const f_int& N, const f_dbl_prec& ALPHA, const f_dbl_prec* X, const f_int& INCX
00175   , f_dbl_prec* A, const f_int& LDA);
00176 
00177 // Symmetric packed rank-1 update
00178 FORTRAN_FUNC_DECL_UL(void,DSPR,dspr)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00179   , const f_int& N, const f_dbl_prec& ALPHA, const f_dbl_prec* X, const f_int& INCX
00180   , f_dbl_prec* AP);
00181 
00182 // Symmetric rank-2 update
00183 FORTRAN_FUNC_DECL_UL(void,DSYR2,dsyr2)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00184   , const f_int& N, const f_dbl_prec& ALPHA, const f_dbl_prec* X, const f_int& INCX
00185   , const f_dbl_prec* Y, const f_int& INCY, f_dbl_prec* A, const f_int& LDA);
00186 
00187 // Symmetric packed rank-2 update
00188 FORTRAN_FUNC_DECL_UL(void,DSPR2,dspr2)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00189   , const f_int& N, const f_dbl_prec& ALPHA, const f_dbl_prec* X, const f_int& INCX
00190   , const f_dbl_prec* Y, const f_int& INCY, f_dbl_prec* AP);
00191 
00192 // ////////////////////////////////////////
00193 // Level 3 BLAS (matrix-matrix operations)
00194 
00195 // General rectangular matrix-matrix product
00196 FORTRAN_FUNC_DECL_UL(void,DGEMM,dgemm)(FORTRAN_CONST_CHAR_1_ARG(TRANSA)
00197   , FORTRAN_CONST_CHAR_1_ARG(TRANSB), const f_int& M, const f_int& N, const f_int& K
00198   , const f_dbl_prec& ALPHA, const f_dbl_prec* A, const f_int& LDA, const f_dbl_prec* B
00199   , const f_int& LDB, const f_dbl_prec& BETA, f_dbl_prec* C, const f_int& LDC);
00200 
00201 // Symmetric matrix-matrix product
00202 FORTRAN_FUNC_DECL_UL(void,DSYMM,dsymm)(FORTRAN_CONST_CHAR_1_ARG(SIDE)
00203   , FORTRAN_CONST_CHAR_1_ARG(UPLO), const f_int& M, const f_int& N
00204   , const f_dbl_prec& ALPHA, const f_dbl_prec* A, const f_int& LDA, const f_dbl_prec* B
00205   , const f_int& LDB, const f_dbl_prec& BETA, f_dbl_prec* C, const f_int& LDC);
00206 
00207 // Hermitian matrix-matrix product
00208 
00209 // Symmetric rank-k update
00210 FORTRAN_FUNC_DECL_UL(void,DSYRK,dsyrk)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00211   , FORTRAN_CONST_CHAR_1_ARG(TRANS), const f_int& N, const f_int& K
00212   , const f_dbl_prec& ALPHA, const f_dbl_prec* A, const f_int& LDA
00213   , const f_dbl_prec& BETA, f_dbl_prec* C, const f_int& LDC);
00214 
00215 // Hermitian rank-k update
00216 
00217 // Symmetric rank-2k update
00218 FORTRAN_FUNC_DECL_UL(void,DSYR2K,dsyr2k)(FORTRAN_CONST_CHAR_1_ARG(UPLO)
00219   , FORTRAN_CONST_CHAR_1_ARG(TRANS), const f_int& N, const f_int& K
00220   , const f_dbl_prec& ALPHA, const f_dbl_prec* A, const f_int& LDA, const f_dbl_prec* B
00221   , const f_int& LDB, const f_dbl_prec& BETA, f_dbl_prec* C, const f_int& LDC);
00222 
00223 // Hermitian rank-2k update
00224 
00225 // Triangular matrix-matrix product
00226 FORTRAN_FUNC_DECL_UL(void,DTRMM,dtrmm)(FORTRAN_CONST_CHAR_1_ARG(SIDE)
00227   , FORTRAN_CONST_CHAR_1_ARG(UPLO), FORTRAN_CONST_CHAR_1_ARG(TRANSA)
00228   , FORTRAN_CONST_CHAR_1_ARG(DIAG)
00229   , const f_int& M, const f_int& N, const f_dbl_prec& ALPHA, const f_dbl_prec* A
00230   , const f_int& LDA, f_dbl_prec* B, const f_int& LDB);
00231 
00232 // Solution of triangular system 
00233 FORTRAN_FUNC_DECL_UL(void,DTRSM,dtrsm)(FORTRAN_CONST_CHAR_1_ARG(SIDE)
00234   , FORTRAN_CONST_CHAR_1_ARG(UPLO), FORTRAN_CONST_CHAR_1_ARG(TRANSA)
00235   , FORTRAN_CONST_CHAR_1_ARG(DIAG)
00236   , const f_int& M, const f_int& N, const f_dbl_prec& ALPHA
00237   , const f_dbl_prec* A, const f_int& LDA, f_dbl_prec* B, const f_int& LDB);
00238 
00239 } // end extern "C"
00240 
00241 } // end namespace BLAS_C_Decl
00242 
00243 // ////////////////////////////////////////////////////////
00244 // C++ BLAS Function Declarations
00245 
00246 // Level 1 BLAS (vector-vector operations)
00247 
00248 void BLAS_Cpp::rotg(f_dbl_prec* a, f_dbl_prec* b, f_dbl_prec* c, f_dbl_prec* s) {
00249   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DROTG,drotg)(a,b,c,s);
00250 }
00251  
00252 // Apply plane rotation
00253 
00254 void BLAS_Cpp::rot(const f_int& N, f_dbl_prec* X, const f_int& INCX, f_dbl_prec* Y, const f_int& INCY
00255   , const f_dbl_prec& C, const f_dbl_prec& S)
00256 {
00257   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DROT,drot)(N, X, INCX, Y, INCY, C, S);
00258 }
00259 
00260 // Interchange vectors
00261 
00262 void BLAS_Cpp::swap(const f_int& N, f_dbl_prec* X, const f_int& INCX, f_dbl_prec* Y, const f_int& INCY)
00263 {
00264   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DSWAP,dswap)(N, X, INCX, Y, INCY);
00265 }     
00266 
00267 // DVector scaling
00268 
00269 void BLAS_Cpp::scal(const f_int& N, const f_dbl_prec& ALPHA, f_dbl_prec* X, const f_int& INCX)
00270 {
00271   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DSCAL,dscal)(N, ALPHA, X, INCX);
00272 }
00273 
00274 // DVector copy
00275 
00276 void BLAS_Cpp::copy(const f_int& N, const f_dbl_prec* X, const f_int& INCX, f_dbl_prec* Y, const f_int& INCY)
00277 {
00278   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DCOPY,dcopy)(N, X, INCX, Y, INCY);
00279 }
00280 
00281 // y = a*x + y
00282 
00283 void BLAS_Cpp::axpy(const f_int& N, const f_dbl_prec& A, const f_dbl_prec* X, const f_int& INCX, f_dbl_prec* Y
00284   , const f_int& INCY)
00285 {
00286   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DAXPY,daxpy)(N, A, X, INCX, Y, INCY);
00287 }
00288 
00289 // Dot product
00290 
00291 BLAS_Cpp::f_dbl_prec BLAS_Cpp::dot(const f_int& N, const f_dbl_prec* X, const f_int& INCX, const f_dbl_prec* Y, const f_int& INCY)
00292 {
00293   return BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DDOT,ddot)(N, X, INCX, Y, INCY);
00294 }
00295 
00296 // 2-Norm
00297 
00298 BLAS_Cpp::f_dbl_prec BLAS_Cpp::nrm2(const f_int& N, const f_dbl_prec* X, const f_int& INCX)
00299 {
00300   return BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DNRM2,dnrm2)(N, X, INCX);
00301 }
00302 
00303 // 1-Norm
00304 
00305 BLAS_Cpp::f_dbl_prec BLAS_Cpp::asum(const f_int& N, const f_dbl_prec* X, const f_int& INCX)
00306 {
00307   return BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DASUM,dasum)(N, X, INCX);
00308 }
00309 
00310 // Inifinity-Norm
00311 
00312 BLAS_Cpp::f_dbl_prec BLAS_Cpp::iamax(const f_int& N, const f_dbl_prec* X, const f_int& INCX)
00313 {
00314   return BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(IDAMAX,idamax)(N, X, INCX);
00315 }
00316 
00317 // Level-2 BLAS (matrix-vector operations)
00318 
00319 // General rectangular matrix-vector products
00320 
00321 void BLAS_Cpp::gemv(Transp transa, f_int m, f_int n, f_dbl_prec alpha, const f_dbl_prec* pa
00322   , f_int lda, const f_dbl_prec* x, f_int incx, f_dbl_prec beta, f_dbl_prec* py, f_int incy)
00323 {
00324   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DGEMV,dgemv)(FORTRAN_CHAR_1_ARG_CALL(TransChar[transa]), m, n, alpha, pa, lda, x, incx, beta, py, incy);
00325 }
00326 
00327 // General band matrix-vector products
00328 
00329 void BLAS_Cpp::gbmv(Transp transa, f_int m, f_int n, f_int kl, f_int ku, f_dbl_prec alpha, const f_dbl_prec* pa
00330   , f_int lda, const f_dbl_prec* x, f_int incx, f_dbl_prec beta, f_dbl_prec* py, f_int incy)
00331 {
00332   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DGBMV,dgbmv)(FORTRAN_CHAR_1_ARG_CALL(TransChar[transa]), m, n, kl, ku, alpha, pa, lda, x, incx, beta, py, incy);
00333 }
00334          
00335 // Hermitian matrix-vector products
00336 
00337 // Hermitian band matrix-vector products
00338 
00339 // Hermitian packed matrix-vector products
00340 
00341 // Symmetric matrix-vector products
00342 
00343 void BLAS_Cpp::symv(Uplo uplo, f_int n, f_dbl_prec alpha, const f_dbl_prec* pa
00344   , f_int lda, const f_dbl_prec* x, f_int incx, f_dbl_prec beta, f_dbl_prec* py, f_int incy)
00345 {
00346   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DSYMV,dsymv)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo]), n, alpha, pa, lda, x, incx, beta, py, incy);
00347 }
00348       
00349 // Symmetric band matrix-vector products
00350 
00351 void BLAS_Cpp::sbmv(Uplo uplo, f_int n, f_int k, f_dbl_prec alpha, const f_dbl_prec* pa
00352   , f_int lda, const f_dbl_prec* x, f_int incx, f_dbl_prec beta, f_dbl_prec* py, f_int incy)
00353 {
00354   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DSBMV,dsbmv)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo]), n, k, alpha, pa, lda, x, incx, beta, py, incy);
00355 }
00356 
00357 // Symmetric packed matrix-vector products
00358 
00359 void BLAS_Cpp::spmv(Uplo uplo, f_int n, f_dbl_prec alpha, const f_dbl_prec* pap
00360   , const f_dbl_prec* x, f_int incx, f_dbl_prec beta, f_dbl_prec* py, f_int incy)
00361 {
00362   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DSPMV,dspmv)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo]), n, alpha, pap, x, incx, beta, py, incy);
00363 }
00364 
00365 // Triangular matrix-vector products
00366 
00367 void BLAS_Cpp::trmv(Uplo uplo, Transp trans, Diag diag, f_int n, const f_dbl_prec* pa
00368   , f_int lda, f_dbl_prec* px, f_int incx)
00369 {
00370   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DTRMV,dtrmv)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo])
00371     ,FORTRAN_CHAR_1_ARG_CALL(TransChar[trans]),FORTRAN_CHAR_1_ARG_CALL(DiagChar[diag])
00372     ,n, pa, lda, px, incx);
00373 }
00374 
00375 // Triangular band matrix-vector products
00376 
00377 void BLAS_Cpp::tbmv(Uplo uplo, Transp trans, Diag diag, f_int n, f_int k, const f_dbl_prec* pa
00378   , f_int lda, f_dbl_prec* px, f_int incx)
00379 {
00380   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DTBMV,dtbmv)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo])
00381     ,FORTRAN_CHAR_1_ARG_CALL(TransChar[trans]), FORTRAN_CHAR_1_ARG_CALL(DiagChar[diag])
00382     ,n, k, pa, lda, px, incx);
00383 }
00384 
00385 // Triangular packed matrix-vector products
00386 
00387 void BLAS_Cpp::tpmv(Uplo uplo, Transp trans, Diag diag, f_int n, const f_dbl_prec* pap
00388   , f_dbl_prec* px, f_int incx)
00389 {
00390   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DTPMV,dtpmv)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo])
00391     ,FORTRAN_CHAR_1_ARG_CALL(TransChar[trans]), FORTRAN_CHAR_1_ARG_CALL(DiagChar[diag])
00392     ,n, pap, px, incx);
00393 }
00394 
00395 // Triangular equation solve
00396 
00397 void BLAS_Cpp::trsv(Uplo uplo, Transp trans, Diag diag, f_int n, const f_dbl_prec* pa
00398   , f_int lda, f_dbl_prec* px, f_int incx)
00399 {
00400   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DTRSV,dtrsv)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo])
00401     ,FORTRAN_CHAR_1_ARG_CALL(TransChar[trans]), FORTRAN_CHAR_1_ARG_CALL(DiagChar[diag])
00402     ,n, pa, lda, px, incx);
00403 }
00404 
00405 // Triangular band equation solve
00406 
00407 void BLAS_Cpp::tbsv(Uplo uplo, Transp trans, Diag diag, f_int n, f_int k, const f_dbl_prec* pa
00408   , f_int lda, f_dbl_prec* px, f_int incx)
00409 {
00410   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DTBSV,dtbsv)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo])
00411     ,FORTRAN_CHAR_1_ARG_CALL(TransChar[trans]), FORTRAN_CHAR_1_ARG_CALL(DiagChar[diag])
00412     ,n, k, pa, lda, px, incx);
00413 }
00414 
00415 // Triangular packed equation solve
00416 
00417 void BLAS_Cpp::tpsv(Uplo uplo, Transp trans, Diag diag, f_int n, const f_dbl_prec* pap
00418   , f_dbl_prec* px, f_int incx)
00419 {
00420   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DTPSV,dtpsv)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo])
00421     ,FORTRAN_CHAR_1_ARG_CALL(TransChar[trans]), FORTRAN_CHAR_1_ARG_CALL(DiagChar[diag])
00422     ,n, pap, px, incx);
00423 }
00424 
00425 // General rank-1 update
00426 
00427 void BLAS_Cpp::ger(f_int m, f_int n, f_dbl_prec alpha, const f_dbl_prec* px
00428   , f_int incx, const f_dbl_prec* py, f_int incy, f_dbl_prec* pa, f_int lda)
00429 {
00430   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DGER,dger)(m, n, alpha, px, incx, py, incy, pa, lda);
00431 }
00432 
00433 // Hermitian rank-1 update
00434 
00435 // Hermitian packed rank-1 update
00436 
00437 // Hermitian rank-2 update
00438 
00439 // Hermitian packed rank-2 update
00440 
00441 // Symmetric rank-1 update
00442 
00443 void BLAS_Cpp::syr(Uplo uplo, f_int n, f_dbl_prec alpha, const f_dbl_prec* px
00444   , f_int incx, f_dbl_prec* pa, f_int lda)
00445 {
00446   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DSYR,dsyr)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo]), n, alpha, px, incx, pa, lda);
00447 }
00448 
00449 // Symmetric packed rank-1 update
00450 
00451 void BLAS_Cpp::spr(Uplo uplo, f_int n, f_dbl_prec alpha, const f_dbl_prec* px
00452   , f_int incx, f_dbl_prec* pap)
00453 {
00454   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DSPR,dspr)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo]), n, alpha, px, incx, pap);
00455 }
00456 
00457 // Symmetric rank-2 update
00458 
00459 void BLAS_Cpp::syr2(Uplo uplo, f_int n, f_dbl_prec alpha, const f_dbl_prec* px
00460   , f_int incx, const f_dbl_prec* py, f_int incy, f_dbl_prec* pa, f_int lda)
00461 {
00462   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DSYR2,dsyr2)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo]), n, alpha, px, incx, py, incy, pa, lda);
00463 }
00464 
00465 // Symmetric packed rank-2 update
00466 
00467 void BLAS_Cpp::spr2(Uplo uplo, f_int n, f_dbl_prec alpha, const f_dbl_prec* px
00468   , f_int incx, const f_dbl_prec* py, f_int incy, f_dbl_prec* pap)
00469 {
00470   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DSPR2,dspr2)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo]), n, alpha, px, incx, py, incy, pap);
00471 }
00472 
00473 // Level 3 BLAS (matrix-matrix operations)  
00474 
00475 // General rectangular matrix-matrix product
00476 
00477 void BLAS_Cpp::gemm(Transp transa, Transp transb, f_int m, f_int n, f_int k, f_dbl_prec alpha, const f_dbl_prec* pa
00478   , f_int lda, const f_dbl_prec* pb, f_int ldb, f_dbl_prec beta, f_dbl_prec* pc, f_int ldc)
00479 {
00480   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DGEMM,dgemm)(FORTRAN_CHAR_1_ARG_CALL(TransChar[transa])
00481     ,FORTRAN_CHAR_1_ARG_CALL(TransChar[transb]), m, n, k, alpha, pa, lda, pb, ldb
00482     , beta, pc, ldc);
00483 }
00484 
00485 // Symmetric matrix-matrix product
00486 
00487 void BLAS_Cpp::symm(Side side, Uplo uplo, f_int m, f_int n, f_dbl_prec alpha, const f_dbl_prec* pa
00488   , f_int lda, const f_dbl_prec* pb, f_int ldb, f_dbl_prec beta, f_dbl_prec* pc, f_int ldc)
00489 {
00490   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DSYMM,dsymm)(FORTRAN_CHAR_1_ARG_CALL(SideChar[side]), FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo]), m, n, alpha, pa, lda, pb, ldb, beta, pc, ldc);
00491 }
00492 
00493 // Hermitian matrix-matrix product
00494 
00495 // Symmetric rank-k update
00496 
00497 void BLAS_Cpp::syrk(Uplo uplo, Transp trans, f_int n, f_int k, f_dbl_prec alpha, const f_dbl_prec* pa
00498   , f_int lda, f_dbl_prec beta, f_dbl_prec* pc, f_int ldc)
00499 {
00500   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DSYRK,dsyrk)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo])
00501     ,FORTRAN_CHAR_1_ARG_CALL(TransChar[trans]), n, k, alpha, pa, lda, beta, pc, ldc);
00502 }
00503 
00504 // Hermitian rank-k update
00505 
00506 // Symmetric rank-2k update
00507 
00508 void BLAS_Cpp::syr2k(Uplo uplo, Transp trans, f_int n, f_int k, f_dbl_prec alpha, const f_dbl_prec* pa
00509   , f_int lda, const f_dbl_prec* pb, f_int ldb, f_dbl_prec beta, f_dbl_prec* pc, f_int ldc)
00510 {
00511   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DSYR2K,dsyr2k)(FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo])
00512     ,FORTRAN_CHAR_1_ARG_CALL(TransChar[trans]), n, k, alpha, pa, lda, pb, ldb
00513     ,beta, pc, ldc);
00514 }
00515 
00516 // Hermitian rank-2k update
00517 
00518 // Triangular matrix-matrix product
00519 
00520 void BLAS_Cpp::trmm(Side side, Uplo uplo, Transp transa, Diag diag, f_int m, f_int n, f_dbl_prec alpha
00521   , const f_dbl_prec* pa, f_int lda, f_dbl_prec* pb, f_int ldb)
00522 {
00523   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DTRMM,dtrmm)(FORTRAN_CHAR_1_ARG_CALL(SideChar[side])
00524     ,FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo]), FORTRAN_CHAR_1_ARG_CALL(TransChar[transa])
00525     ,FORTRAN_CHAR_1_ARG_CALL(DiagChar[diag]), m, n, alpha, pa, lda, pb, ldb);
00526 }
00527 
00528 // Solution of triangular system
00529 
00530 void BLAS_Cpp::trsm(Side side, Uplo uplo, Transp transa, Diag diag, f_int m, f_int n, f_dbl_prec alpha
00531   , const f_dbl_prec* pa, f_int lda, f_dbl_prec* pb, f_int ldb)
00532 {
00533   BLAS_C_Decl::FORTRAN_FUNC_CALL_UL(DTRSM,dtrsm)(FORTRAN_CHAR_1_ARG_CALL(SideChar[side])
00534     ,FORTRAN_CHAR_1_ARG_CALL(UploChar[uplo]), FORTRAN_CHAR_1_ARG_CALL(TransChar[transa])
00535     ,FORTRAN_CHAR_1_ARG_CALL(DiagChar[diag]), m, n, alpha, pa, lda, pb, ldb);
00536 }

Generated on Thu Sep 18 12:35:15 2008 for MOOCHO (Single Doxygen Collection) by doxygen 1.3.9.1