trivial subvector of full size return *this
This commit is contained in:
parent
9ef9ff6630
commit
1dd3905d14
3
vec.cc
3
vec.cc
@ -877,6 +877,9 @@ const NRVec<T> NRVec<T>::subvector(const int from, const int to) const
|
|||||||
laerror("invalid subvector specification");
|
laerror("invalid subvector specification");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
//trivial case of whole vector for efficiency
|
||||||
|
if(from==0 && to == nn-1) return *this;
|
||||||
|
|
||||||
const int n = to - from + 1;
|
const int n = to - from + 1;
|
||||||
NRVec<T> r(n, getlocation());
|
NRVec<T> r(n, getlocation());
|
||||||
if(!LA_traits<T>::is_plaindata()) laerror("only implemented for plain data");
|
if(!LA_traits<T>::is_plaindata()) laerror("only implemented for plain data");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user