From 5de1851c66ee44517855473187d353379167d447 Mon Sep 17 00:00:00 2001 From: kevin Date: Sat, 9 Mar 2024 15:13:54 -0500 Subject: [PATCH] cwVectOps.h : Added 'scale_add()' --- cwVectOps.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/cwVectOps.h b/cwVectOps.h index 9798291..277ec11 100644 --- a/cwVectOps.h +++ b/cwVectOps.h @@ -137,6 +137,11 @@ namespace cw return std::numeric_limits::max(); return v[mi]; } + + + //================================================================================================================== + // misc + // template< typename T0, typename T1 > T0 mac( const T0* v0, const T1* v1, unsigned n ) @@ -147,6 +152,24 @@ namespace cw return acc; } + template< typename T0, typename T1 > + T0* scale_add( T0* v0, T0 scale_0, const T1* v1, T1 scale_1, unsigned n ) + { + for(unsigned i=0; i + T0* scale_add( T0* v0, const T1* v1, T1 scale_1, const T2* v2, T2 scale_2, unsigned n ) + { + for(unsigned i=0; i