NRVec sorting moved to .h to be available for newly derived non-plain data types
This commit is contained in:
20
vec.cc
20
vec.cc
@@ -26,7 +26,6 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include "vec.h"
|
||||
#include "qsort.h"
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
@@ -807,25 +806,6 @@ NRVec<std::complex<double> >::otimes(const NRVec<std::complex<double> > &b, cons
|
||||
return result;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
int NRVec<T>::sort(int direction, int from, int to, int *perm) {
|
||||
NOT_GPU(*this);
|
||||
|
||||
copyonwrite();
|
||||
if(to == -1) to = nn - 1;
|
||||
if(direction) return memqsort<1, NRVec<T>, int, int>(*this, perm, from, to);
|
||||
else return memqsort<0, NRVec<T>, int, int>(*this, perm, from, to);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
int NRVec<T>::sort(int direction, NRPerm<int> &perm)
|
||||
{
|
||||
if(nn!=perm.size()) laerror("incompatible vector and permutation");
|
||||
perm.identity();
|
||||
int r=sort(direction,0,nn-1,&perm[1]);
|
||||
return r;
|
||||
}
|
||||
|
||||
template<>
|
||||
NRVec<std::complex<double> > complexify(const NRVec<double> &rhs) {
|
||||
NRVec<std::complex<double> > r(rhs.size(), rhs.getlocation());
|
||||
|
||||
Reference in New Issue
Block a user