NRSMat sum()

This commit is contained in:
2025-03-04 16:46:59 +01:00
parent ad1bee99a5
commit 8f037f7ccf
3 changed files with 65 additions and 5 deletions

6
vec.h
View File

@@ -365,11 +365,7 @@ public:
const NRVec otimes2vec(const NRVec<T> &rhs, const bool conjugate = false, const T &scale = 1) const;
//! compute the sum of the vector elements
inline const T sum() const {
T sum(v[0]);
for(register int i=1; i<nn; i++){ sum += v[i];}
return sum;
};
const T sum() const;
//! compute the sum of squares the vector elements
inline const T sumsqr() const {