45 #include <viennacl/linalg/matrix_operations.hpp>
46 #include <viennacl/linalg/vector_operations.hpp>
47 #endif // HAVE_VIENNACL
55 namespace implementation
59 template <enum Backend,
class Matrix>
63 typedef typename Matrix::Scalar
T;
66 static void compute(Matrix A, Matrix B, Matrix C, T alpha, T beta);
72 template <>
template <
class Matrix>
73 struct scale<Backend::EIGEN3, Matrix>
75 typedef typename Matrix::Scalar
T;
85 B_eig = alpha * A_eig;
94 B_eig = alpha * A_eig;
102 template <>
template <
class Matrix>
103 struct scale<Backend::VIENNACL, Matrix>
105 typedef typename Matrix::Scalar
T;
108 static void compute(CGPUMatrix<T> A, CGPUMatrix<T> B, T alpha)
110 B.vcl_matrix() = alpha*A.vcl_matrix();
114 static void compute(CGPUVector<T> A, CGPUVector<T> B, T alpha)
116 B.vcl_vector() = alpha*A.vcl_vector();
120 #endif // HAVE_VIENNACL
127 #endif // SCALE_IMPL_H_
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > MatrixXt
static void compute(SGMatrix< T > A, SGMatrix< T > B, T alpha)
static void compute(SGVector< T > A, SGVector< T > B, T alpha)
all of classes and functions are contained in the shogun namespace
void scale(Matrix A, Matrix B, typename Matrix::Scalar alpha)
static void compute(Matrix A, Matrix B, Matrix C, T alpha, T beta)
Eigen::Matrix< T, Eigen::Dynamic, 1 > VectorXt