diff --git a/permutation.h b/permutation.h index 326e755..bc044cc 100644 --- a/permutation.h +++ b/permutation.h @@ -257,14 +257,6 @@ else for(int i=1; i<=n; ++i) r[p[i]-1] = v[i-1]; return r; } -template -void NRVec::permuteme(const NRPerm &p, bool inverse) -{ -NRVec tmp=permuted(p,inverse); -for(int i=0; i > complexify(const NRVec &rhs) { #endif return r; } + + + + template void NRVec::permuteme(const CyclePerm &p) { diff --git a/vec.h b/vec.h index 489d29c..28ee8fe 100644 --- a/vec.h +++ b/vec.h @@ -358,7 +358,14 @@ public: //! permute vector elements const NRVec permuted(const NRPerm &p, const bool inverse=false) const; void permuteme(const CyclePerm &p); //in place - void permuteme(const NRPerm &p, const bool inverse=false); //formally in place, but allocates a copy + void permuteme(const NRPerm &p, const bool inverse=false) + { + NRVec tmp=permuted(p,inverse); + copyonwrite(); + for(int i=0; i::normtype asum() const;