Skip to content

Commit fe85abe

Browse files
committed
generalize complex LAPACK
1 parent 212ea36 commit fe85abe

File tree

2 files changed

+10693
-10676
lines changed

2 files changed

+10693
-10676
lines changed

include/common.fypp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,19 @@
6060
#:set CMPLX_INIT = CMPLX_INIT + ["w"]
6161
#:endif
6262

63+
#! BLAS/LAPACK complex->real kind initial conversion
64+
#! Converts a BLAS/LAPACK complex kind initial to a real kind initial
65+
#!
66+
#! Args:
67+
#! ci (character): Complex kind initial in ["c","z","y","w"]
68+
#!
69+
#! Returns:
70+
#! Real kind initial in ["s","d","x","q"] or an empty string on invalid input
71+
#!
72+
#:def c2ri(cmplx)
73+
$:"s" if cmplx=="c" else "d" if cmplx=="z" else "x" if cmplx=="y" else "q" if cmplx=="w" else "ERROR"
74+
#:enddef
75+
6376
#! Complex types to be considered during templating
6477
#:set CMPLX_TYPES = ["complex({})".format(k) for k in CMPLX_KINDS]
6578

0 commit comments

Comments
 (0)