From 1e86f8d4df69edd816f6de837343c852027e9d79 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Mon, 20 May 2013 09:05:04 -0500 Subject: CarpetLib: Add constructors to create a vector from a low-dimensional vector and a scalar --- Carpet/CarpetLib/src/vect.hh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Carpet/CarpetLib') diff --git a/Carpet/CarpetLib/src/vect.hh b/Carpet/CarpetLib/src/vect.hh index 8a1e1b6f8..142cabc15 100644 --- a/Carpet/CarpetLib/src/vect.hh +++ b/Carpet/CarpetLib/src/vect.hh @@ -53,6 +53,22 @@ public: /** Explicit empty constructor. */ explicit vect () { } + /** Create a vector from a lower-dimensional vector. */ + vect (const vect& x, const T& a) + { + assert(D>0); + for (int d=0; d& x) + { + assert(D>0); + elt[0] = a; + for (int d=0; d