43 #include <viennacl/linalg/matrix_operations.hpp>
44 #include <viennacl/linalg/vector_operations.hpp>
45 #endif // HAVE_VIENNACL
47 #include <type_traits>
55 namespace implementation
61 template <enum Backend,
class Matrix,
class Vector>
69 template <
class Matrix,
class Vector>
70 struct apply<Backend::EIGEN3, Matrix, Vector>
72 static_assert(std::is_same<typename Matrix::Scalar,typename Vector::Scalar>::value,
73 "Different numeric scalar types for matrix and vector not allowed!\n");
76 typedef typename Matrix::Scalar T;
94 compute(A, b, x, transpose);
112 x_eig=A_eig.transpose()*b_eig;
122 template <
class Matrix,
class Vector>
123 struct apply<Backend::VIENNACL, Matrix, Vector>
125 static_assert(std::is_same<typename Matrix::Scalar,typename Vector::Scalar>::value,
126 "Different numeric scalar types for matrix and vector not allowed!\n");
129 typedef typename Matrix::Scalar T;
138 static CGPUVector<T> compute(CGPUMatrix<T> A, CGPUVector<T> b,
bool transpose)
140 CGPUVector<T> x(A.num_rows);
141 compute(A, b, x, transpose);
152 static void compute(CGPUMatrix<T> A, CGPUVector<T> b, CGPUVector<T> x,
bool transpose)
155 x.vcl_vector()=viennacl::linalg::prod(viennacl::trans(A.vcl_matrix()), b.vcl_vector());
157 x.vcl_vector()=viennacl::linalg::prod(A.vcl_matrix(), b.vcl_vector());
160 #endif // HAVE_VIENNACL
167 #endif // APPLY_IMPL_H_
Generic class which is specialized for different backends to perform apply.
all of classes and functions are contained in the shogun namespace