From 1dd3905d146f13c4c5a1c3aa7132ebc7f7342366 Mon Sep 17 00:00:00 2001 From: Jiri Pittner Date: Fri, 17 Oct 2025 14:07:47 +0200 Subject: [PATCH] trivial subvector of full size return *this --- vec.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vec.cc b/vec.cc index dc16611..c4434cb 100644 --- a/vec.cc +++ b/vec.cc @@ -877,6 +877,9 @@ const NRVec NRVec::subvector(const int from, const int to) const laerror("invalid subvector specification"); } #endif +//trivial case of whole vector for efficiency + if(from==0 && to == nn-1) return *this; + const int n = to - from + 1; NRVec r(n, getlocation()); if(!LA_traits::is_plaindata()) laerror("only implemented for plain data");