|
DenseLinAlgPack: Concreate C++ Classes for Dense Blas-Compatible Linear Algebra
Version of the Day
|
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 #include "DenseLinAlgPack_LAPACK_C_Decl.hpp" 00043 00044 // DPOTRF 00045 00046 extern "C" { 00047 FORTRAN_FUNC_DECL_UL( void, DPOTRF, dpotrf ) ( FORTRAN_CONST_CHAR_1_ARG(UPLO) 00048 , const LAPACK_C_Decl::f_int& N, LAPACK_C_Decl::f_dbl_prec* A 00049 , const LAPACK_C_Decl::f_int& LDA, LAPACK_C_Decl::f_int* INFO ); 00050 } 00051 00052 void LAPACK_C_Decl::dpotrf( const f_char& UPLO 00053 , const f_int& N, f_dbl_prec* A, const f_int& LDA 00054 , f_int* INFO ) 00055 { 00056 ::FORTRAN_FUNC_CALL_UL(DPOTRF,dpotrf) (FORTRAN_CHAR_1_ARG_CALL(UPLO),N,A,LDA,INFO); 00057 } 00058 00059 // DGEQRF 00060 00061 extern "C" { 00062 FORTRAN_FUNC_DECL_UL( void, DGEQRF, dgeqrf ) ( 00063 const LAPACK_C_Decl::f_int& M, const LAPACK_C_Decl::f_int& N 00064 , LAPACK_C_Decl::f_dbl_prec* A, const LAPACK_C_Decl::f_int& LDA 00065 , LAPACK_C_Decl::f_dbl_prec* TAU, LAPACK_C_Decl::f_dbl_prec* WORK 00066 , const LAPACK_C_Decl::f_int& LWORK, LAPACK_C_Decl::f_int* INFO ); 00067 } 00068 00069 void LAPACK_C_Decl::dgeqrf( const f_int& M 00070 , const f_int& N, f_dbl_prec* A, const f_int& LDA 00071 , f_dbl_prec* TAU, f_dbl_prec* WORK 00072 , const f_int& LWORK, f_int* INFO ) 00073 { 00074 ::FORTRAN_FUNC_CALL_UL(DGEQRF,dgeqrf) (M,N,A,LDA,TAU,WORK,LWORK,INFO); 00075 } 00076 00077 // DORMRQ 00078 00079 extern "C" { 00080 FORTRAN_FUNC_DECL_UL( void, DORMQR, dormqr ) ( FORTRAN_CONST_CHAR_1_ARG(SIDE) 00081 , FORTRAN_CONST_CHAR_1_ARG(TRANS) 00082 , const LAPACK_C_Decl::f_int& M, const LAPACK_C_Decl::f_int& N 00083 , const LAPACK_C_Decl::f_int& K, const LAPACK_C_Decl::f_dbl_prec* A 00084 , const LAPACK_C_Decl::f_int& LDA, const LAPACK_C_Decl::f_dbl_prec* TAU 00085 , LAPACK_C_Decl::f_dbl_prec* C, const LAPACK_C_Decl::f_int& LDC 00086 , LAPACK_C_Decl::f_dbl_prec* WORK, const LAPACK_C_Decl::f_int& LWORK 00087 , LAPACK_C_Decl::f_int* INFO ); 00088 } 00089 00090 void LAPACK_C_Decl::dormqr( const f_char& SIDE 00091 , const f_char& TRANS, const f_int& M, const f_int& N 00092 , const f_int& K, const f_dbl_prec* A, const f_int& LDA 00093 , const f_dbl_prec* TAU, f_dbl_prec* C, const f_int& LDC 00094 , f_dbl_prec* WORK, const f_int& LWORK, f_int* INFO ) 00095 { 00096 ::FORTRAN_FUNC_CALL_UL(DORMQR,dormqr)(FORTRAN_CHAR_1_ARG_CALL(SIDE) 00097 ,FORTRAN_CHAR_1_ARG_CALL(TRANS),M,N,K,A,LDA,TAU,C,LDC,WORK,LWORK,INFO); 00098 } 00099 00100 // DSYTRF 00101 00102 extern "C" { 00103 FORTRAN_FUNC_DECL_UL( void, DSYTRF, dsytrf ) ( FORTRAN_CONST_CHAR_1_ARG(UPLO) 00104 , const LAPACK_C_Decl::f_int& N, LAPACK_C_Decl::f_dbl_prec A[] 00105 , const LAPACK_C_Decl::f_int& LDA 00106 , LAPACK_C_Decl::f_int IPIV[], LAPACK_C_Decl::f_dbl_prec WORK[] 00107 , const LAPACK_C_Decl::f_int& LWORK 00108 , LAPACK_C_Decl::f_int* INFO ); 00109 } 00110 00111 void LAPACK_C_Decl::dsytrf( const f_char& UPLO 00112 , const f_int& N, f_dbl_prec A[], const f_int& LDA 00113 , f_int IPIV[], f_dbl_prec WORK[], const f_int& LWORK 00114 , f_int* INFO ) 00115 { 00116 ::FORTRAN_FUNC_CALL_UL(DSYTRF,dsytrf)(FORTRAN_CHAR_1_ARG_CALL(UPLO) 00117 ,N,A,LDA,IPIV,WORK,LWORK,INFO); 00118 } 00119 00120 // DSYTRS 00121 00122 extern "C" { 00123 FORTRAN_FUNC_DECL_UL( void, DSYTRS, dsytrs ) ( FORTRAN_CONST_CHAR_1_ARG(UPLO) 00124 , const LAPACK_C_Decl::f_int& N, const LAPACK_C_Decl::f_int& NRHS 00125 , const LAPACK_C_Decl::f_dbl_prec A[] 00126 , const LAPACK_C_Decl::f_int& LDA, const LAPACK_C_Decl::f_int IPIV[] 00127 , LAPACK_C_Decl::f_dbl_prec B[] 00128 , const LAPACK_C_Decl::f_int& LDB, LAPACK_C_Decl::f_int* INFO ); 00129 } 00130 00131 void LAPACK_C_Decl::dsytrs( const f_char& UPLO 00132 , const f_int& N, const f_int& NRHS, const f_dbl_prec A[] 00133 , const f_int& LDA, const f_int IPIV[], f_dbl_prec B[] 00134 , const f_int& LDB, f_int* INFO ) 00135 { 00136 ::FORTRAN_FUNC_CALL_UL(DSYTRS,dsytrs)(FORTRAN_CHAR_1_ARG_CALL(UPLO) 00137 ,N,NRHS,A,LDA,IPIV,B,LDB,INFO); 00138 } 00139 00140 // DGETRF 00141 00142 extern "C" { 00143 FORTRAN_FUNC_DECL_UL( void, DGETRF, dgetrf ) ( 00144 const LAPACK_C_Decl::f_int& M ,const LAPACK_C_Decl::f_int& N 00145 ,LAPACK_C_Decl::f_dbl_prec A[], const LAPACK_C_Decl::f_int& LDA 00146 ,LAPACK_C_Decl::f_int IPIV[], LAPACK_C_Decl::f_int* INFO 00147 ); 00148 } 00149 00150 void LAPACK_C_Decl::dgetrf( 00151 const f_int& M, const f_int& N, f_dbl_prec A[], const f_int& LDA 00152 ,f_int IPIV[], f_int* INFO 00153 ) 00154 { 00155 ::FORTRAN_FUNC_CALL_UL(DGETRF,dgetrf)(M,N,A,LDA,IPIV,INFO); 00156 } 00157 00158 // DGETRS 00159 00160 extern "C" { 00161 FORTRAN_FUNC_DECL_UL( void, DGETRS, dgetrs ) ( 00162 FORTRAN_CONST_CHAR_1_ARG(TRANS) 00163 ,const LAPACK_C_Decl::f_int& N, const LAPACK_C_Decl::f_int& NRHS 00164 ,const LAPACK_C_Decl::f_dbl_prec* A, const LAPACK_C_Decl::f_int& LDA 00165 ,const LAPACK_C_Decl::f_int IPIV[] 00166 ,LAPACK_C_Decl::f_dbl_prec* B, const LAPACK_C_Decl::f_int& LDB 00167 ,LAPACK_C_Decl::f_int* INFO 00168 ); 00169 } 00170 00171 void LAPACK_C_Decl::dgetrs( 00172 const f_char& TRANS 00173 ,const f_int& N, const f_int& NRHS, const f_dbl_prec A[] 00174 ,const f_int& LDA, const f_int IPIV[], f_dbl_prec B[] 00175 ,const f_int& LDB, f_int* INFO 00176 ) 00177 { 00178 ::FORTRAN_FUNC_CALL_UL(DGETRS,dgetrs)( 00179 FORTRAN_CHAR_1_ARG_CALL(TRANS),N,NRHS,A,LDA,IPIV,B,LDB,INFO 00180 ); 00181 }
1.7.6.1