DenseLinAlgPack_LAPACK_Cpp.hpp

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 #ifndef LAPACK_CPP_H
00030 #define LAPACK_CPP_H
00031 
00032 #include "DenseLinAlgPack_LAPACK_C_Decl.hpp"
00033 #include "DenseLinAlgPack_BLAS_Cpp.hpp"
00034 
00035 // Cpp Declarations for calling LAPACK functions that
00036 // use function overloading to remove the floating point
00037 // typeds from the names and use enumerations to replace
00038 // the char arguments.
00039 
00040 namespace LAPACK_Cpp {
00041 
00042 typedef FortranTypes::f_int     f_int;
00043 typedef FortranTypes::f_real    f_real;
00044 typedef FortranTypes::f_dbl_prec  f_dbl_prec;
00045 typedef FortranTypes::f_logical   f_logical;
00046 
00047 // xPOTRF
00048 
00049 inline
00051 void potrf(  BLAS_Cpp::Uplo uplo
00052   , const f_int& n, f_dbl_prec* A, const f_int& lda
00053   , f_int* info )
00054 {
00055   LAPACK_C_Decl::dpotrf( BLAS_Cpp::UploChar[uplo]
00056     ,n ,A ,lda ,info );
00057 }
00058 
00059 // xGEQRF
00060 
00061 inline
00063 void geqrf( const f_int& m
00064   , const f_int& n, f_dbl_prec* A, const f_int& lda
00065   , f_dbl_prec* tau, f_dbl_prec* work
00066   , const f_int& lwork, f_int* info  )
00067 {
00068   LAPACK_C_Decl::dgeqrf(m,n,A,lda,tau,work,lwork,info);
00069 }
00070 
00071 // xORMQR
00072 
00073 inline
00075 void ormqr( BLAS_Cpp::Side side, BLAS_Cpp::Transp trans
00076   , const f_int& m, const f_int& n
00077   , const f_int& k, const f_dbl_prec* A, const f_int& lda
00078   , const f_dbl_prec* tau, f_dbl_prec* C, const f_int& ldc
00079   , f_dbl_prec* work, const f_int& lwork, f_int* info )
00080 {
00081   LAPACK_C_Decl::dormqr( BLAS_Cpp::SideChar[side]
00082     , BLAS_Cpp::TransChar[trans], m, n, k, A, lda
00083     , tau, C, ldc, work, lwork, info );
00084   
00085 }
00086 
00087 // xSYTRF
00088 
00089 inline
00090 //
00091 void sytrf( BLAS_Cpp::Uplo uplo, const f_int& n, f_dbl_prec A[]
00092   , const f_int& lda, f_int ipiv[], f_dbl_prec work[], const f_int& lwork
00093   , f_int* info )
00094 {
00095   LAPACK_C_Decl::dsytrf( BLAS_Cpp::UploChar[uplo]
00096     , n, A, lda, ipiv, work, lwork, info );
00097 }
00098 
00099 // xSYTRS
00100 
00101 inline
00103 void sytrs( BLAS_Cpp::Uplo uplo
00104   , const f_int& n, const f_int& nrhs, const f_dbl_prec A[]
00105   , const f_int& lda, const f_int ipiv[], f_dbl_prec B[]
00106   , const f_int& ldb, f_int* info )
00107 {
00108   LAPACK_C_Decl::dsytrs( BLAS_Cpp::UploChar[uplo]
00109     , n, nrhs, A, lda, ipiv, B, ldb, info );
00110 }
00111 
00112 // xGETRF
00113 
00114 inline
00115 //
00116 void getrf(
00117   const f_int& m, const f_int& n, f_dbl_prec A[]
00118   ,const f_int& lda, f_int ipiv[], f_int* info )
00119 {
00120   LAPACK_C_Decl::dgetrf( m, n, A, lda, ipiv, info );
00121 }
00122 
00123 // xGETRS
00124 
00125 inline
00127 void getrs(
00128   BLAS_Cpp::Transp trans
00129   ,const f_int& n, const f_int& nrhs, const f_dbl_prec A[]
00130   , const f_int& lda, const f_int ipiv[], f_dbl_prec B[]
00131   , const f_int& ldb, f_int* info )
00132 {
00133   LAPACK_C_Decl::dgetrs(
00134     BLAS_Cpp::TransChar[trans], n, nrhs, A, lda, ipiv, B, ldb, info
00135     );
00136 }
00137 
00138 } // end namespace LAPACK_Cpp
00139 
00140 #endif  // LAPACK_CPP_H

Generated on Tue Jul 13 09:28:46 2010 for DenseLinAlgPack: Concreate C++ Classes for Dense Blas-Compatible Linear Algebra by  doxygen 1.4.7