NRVec::reverse()

This commit is contained in:
2026-03-09 16:52:42 +01:00
parent fea32c3611
commit 9b5372fcae
2 changed files with 4 additions and 0 deletions

1
.gitignore vendored
View File

@@ -62,4 +62,5 @@ test_regsurf
*.gcno *.gcno
*.gcov *.gcov
gmon.out gmon.out
npytest
# CVS default ignores end # CVS default ignores end

3
vec.h
View File

@@ -195,6 +195,9 @@ public:
//! perform deep-copy of given vector //! perform deep-copy of given vector
NRVec& operator|=(const NRVec &rhs); NRVec& operator|=(const NRVec &rhs);
//! return vector with reversed order of elements
NRVec reverse() const {NRVec r(nn); for(int i=0; i<nn; ++i) r[i]= v[nn-1-i]; return r;}
//! extract specified subvector //! extract specified subvector
const NRVec subvector(const int from, const int to) const; const NRVec subvector(const int from, const int to) const;
const NRVec subvector(const NRVec<int> &selection) const; const NRVec subvector(const NRVec<int> &selection) const;