31 #ifndef VECTOR_SUM_IMPL_H_
32 #define VECTOR_SUM_IMPL_H_
58 namespace implementation
66 template <enum Backend,
class Vector>
70 typedef typename Vector::Scalar
T;
84 template <
class Vector>
88 typedef typename Vector::Scalar
T;
98 REQUIRE(vec.
vlen > 0,
"Vector can not be empty!\n");
111 return std::accumulate(vec,vec+len,0);
119 template <
class Vector>
123 typedef typename Vector::Scalar
T;
139 #endif // HAVE_EIGEN3
145 template <
class Vector>
149 typedef typename Vector::Scalar
T;
157 static T
compute(CGPUVector<T> vec)
159 CGPUMatrix<T> m(vec.vector, vec.vlen, 1, vec.offset);
160 return sum<Backend::VIENNACL, CGPUMatrix<T> >
::compute(m,
false);
164 #endif // HAVE_VIENNACL
171 #endif // VECTOR_SUM_IMPL_H_
static T compute(SGVector< T > vec)
static T compute(T *vec, index_t len)
static T compute(SGVector< T > vec)
static T compute(Vector a)
all of classes and functions are contained in the shogun namespace
Generic class vector_sum which provides a static compute method. This class is specialized for differ...
Vector::Scalar vector_sum(Vector a)