NULAPACK
NUmerical Linear Algebra PACKage
Loading...
Searching...
No Matches
Thomas.h
Go to the documentation of this file.
1
33#ifndef THOMAS_H
34#define THOMAS_H
35
36#include "types.h"
37#include "mangling.h"
38
39/* =========================
40 * FORTRAN API DECLARATIONS
41 * ========================= */
42
44
46
48
50
51
52#ifdef __cplusplus
53
54 /* ==============
55 * C++ INTERFACE
56 * ============== */
57
76 SUBROUTINE thomas(INTEGER* N, REAL* A, REAL* B, REAL* X, INTEGER* INFO) {
77 API_sgttsv(N, A, B, X, INFO);
78 }
79
91 API_dgttsv(N, A, B, X, INFO);
92 }
93
105 API_cgttsv(N, A, B, X, INFO);
106 }
107
119 API_zgttsv(N, A, B, X, INFO);
120 }
121
122#else // C-only fallback
123
124 /* ===========
125 * C INTERFACE
126 * ============ */
127
128 #define thomas(N, A, B, X, INFO) \
129 _Generic((A), \
130 REAL*: API_sgttsv, \
131 DOUBLE*: API_dgttsv, \
132 COMPLEX*: API_cgttsv, \
133 DOUBLE_COMPLEX*: API_zgttsv \
134 )(N, A, B, X, INFO)
135
136#endif
137
138#endif
void API_cgttsv(fortran_int *N, fortran_complex *A, fortran_complex *B, fortran_complex *X, fortran_int *INFO)
void API_dgttsv(fortran_int *N, fortran_double *A, fortran_double *B, fortran_double *X, fortran_int *INFO)
void API_zgttsv(fortran_int *N, fortran_double_complex *A, fortran_double_complex *B, fortran_double_complex *X, fortran_int *INFO)
void thomas(fortran_int *N, fortran_real *A, fortran_real *B, fortran_real *X, fortran_int *INFO)
Thomas algorithm (tridiagonal solver) for A * X = B.
Definition Thomas.h:76
void API_sgttsv(fortran_int *N, fortran_real *A, fortran_real *B, fortran_real *X, fortran_int *INFO)
#define fortran
Definition types.h:99
#define SUBROUTINE
Definition types.h:96
#define REAL
Definition types.h:79
#define DOUBLE_COMPLEX
Definition types.h:82
#define DOUBLE
Definition types.h:80
#define INTEGER
Definition types.h:83
#define COMPLEX
Definition types.h:81