SMat row sums

This commit is contained in:
2025-12-01 17:40:30 +01:00
parent 3a176ddb13
commit b84b4571cb

13
smat.h
View File

@@ -181,6 +181,19 @@ public:
return s;
}
const NRVec<T> rsum() const
{
NRVec<T> r(nn);
for(int i=0; i<nn;++i)
{
r[i]=(T)0;
for(int j=0; j<nn; ++j) r[i] += (*this)(i,j);
}
return r;
}
const NRVec<T> csum() const {return rsum();};
const T trace() const;
void get(int fd, bool dimensions = 1, bool transp = 0, bool orcaformat=false);