From 1452f61dbd639019e293aa22e110e45ceacd82c7 Mon Sep 17 00:00:00 2001 From: Jiri Pittner Date: Fri, 8 Jul 2022 14:58:24 +0200 Subject: [PATCH] dummy conjugateme for real matrices --- mat.cc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/mat.cc b/mat.cc index 976e7e7..f7feb29 100644 --- a/mat.cc +++ b/mat.cc @@ -2013,11 +2013,11 @@ NRMat< std::complex >::operator*(const NRSMat< std::complex > &r /***************************************************************************//** - * conjugate this real matrix \f$A\f$, i.e. do nothing :-) + * conjugate this non-complex matrix \f$A\f$, i.e. do nothing :-) * @return reference to the (unmodified) matrix ******************************************************************************/ -template<> -NRMat& NRMat::conjugateme() { +template +NRMat& NRMat::conjugateme() { return *this; } @@ -2040,6 +2040,22 @@ NRMat >& NRMat >::conjugateme() { return *this; } +template<> +NRMat >& NRMat >::conjugateme() { + copyonwrite(); +#ifdef CUDALA + if(location == cpu){ +#endif + cblas_sscal((size_t)mm*nn, -1.0, (float *)((*this)[0]) + 1, 2); +#ifdef CUDALA + }else{ + cublasSscal((size_t)mm*nn, -1.0, (float *)(this->v) + 1, 2); + } +#endif + return *this; +} + + /***************************************************************************//** * compute transpose (optionally conjugated) of this real matrix \f$A\f$ * @param[in] conj conjugation flag, unused for real matrices