opm-common
Toggle main menu visibility
Loading...
Searching...
No Matches
blas_lapack.h
1
/*
2
Copyright 2010 SINTEF ICT, Applied Mathematics.
3
4
This file is part of the Open Porous Media project (OPM).
5
6
OPM is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
OPM is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef OPM_BLAS_LAPACK_HEADER_INCLUDED
21
#define OPM_BLAS_LAPACK_HEADER_INCLUDED
22
23
#ifdef __cplusplus
24
extern
"C"
{
25
#endif
26
27
#if defined(MATLAB_MEX_FILE) && MATLAB_MEX_FILE
28
#include <mex.h>
29
#undef MAT_SIZE_T
30
#define MAT_SIZE_T mwSignedIndex
31
#endif
32
33
#ifndef MAT_SIZE_T
34
#define MAT_SIZE_T int
35
#endif
36
37
38
/* C <- a1*op(A)*op(B) + a2*C where op(X) in {X, X.'} */
39
void
dgemm_(
const
char
*transA ,
const
char
*transB ,
40
const
MAT_SIZE_T* m,
const
MAT_SIZE_T* n ,
const
MAT_SIZE_T* k ,
41
const
double
* a1,
const
double
* A ,
const
MAT_SIZE_T* ldA,
42
const
double
* B,
const
MAT_SIZE_T* ldB,
43
const
double
* a2,
double
* C ,
const
MAT_SIZE_T* ldC);
44
45
46
/* C <- a1*A*A' + a2*C *or* C <- a1*A'*A + a2*C */
47
void
dsyrk_(
const
char
*uplo,
const
char
*trans,
48
const
MAT_SIZE_T *n ,
const
MAT_SIZE_T *k ,
49
const
double
*a1 ,
const
double
*A ,
const
MAT_SIZE_T *ldA,
50
const
double
*a2 ,
double
*C ,
const
MAT_SIZE_T *ldC);
51
52
53
void
dgeqrf_(
const
MAT_SIZE_T *m ,
const
MAT_SIZE_T *n ,
54
double
*A ,
const
MAT_SIZE_T *ld ,
55
double
*tau ,
double
*work,
56
const
MAT_SIZE_T *lwork, MAT_SIZE_T *info);
57
58
59
void
dorgqr_(
const
MAT_SIZE_T *m ,
const
MAT_SIZE_T *n ,
const
MAT_SIZE_T *k ,
60
double
*A ,
const
MAT_SIZE_T *ld ,
const
double
*tau,
61
double
*work,
const
MAT_SIZE_T *lwork, MAT_SIZE_T *info);
62
63
/* A <- LU(A) */
64
void
dgetrf_(
const
MAT_SIZE_T *m ,
const
MAT_SIZE_T *n ,
65
double
*A ,
const
MAT_SIZE_T *ld,
66
MAT_SIZE_T *ipiv, MAT_SIZE_T *info);
67
68
/* B <- A \ B, when A is LU(A) from dgetrf() */
69
void
dgetrs_(
const
char
*trans,
const
MAT_SIZE_T *n,
70
const
MAT_SIZE_T *nrhs ,
71
const
double
*A ,
const
MAT_SIZE_T *lda,
72
const
MAT_SIZE_T *ipiv ,
double
*B,
73
const
MAT_SIZE_T *ldb , MAT_SIZE_T *info);
74
75
/* B <- A \ B, tridiagonal A with bands DL, D, DU */
76
void
dgtsv_(
const
MAT_SIZE_T *n ,
77
const
MAT_SIZE_T *nrhs ,
78
double
*DL ,
79
double
*D ,
80
double
*DU ,
81
double
*B ,
82
const
MAT_SIZE_T *ldb ,
83
MAT_SIZE_T *info);
84
85
/* B <- A \ B, band matrix A stored in AB with kl subdiagonals, ku superdiagonals */
86
void
dgbsv_(
const
MAT_SIZE_T *n ,
87
const
MAT_SIZE_T *kl ,
88
const
MAT_SIZE_T *ku ,
89
const
MAT_SIZE_T *nrhs ,
90
double
*AB ,
91
const
MAT_SIZE_T *ldab ,
92
MAT_SIZE_T *ipiv ,
93
double
*B ,
94
const
MAT_SIZE_T *ldb ,
95
MAT_SIZE_T *info);
96
97
/* B <- A \ B, general solver */
98
void
dgesv_(
const
MAT_SIZE_T *n,
99
const
MAT_SIZE_T *nrhs ,
100
double
*A ,
101
const
MAT_SIZE_T *lda ,
102
MAT_SIZE_T *piv ,
103
double
*B ,
104
const
MAT_SIZE_T *ldb ,
105
MAT_SIZE_T *info);
106
107
/* A <- chol(A) */
108
void
dpotrf_(
const
char
*uplo,
const
MAT_SIZE_T *n,
109
double
*A ,
const
MAT_SIZE_T *lda,
110
MAT_SIZE_T *info);
111
112
/* B <- (A \ (A' \ B)), when A=DPOTRF(A_orig) */
113
void
dpotrs_(
const
char
*uplo,
const
MAT_SIZE_T *n ,
const
MAT_SIZE_T *nrhs,
114
double
*A ,
const
MAT_SIZE_T *lda,
115
double
*B ,
const
MAT_SIZE_T *ldb, MAT_SIZE_T *info);
116
117
/* A <- chol(A), packed format. */
118
void
dpptrf_(
const
char
*uplo,
const
MAT_SIZE_T *n,
119
double
*Ap , MAT_SIZE_T *info);
120
121
/* A <- (A \ (A' \ eye(n)) when A=DPPTRF(A_orig) (packed format). */
122
void
dpptri_(
const
char
*uplo,
const
MAT_SIZE_T *n,
123
double
*Ap , MAT_SIZE_T *info);
124
125
/* y <- a1*op(A)*x + a2*y */
126
void
dgemv_(
const
char
*trans,
127
const
MAT_SIZE_T *m ,
const
MAT_SIZE_T *n,
128
const
double
*a1 ,
const
double
*A,
const
MAT_SIZE_T *ldA ,
129
const
double
*x,
const
MAT_SIZE_T *incX,
130
const
double
*a2 ,
double
*y,
const
MAT_SIZE_T *incY);
131
132
133
/* y <- a*x + y */
134
void
daxpy_(
const
MAT_SIZE_T *n,
const
double
*a,
135
const
double
*x,
const
MAT_SIZE_T *incx,
136
double
*y,
const
MAT_SIZE_T *incy);
137
138
/* s <- x' * y */
139
double
ddot_(
const
MAT_SIZE_T *n,
const
double
*x,
const
MAT_SIZE_T *incx,
140
const
double
*y,
const
MAT_SIZE_T *incy);
141
142
143
144
#ifdef __cplusplus
145
}
146
#endif
147
148
#endif
/* OPM_BLAS_LAPACK_HEADER_INCLUDED */
opm
common
utility
numeric
blas_lapack.h
Generated by
1.17.0