45 #include <viennacl/linalg/inner_prod.hpp>
46 #endif // HAVE_VIENNACL
57 namespace implementation
65 template <enum Backend,
class Vector>
69 typedef typename Vector::Scalar
T;
79 static T
compute(Vector a, Vector b);
85 template <
class Vector>
86 struct dot<Backend::NATIVE, Vector>
89 typedef typename Vector::Scalar
T;
116 T result=
static_cast<T
>(0);
127 template <
class Vector>
128 struct dot<Backend::EIGEN3, Vector>
131 typedef typename Vector::Scalar
T;
146 return vec_a.dot(vec_b);
149 #endif // HAVE_EIGEN3
155 template <
class Vector>
156 struct dot<Backend::VIENNACL, Vector>
159 typedef typename Vector::Scalar
T;
169 static T
compute(shogun::CGPUVector<T> a, shogun::CGPUVector<T> b)
171 return viennacl::linalg::inner_prod(a.vcl_vector(), b.vcl_vector());
174 #endif // HAVE_VIENNACL
181 #endif // DOT_IMPL_H_
Vector::Scalar dot(Vector a, Vector b)
Generic class dot which provides a static compute method. This class is specialized for different typ...
static T compute(shogun::SGVector< T > a, shogun::SGVector< T > b)
all of classes and functions are contained in the shogun namespace
static T compute(shogun::SGVector< T > a, shogun::SGVector< T > b)
static T compute(Vector a, Vector b)
static T compute(T *a, T *b, index_t len)