cwVectOps.h : Added abs_sum().
This commit is contained in:
parent
ef5b099dd4
commit
b6296bcebe
10
cwVectOps.h
10
cwVectOps.h
@ -389,6 +389,16 @@ namespace cw
|
||||
return y;
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
T abs_sum( const T* v, unsigned n )
|
||||
{
|
||||
T y = 0;
|
||||
for(unsigned i=0; i<n; ++i)
|
||||
y += std::abs(v[i]);
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
T prod( const T* v, unsigned n )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user