*** empty log message ***

This commit is contained in:
jiri
2004-03-17 05:34:59 +00:00
parent d7b55e9846
commit 4bdb1ffa00
6 changed files with 225 additions and 2 deletions

34
smat.h
View File

@@ -120,9 +120,17 @@ inline NRSMat< complex<double> > &
NRSMat< complex<double> >::operator*=(const complex<double> & a)
{
copyonwrite();
cblas_zscal(nn, (void *)(&a), (void *)v, 1);
cblas_zscal(NN2, (void *)(&a), (void *)v, 1);
return *this;
}
template <typename T>
inline NRSMat<T> & NRSMat<T>::operator*=(const T & a)
{
copyonwrite();
for(int i=0; i<NN2; ++i) v[i]*=a;
return *this;
}
// S += D
@@ -165,6 +173,18 @@ NRSMat< complex<double> >::operator+=(const NRSMat< complex<double> > & rhs)
return *this;
}
template <typename T>
inline NRSMat<T> & NRSMat<T>::operator+=(const NRSMat<T> & rhs)
{
#ifdef DEBUG
if (nn != rhs.nn) laerror("incompatible SMats in SMat::operator+=");
#endif
copyonwrite();
for(int i=0; i<NN2; ++i) v[i] += rhs.v[i];
return *this;
}
// S -= S
inline NRSMat<double> &
NRSMat<double>::operator-=(const NRSMat<double> & rhs)
@@ -187,6 +207,18 @@ NRSMat< complex<double> >::operator-=(const NRSMat< complex<double> > & rhs)
return *this;
}
template <typename T>
inline NRSMat<T> & NRSMat<T>::operator-=(const NRSMat<T> & rhs)
{
#ifdef DEBUG
if (nn != rhs.nn) laerror("incompatible SMats in SMat::operator-=");
#endif
copyonwrite();
for(int i=0; i<NN2; ++i) v[i] -= rhs.v[i];
return *this;
}
// SMat + Mat
template <typename T>
inline const NRMat<T> NRSMat<T>::operator+(const NRMat<T> &rhs) const