From af8f4912b588482a910f2890c8b4b5cdfb590cd4 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sun, 23 Apr 2017 21:20:25 -0600 Subject: [PATCH] common: qvec: add component-wise qv::pow, qv::min, qv::max --- include/common/qvec.hh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/include/common/qvec.hh b/include/common/qvec.hh index b240177a..e632c92c 100644 --- a/include/common/qvec.hh +++ b/include/common/qvec.hh @@ -184,6 +184,33 @@ namespace qv { return res; } + template + qvec pow(const qvec &v1, const qvec &v2) { + qvec res; + for (int i=0; i + qvec min(const qvec &v1, const qvec &v2) { + qvec res; + for (int i=0; i + qvec max(const qvec &v1, const qvec &v2) { + qvec res; + for (int i=0; i T length2(const qvec &v1) { T len2 = 0;