From 764baa3201e2e0ca53f4ed44f21f3b4626510970 Mon Sep 17 00:00:00 2001 From: Jiri Pittner Date: Thu, 18 Jan 2024 14:31:00 +0100 Subject: [PATCH] tiny additions in vec.h and vecmat3.h --- vec.h | 8 ++++++++ vecmat3.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/vec.h b/vec.h index d9d1562..74fd24b 100644 --- a/vec.h +++ b/vec.h @@ -363,6 +363,14 @@ public: return sum; }; + //! compute the sum of squares the vector elements + inline const T sumsqr() const { + T sum(v[0]); + for(register int i=1; i