MOOCHO (Single Doxygen Collection) Version of the Day
DenseLinAlgPack_LAPACK_Cpp.hpp
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 // 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 Roscoe A. Bartlett (rabartl@sandia.gov) 
00038 // 
00039 // ***********************************************************************
00040 // @HEADER
00041 
00042 #ifndef LAPACK_CPP_H
00043 #define LAPACK_CPP_H
00044 
00045 #include "DenseLinAlgPack_LAPACK_C_Decl.hpp"
00046 #include "DenseLinAlgPack_BLAS_Cpp.hpp"
00047 
00048 // Cpp Declarations for calling LAPACK functions that
00049 // use function overloading to remove the floating point
00050 // typeds from the names and use enumerations to replace
00051 // the char arguments.
00052 
00053 namespace LAPACK_Cpp {
00054 
00055 typedef FortranTypes::f_int     f_int;
00056 typedef FortranTypes::f_real    f_real;
00057 typedef FortranTypes::f_dbl_prec  f_dbl_prec;
00058 typedef FortranTypes::f_logical   f_logical;
00059 
00060 // xPOTRF
00061 
00062 inline
00064 void potrf(  BLAS_Cpp::Uplo uplo
00065   , const f_int& n, f_dbl_prec* A, const f_int& lda
00066   , f_int* info )
00067 {
00068   LAPACK_C_Decl::dpotrf( BLAS_Cpp::UploChar[uplo]
00069     ,n ,A ,lda ,info );
00070 }
00071 
00072 // xGEQRF
00073 
00074 inline
00076 void geqrf( const f_int& m
00077   , const f_int& n, f_dbl_prec* A, const f_int& lda
00078   , f_dbl_prec* tau, f_dbl_prec* work
00079   , const f_int& lwork, f_int* info  )
00080 {
00081   LAPACK_C_Decl::dgeqrf(m,n,A,lda,tau,work,lwork,info);
00082 }
00083 
00084 // xORMQR
00085 
00086 inline
00088 void ormqr( BLAS_Cpp::Side side, BLAS_Cpp::Transp trans
00089   , const f_int& m, const f_int& n
00090   , const f_int& k, const f_dbl_prec* A, const f_int& lda
00091   , const f_dbl_prec* tau, f_dbl_prec* C, const f_int& ldc
00092   , f_dbl_prec* work, const f_int& lwork, f_int* info )
00093 {
00094   LAPACK_C_Decl::dormqr( BLAS_Cpp::SideChar[side]
00095     , BLAS_Cpp::TransChar[trans], m, n, k, A, lda
00096     , tau, C, ldc, work, lwork, info );
00097   
00098 }
00099 
00100 // xSYTRF
00101 
00102 inline
00103 //
00104 void sytrf( BLAS_Cpp::Uplo uplo, const f_int& n, f_dbl_prec A[]
00105   , const f_int& lda, f_int ipiv[], f_dbl_prec work[], const f_int& lwork
00106   , f_int* info )
00107 {
00108   LAPACK_C_Decl::dsytrf( BLAS_Cpp::UploChar[uplo]
00109     , n, A, lda, ipiv, work, lwork, info );
00110 }
00111 
00112 // xSYTRS
00113 
00114 inline
00116 void sytrs( BLAS_Cpp::Uplo uplo
00117   , const f_int& n, const f_int& nrhs, const f_dbl_prec A[]
00118   , const f_int& lda, const f_int ipiv[], f_dbl_prec B[]
00119   , const f_int& ldb, f_int* info )
00120 {
00121   LAPACK_C_Decl::dsytrs( BLAS_Cpp::UploChar[uplo]
00122     , n, nrhs, A, lda, ipiv, B, ldb, info );
00123 }
00124 
00125 // xGETRF
00126 
00127 inline
00128 //
00129 void getrf(
00130   const f_int& m, const f_int& n, f_dbl_prec A[]
00131   ,const f_int& lda, f_int ipiv[], f_int* info )
00132 {
00133   LAPACK_C_Decl::dgetrf( m, n, A, lda, ipiv, info );
00134 }
00135 
00136 // xGETRS
00137 
00138 inline
00140 void getrs(
00141   BLAS_Cpp::Transp trans
00142   ,const f_int& n, const f_int& nrhs, const f_dbl_prec A[]
00143   , const f_int& lda, const f_int ipiv[], f_dbl_prec B[]
00144   , const f_int& ldb, f_int* info )
00145 {
00146   LAPACK_C_Decl::dgetrs(
00147     BLAS_Cpp::TransChar[trans], n, nrhs, A, lda, ipiv, B, ldb, info
00148     );
00149 }
00150 
00151 } // end namespace LAPACK_Cpp
00152 
00153 #endif  // LAPACK_CPP_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines