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