inline doublecomplex *LC(__complex__ double *A) { return (doublecomplex*)A; } inline double *LC(double *A) { return A; } template inline void COPY(int N, DT *X, int IX, DT *Y, int IY) { (if constexpr (std::is_same_v) dcopy(N, LC(X), IX, LC(Y), IY); else zcopy(N, LC(X), IX, LC(Y), IY);); } template inline double NRM2(int N, DT *X, int IX) { return (if constexpr (std::is_same_v) dnrm2(N, LC(X), IX); else znrm2(N, LC(X), IX);); } template inline double NRM2_2(int N, DT *X, int IX) { DT a=(if constexpr (std::is_same_v) dnrm2(N, LC(X), IX); else znrm2(N, LC(X), IX);); return a*a; } template inline double ASUM(int N, DT *X, int IX) { return (if constexpr (std::is_same_v) dasum(N, LC(X), IX); else zasum(N, LC(X), IX);); } template inline int IAMAX(int N, DT *X, int IX) { return (if constexpr (std::is_same_v) idamax(N, LC(X), IX); else izamax(N, LC(X), IX);); }