nrvec::permuteme moved from permutation.h to vec.h
This commit is contained in:
9
vec.h
9
vec.h
@@ -358,7 +358,14 @@ public:
|
||||
//! permute vector elements
|
||||
const NRVec permuted(const NRPerm<int> &p, const bool inverse=false) const;
|
||||
void permuteme(const CyclePerm<int> &p); //in place
|
||||
void permuteme(const NRPerm<int> &p, const bool inverse=false); //formally in place, but allocates a copy
|
||||
void permuteme(const NRPerm<int> &p, const bool inverse=false)
|
||||
{
|
||||
NRVec<T> tmp=permuted(p,inverse);
|
||||
copyonwrite();
|
||||
for(int i=0; i<size(); ++i) v[i] = tmp.v[i];
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! compute the sum of the absolute values of the elements of this vector
|
||||
inline const typename LA_traits<T>::normtype asum() const;
|
||||
|
||||
Reference in New Issue
Block a user