From 86a644680ae2cbae7e37ab1bed0f4dcf2f5aa883 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sat, 6 Feb 2021 14:11:01 -0700 Subject: [PATCH] qvec: add constructor to extend a vector --- include/common/qvec.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/common/qvec.hh b/include/common/qvec.hh index 3eaed71d..20071b61 100644 --- a/include/common/qvec.hh +++ b/include/common/qvec.hh @@ -99,6 +99,16 @@ public: v[i] = 0; } + /** + * Extending a vector + */ + qvec(const qvec &other, T value) { + for (int i = 0; i < N - 1; ++i) { + v[i] = other[i]; + } + v[N-1] = value; + } + bool operator==(const qvec &other) const { for (int i=0; i