| 1 |
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root |
| 2 |
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception |
| 3 |
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
| 4 |
// vi: set et ts=4 sw=2 sts=2: |
| 5 |
#ifndef DUNE_ISTL_SUPERLUFUNCTIONS_HH |
| 6 |
#define DUNE_ISTL_SUPERLUFUNCTIONS_HH |
| 7 |
#if HAVE_SUPERLU |
| 8 |
|
| 9 |
#include <dune-istl-config.hh> // SUPERLU_INT_TYPE |
| 10 |
|
| 11 |
#define int_t SUPERLU_INT_TYPE |
| 12 |
#include <supermatrix.h> |
| 13 |
#include <slu_util.h> |
| 14 |
#undef int_t |
| 15 |
|
| 16 |
#if __has_include("slu_sdefs.h") |
| 17 |
extern "C" { |
| 18 |
extern void |
| 19 |
sgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, |
| 20 |
char *, float *, float *, SuperMatrix *, SuperMatrix *, |
| 21 |
void *, int, SuperMatrix *, SuperMatrix *, |
| 22 |
float *, float *, float *, float *, |
| 23 |
GlobalLU_t*, mem_usage_t *, SuperLUStat_t *, int *); |
| 24 |
|
| 25 |
extern void |
| 26 |
sCreate_Dense_Matrix(SuperMatrix *, int, int, float *, int, |
| 27 |
Stype_t, Dtype_t, Mtype_t); |
| 28 |
extern void |
| 29 |
sCreate_CompCol_Matrix(SuperMatrix *, int, int, int, float *, |
| 30 |
int *, int *, Stype_t, Dtype_t, Mtype_t); |
| 31 |
extern int sQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); |
| 32 |
|
| 33 |
extern void sPrint_CompCol_Matrix(char *, SuperMatrix *); |
| 34 |
} |
| 35 |
#endif |
| 36 |
|
| 37 |
#if __has_include("slu_ddefs.h") |
| 38 |
extern "C" { |
| 39 |
extern void |
| 40 |
dgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, |
| 41 |
char *, double *, double *, SuperMatrix *, SuperMatrix *, |
| 42 |
void *, int, SuperMatrix *, SuperMatrix *, |
| 43 |
double *, double *, double *, double *, |
| 44 |
GlobalLU_t*, mem_usage_t *, SuperLUStat_t *, int *); |
| 45 |
|
| 46 |
extern void |
| 47 |
dCreate_CompCol_Matrix(SuperMatrix *, int, int, int, double *, |
| 48 |
int *, int *, Stype_t, Dtype_t, Mtype_t); |
| 49 |
|
| 50 |
extern void |
| 51 |
dCreate_Dense_Matrix(SuperMatrix *, int, int, double *, int, |
| 52 |
Stype_t, Dtype_t, Mtype_t); |
| 53 |
|
| 54 |
extern int dQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); |
| 55 |
|
| 56 |
extern void dPrint_CompCol_Matrix(char *, SuperMatrix *); |
| 57 |
} |
| 58 |
#endif |
| 59 |
|
| 60 |
#if __has_include("slu_cdefs.h") |
| 61 |
|
| 62 |
#include "slu_scomplex.h" |
| 63 |
|
| 64 |
// fallback by introducing typedef for complex for older versions |
| 65 |
#ifdef SUPERLU_MAJOR_VERSION |
| 66 |
#if SUPERLU_MAJOR_VERSION < 7 |
| 67 |
typedef ::complex singlecomplex; |
| 68 |
#endif |
| 69 |
#endif |
| 70 |
|
| 71 |
|
| 72 |
extern "C" { |
| 73 |
extern void |
| 74 |
cgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, |
| 75 |
char *, float *, float *, SuperMatrix *, SuperMatrix *, |
| 76 |
void *, int, SuperMatrix *, SuperMatrix *, |
| 77 |
float *, float *, float *, float *, |
| 78 |
GlobalLU_t*, mem_usage_t *, SuperLUStat_t *, int *); |
| 79 |
|
| 80 |
|
| 81 |
extern void |
| 82 |
cCreate_Dense_Matrix(SuperMatrix *, int, int, singlecomplex*, int, |
| 83 |
Stype_t, Dtype_t, Mtype_t); |
| 84 |
|
| 85 |
|
| 86 |
extern void |
| 87 |
cCreate_CompCol_Matrix(SuperMatrix *, int, int, int, singlecomplex*, |
| 88 |
int *, int *, Stype_t, Dtype_t, Mtype_t); |
| 89 |
|
| 90 |
extern int cQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); |
| 91 |
|
| 92 |
extern void cPrint_CompCol_Matrix(char *, SuperMatrix *); |
| 93 |
} |
| 94 |
#endif |
| 95 |
|
| 96 |
#if __has_include("slu_zdefs.h") |
| 97 |
#include "slu_dcomplex.h" |
| 98 |
extern "C" { |
| 99 |
extern void |
| 100 |
zgssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, |
| 101 |
char *, double *, double *, SuperMatrix *, SuperMatrix *, |
| 102 |
void *, int, SuperMatrix *, SuperMatrix *, |
| 103 |
double *, double *, double *, double *, |
| 104 |
GlobalLU_t*, mem_usage_t *, SuperLUStat_t *, int *); |
| 105 |
|
| 106 |
|
| 107 |
extern void |
| 108 |
zCreate_CompCol_Matrix(SuperMatrix *, int, int, int, doublecomplex *, |
| 109 |
int *, int *, Stype_t, Dtype_t, Mtype_t); |
| 110 |
|
| 111 |
extern void |
| 112 |
zCreate_Dense_Matrix(SuperMatrix *, int, int, doublecomplex *, int, |
| 113 |
Stype_t, Dtype_t, Mtype_t); |
| 114 |
|
| 115 |
extern int zQuerySpace (SuperMatrix *, SuperMatrix *, mem_usage_t *); |
| 116 |
|
| 117 |
extern void zPrint_CompCol_Matrix(char *, SuperMatrix *); |
| 118 |
} |
| 119 |
#endif |
| 120 |
|
| 121 |
|
| 122 |
#endif |
| 123 |
#endif |