DenseLinAlgPack: Concreate C++ Classes for Dense Blas-Compatible Linear Algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DenseLinAlgPack_LAPACK_C_Decl.cpp
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
5 // Copyright (2003) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #include "DenseLinAlgPack_LAPACK_C_Decl.hpp"
43 
44 // DPOTRF
45 
46 extern "C" {
47  FORTRAN_FUNC_DECL_UL( void, DPOTRF, dpotrf ) ( FORTRAN_CONST_CHAR_1_ARG(UPLO)
48  , const LAPACK_C_Decl::f_int& N, LAPACK_C_Decl::f_dbl_prec* A
49  , const LAPACK_C_Decl::f_int& LDA, LAPACK_C_Decl::f_int* INFO );
50 }
51 
52 void LAPACK_C_Decl::dpotrf( const f_char& UPLO
53  , const f_int& N, f_dbl_prec* A, const f_int& LDA
54  , f_int* INFO )
55 {
56  ::FORTRAN_FUNC_CALL_UL(DPOTRF,dpotrf) (FORTRAN_CHAR_1_ARG_CALL(UPLO),N,A,LDA,INFO);
57 }
58 
59 // DGEQRF
60 
61 extern "C" {
62  FORTRAN_FUNC_DECL_UL( void, DGEQRF, dgeqrf ) (
63  const LAPACK_C_Decl::f_int& M, const LAPACK_C_Decl::f_int& N
64  , LAPACK_C_Decl::f_dbl_prec* A, const LAPACK_C_Decl::f_int& LDA
65  , LAPACK_C_Decl::f_dbl_prec* TAU, LAPACK_C_Decl::f_dbl_prec* WORK
66  , const LAPACK_C_Decl::f_int& LWORK, LAPACK_C_Decl::f_int* INFO );
67 }
68 
69 void LAPACK_C_Decl::dgeqrf( const f_int& M
70  , const f_int& N, f_dbl_prec* A, const f_int& LDA
71  , f_dbl_prec* TAU, f_dbl_prec* WORK
72  , const f_int& LWORK, f_int* INFO )
73 {
74  ::FORTRAN_FUNC_CALL_UL(DGEQRF,dgeqrf) (M,N,A,LDA,TAU,WORK,LWORK,INFO);
75 }
76 
77 // DORMRQ
78 
79 extern "C" {
80  FORTRAN_FUNC_DECL_UL( void, DORMQR, dormqr ) ( FORTRAN_CONST_CHAR_1_ARG(SIDE)
81  , FORTRAN_CONST_CHAR_1_ARG(TRANS)
82  , const LAPACK_C_Decl::f_int& M, const LAPACK_C_Decl::f_int& N
83  , const LAPACK_C_Decl::f_int& K, const LAPACK_C_Decl::f_dbl_prec* A
84  , const LAPACK_C_Decl::f_int& LDA, const LAPACK_C_Decl::f_dbl_prec* TAU
85  , LAPACK_C_Decl::f_dbl_prec* C, const LAPACK_C_Decl::f_int& LDC
86  , LAPACK_C_Decl::f_dbl_prec* WORK, const LAPACK_C_Decl::f_int& LWORK
87  , LAPACK_C_Decl::f_int* INFO );
88 }
89 
90 void LAPACK_C_Decl::dormqr( const f_char& SIDE
91  , const f_char& TRANS, const f_int& M, const f_int& N
92  , const f_int& K, const f_dbl_prec* A, const f_int& LDA
93  , const f_dbl_prec* TAU, f_dbl_prec* C, const f_int& LDC
94  , f_dbl_prec* WORK, const f_int& LWORK, f_int* INFO )
95 {
96  ::FORTRAN_FUNC_CALL_UL(DORMQR,dormqr)(FORTRAN_CHAR_1_ARG_CALL(SIDE)
97  ,FORTRAN_CHAR_1_ARG_CALL(TRANS),M,N,K,A,LDA,TAU,C,LDC,WORK,LWORK,INFO);
98 }
99 
100 // DSYTRF
101 
102 extern "C" {
103  FORTRAN_FUNC_DECL_UL( void, DSYTRF, dsytrf ) ( FORTRAN_CONST_CHAR_1_ARG(UPLO)
104  , const LAPACK_C_Decl::f_int& N, LAPACK_C_Decl::f_dbl_prec A[]
105  , const LAPACK_C_Decl::f_int& LDA
106  , LAPACK_C_Decl::f_int IPIV[], LAPACK_C_Decl::f_dbl_prec WORK[]
107  , const LAPACK_C_Decl::f_int& LWORK
108  , LAPACK_C_Decl::f_int* INFO );
109 }
110 
111 void LAPACK_C_Decl::dsytrf( const f_char& UPLO
112  , const f_int& N, f_dbl_prec A[], const f_int& LDA
113  , f_int IPIV[], f_dbl_prec WORK[], const f_int& LWORK
114  , f_int* INFO )
115 {
116  ::FORTRAN_FUNC_CALL_UL(DSYTRF,dsytrf)(FORTRAN_CHAR_1_ARG_CALL(UPLO)
117  ,N,A,LDA,IPIV,WORK,LWORK,INFO);
118 }
119 
120 // DSYTRS
121 
122 extern "C" {
123  FORTRAN_FUNC_DECL_UL( void, DSYTRS, dsytrs ) ( FORTRAN_CONST_CHAR_1_ARG(UPLO)
124  , const LAPACK_C_Decl::f_int& N, const LAPACK_C_Decl::f_int& NRHS
125  , const LAPACK_C_Decl::f_dbl_prec A[]
126  , const LAPACK_C_Decl::f_int& LDA, const LAPACK_C_Decl::f_int IPIV[]
127  , LAPACK_C_Decl::f_dbl_prec B[]
128  , const LAPACK_C_Decl::f_int& LDB, LAPACK_C_Decl::f_int* INFO );
129 }
130 
131 void LAPACK_C_Decl::dsytrs( const f_char& UPLO
132  , const f_int& N, const f_int& NRHS, const f_dbl_prec A[]
133  , const f_int& LDA, const f_int IPIV[], f_dbl_prec B[]
134  , const f_int& LDB, f_int* INFO )
135 {
136  ::FORTRAN_FUNC_CALL_UL(DSYTRS,dsytrs)(FORTRAN_CHAR_1_ARG_CALL(UPLO)
137  ,N,NRHS,A,LDA,IPIV,B,LDB,INFO);
138 }
139 
140 // DGETRF
141 
142 extern "C" {
143  FORTRAN_FUNC_DECL_UL( void, DGETRF, dgetrf ) (
144  const LAPACK_C_Decl::f_int& M ,const LAPACK_C_Decl::f_int& N
145  ,LAPACK_C_Decl::f_dbl_prec A[], const LAPACK_C_Decl::f_int& LDA
146  ,LAPACK_C_Decl::f_int IPIV[], LAPACK_C_Decl::f_int* INFO
147  );
148 }
149 
150 void LAPACK_C_Decl::dgetrf(
151  const f_int& M, const f_int& N, f_dbl_prec A[], const f_int& LDA
152  ,f_int IPIV[], f_int* INFO
153  )
154 {
155  ::FORTRAN_FUNC_CALL_UL(DGETRF,dgetrf)(M,N,A,LDA,IPIV,INFO);
156 }
157 
158 // DGETRS
159 
160 extern "C" {
161  FORTRAN_FUNC_DECL_UL( void, DGETRS, dgetrs ) (
162  FORTRAN_CONST_CHAR_1_ARG(TRANS)
163  ,const LAPACK_C_Decl::f_int& N, const LAPACK_C_Decl::f_int& NRHS
164  ,const LAPACK_C_Decl::f_dbl_prec* A, const LAPACK_C_Decl::f_int& LDA
165  ,const LAPACK_C_Decl::f_int IPIV[]
166  ,LAPACK_C_Decl::f_dbl_prec* B, const LAPACK_C_Decl::f_int& LDB
167  ,LAPACK_C_Decl::f_int* INFO
168  );
169 }
170 
171 void LAPACK_C_Decl::dgetrs(
172  const f_char& TRANS
173  ,const f_int& N, const f_int& NRHS, const f_dbl_prec A[]
174  ,const f_int& LDA, const f_int IPIV[], f_dbl_prec B[]
175  ,const f_int& LDB, f_int* INFO
176  )
177 {
178  ::FORTRAN_FUNC_CALL_UL(DGETRS,dgetrs)(
179  FORTRAN_CHAR_1_ARG_CALL(TRANS),N,NRHS,A,LDA,IPIV,B,LDB,INFO
180  );
181 }