aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/vect.hh
diff options
context:
space:
mode:
Diffstat (limited to 'Carpet/CarpetLib/src/vect.hh')
-rw-r--r--Carpet/CarpetLib/src/vect.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/src/vect.hh b/Carpet/CarpetLib/src/vect.hh
index 29b8a3ba8..e3f6b086b 100644
--- a/Carpet/CarpetLib/src/vect.hh
+++ b/Carpet/CarpetLib/src/vect.hh
@@ -293,6 +293,9 @@ public:
};
#endif
+ // Memory usage
+ size_t memory () const { return D * memoryof (*elt); }
+
// Input/Output helpers
void input (istream& is);
void output (ostream& os) const;
@@ -509,6 +512,13 @@ inline vect<U,D> scan1 (U (* const func)(U val, T x), U val,
+// Memory usage
+
+template<typename T,int D>
+inline size_t memoryof (vect<T,D> const & a) { return a.memory(); }
+
+
+
// Input
/** Read a formatted vector from a stream. */