1 #ifndef NPSTAT_SIMPLESCALARPRODUCT_HH_
2 #define NPSTAT_SIMPLESCALARPRODUCT_HH_
19 template<
typename Real>
22 inline Real operator()(
const Real* x,
const Real* y,
23 const unsigned long len)
const
25 typedef typename PreciseType<Real>::type Precise;
26 Precise sum = Precise();
31 for (
unsigned long i=0; i<len; ++i)
32 sum +=
static_cast<Precise
>(*x++ * *y++);
34 return static_cast<Real
>(sum);
Compile-time deduction of an appropriate precise numeric type.
Definition: AbsArrayProjector.hh:14
Definition: SimpleScalarProduct.hh:21