dummy conjugateme for real matrices

This commit is contained in:
Jiri Pittner 2022-07-08 14:58:24 +02:00
parent 0ff3dbba54
commit 1452f61dbd

22
mat.cc
View File

@ -2013,11 +2013,11 @@ NRMat< std::complex<double> >::operator*(const NRSMat< std::complex<double> > &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 * @return reference to the (unmodified) matrix
******************************************************************************/ ******************************************************************************/
template<> template<typename T>
NRMat<double>& NRMat<double>::conjugateme() { NRMat<T>& NRMat<T>::conjugateme() {
return *this; return *this;
} }
@ -2040,6 +2040,22 @@ NRMat<std::complex<double> >& NRMat<std::complex<double> >::conjugateme() {
return *this; return *this;
} }
template<>
NRMat<std::complex<float> >& NRMat<std::complex<float> >::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$ * compute transpose (optionally conjugated) of this real matrix \f$A\f$
* @param[in] conj conjugation flag, unused for real matrices * @param[in] conj conjugation flag, unused for real matrices