1 #ifndef VIENNACL_LINALG_MATRIX_OPERATIONS_HPP_
2 #define VIENNACL_LINALG_MATRIX_OPERATIONS_HPP_
40 #ifdef VIENNACL_WITH_OPENCL
44 #ifdef VIENNACL_WITH_CUDA
54 template<
typename NumericT,
55 typename SizeT,
typename DistanceT>
64 #ifdef VIENNACL_WITH_OPENCL
69 #ifdef VIENNACL_WITH_CUDA
82 template<
typename NumericT,
92 #ifdef VIENNACL_WITH_OPENCL
97 #ifdef VIENNACL_WITH_CUDA
110 template<
typename NumericT,
111 typename ScalarType1,
typename ScalarType2>
120 mat2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
121 mat3, beta, len_beta, reciprocal_beta, flip_sign_beta);
123 #ifdef VIENNACL_WITH_OPENCL
126 mat2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
127 mat3, beta, len_beta, reciprocal_beta, flip_sign_beta);
130 #ifdef VIENNACL_WITH_CUDA
133 mat2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
134 mat3, beta, len_beta, reciprocal_beta, flip_sign_beta);
145 template<
typename NumericT,
146 typename ScalarType1,
typename ScalarType2>
155 mat2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
156 mat3, beta, len_beta, reciprocal_beta, flip_sign_beta);
158 #ifdef VIENNACL_WITH_OPENCL
161 mat2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
162 mat3, beta, len_beta, reciprocal_beta, flip_sign_beta);
165 #ifdef VIENNACL_WITH_CUDA
168 mat2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
169 mat3, beta, len_beta, reciprocal_beta, flip_sign_beta);
180 template<
typename NumericT>
188 #ifdef VIENNACL_WITH_OPENCL
193 #ifdef VIENNACL_WITH_CUDA
206 template<
typename NumericT>
214 #ifdef VIENNACL_WITH_OPENCL
219 #ifdef VIENNACL_WITH_CUDA
233 template<
typename NumericT>
241 #ifdef VIENNACL_WITH_OPENCL
246 #ifdef VIENNACL_WITH_CUDA
259 template<
typename NumericT>
267 #ifdef VIENNACL_WITH_OPENCL
272 #ifdef VIENNACL_WITH_CUDA
284 template<
typename NumericT>
292 #ifdef VIENNACL_WITH_OPENCL
297 #ifdef VIENNACL_WITH_CUDA
309 template<
typename NumericT>
317 #ifdef VIENNACL_WITH_OPENCL
322 #ifdef VIENNACL_WITH_CUDA
410 template<
typename NumericT>
423 #ifdef VIENNACL_WITH_OPENCL
428 #ifdef VIENNACL_WITH_CUDA
451 template<
typename NumericT>
464 #ifdef VIENNACL_WITH_OPENCL
469 #ifdef VIENNACL_WITH_CUDA
491 template<
typename NumericT,
typename ScalarType >
508 #ifdef VIENNACL_WITH_OPENCL
513 #ifdef VIENNACL_WITH_CUDA
532 template<
typename NumericT,
typename ScalarType >
550 #ifdef VIENNACL_WITH_OPENCL
555 #ifdef VIENNACL_WITH_CUDA
575 template<
typename NumericT,
typename ScalarType >
591 #ifdef VIENNACL_WITH_OPENCL
596 #ifdef VIENNACL_WITH_CUDA
615 template<
typename NumericT,
typename ScalarType >
631 #ifdef VIENNACL_WITH_OPENCL
636 #ifdef VIENNACL_WITH_CUDA
658 template<
typename T,
typename OP>
670 #ifdef VIENNACL_WITH_OPENCL
675 #ifdef VIENNACL_WITH_CUDA
688 #define VIENNACL_MAKE_BINARY_OP(OPNAME)\
689 template<typename T>\
690 viennacl::matrix_expression<const matrix_base<T>, const matrix_base<T>, op_element_binary<op_##OPNAME> >\
691 element_##OPNAME(matrix_base<T> const & A, matrix_base<T> const & B)\
693 return viennacl::matrix_expression<const matrix_base<T>, const matrix_base<T>, op_element_binary<op_##OPNAME> >(A, B);\
696 template<typename M1, typename M2, typename OP, typename T>\
697 viennacl::matrix_expression<const matrix_expression<const M1, const M2, OP>,\
698 const matrix_base<T>,\
699 op_element_binary<op_##OPNAME> >\
700 element_##OPNAME(matrix_expression<const M1, const M2, OP> const & proxy, matrix_base<T> const & B)\
702 return viennacl::matrix_expression<const matrix_expression<const M1, const M2, OP>,\
703 const matrix_base<T>,\
704 op_element_binary<op_##OPNAME> >(proxy, B);\
707 template<typename T, typename M2, typename M3, typename OP>\
708 viennacl::matrix_expression<const matrix_base<T>,\
709 const matrix_expression<const M2, const M3, OP>,\
710 op_element_binary<op_##OPNAME> >\
711 element_##OPNAME(matrix_base<T> const & A, matrix_expression<const M2, const M3, OP> const & proxy)\
713 return viennacl::matrix_expression<const matrix_base<T>,\
714 const matrix_expression<const M2, const M3, OP>,\
715 op_element_binary<op_##OPNAME> >(A, proxy);\
718 template<typename M1, typename M2, typename OP1,\
719 typename M3, typename M4, typename OP2>\
720 viennacl::matrix_expression<const matrix_expression<const M1, const M2, OP1>,\
721 const matrix_expression<const M3, const M4, OP2>,\
722 op_element_binary<op_##OPNAME> >\
723 element_##OPNAME(matrix_expression<const M1, const M2, OP1> const & proxy1,\
724 matrix_expression<const M3, const M4, OP2> const & proxy2)\
726 return viennacl::matrix_expression<const matrix_expression<const M1, const M2, OP1>,\
727 const matrix_expression<const M3, const M4, OP2>,\
728 op_element_binary<op_##OPNAME> >(proxy1, proxy2);\
742 #undef VIENNACL_GENERATE_BINARY_OP_OVERLOADS
746 #define VIENNACL_MAKE_UNARY_ELEMENT_OP(funcname) \
747 template<typename T> \
748 viennacl::matrix_expression<const matrix_base<T>, const matrix_base<T>, op_element_unary<op_##funcname> > \
749 element_##funcname(matrix_base<T> const & A) \
751 return viennacl::matrix_expression<const matrix_base<T>, const matrix_base<T>, op_element_unary<op_##funcname> >(A, A); \
753 template<typename LHS, typename RHS, typename OP> \
754 viennacl::matrix_expression<const matrix_expression<const LHS, const RHS, OP>, \
755 const matrix_expression<const LHS, const RHS, OP>, \
756 op_element_unary<op_##funcname> > \
757 element_##funcname(matrix_expression<const LHS, const RHS, OP> const & proxy) \
759 return viennacl::matrix_expression<const matrix_expression<const LHS, const RHS, OP>, \
760 const matrix_expression<const LHS, const RHS, OP>, \
761 op_element_unary<op_##funcname> >(proxy, proxy); \
782 #undef VIENNACL_MAKE_UNARY_ELEMENT_OP
795 template<
typename NumericT>
815 template<
typename NumericT,
typename S1>
817 S1
const & alpha,
vcl_size_t len_alpha,
bool reciprocal_alpha,
bool flip_sign_alpha,
825 alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
828 #ifdef VIENNACL_WITH_OPENCL
831 alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
835 #ifdef VIENNACL_WITH_CUDA
838 alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
857 template <
typename NumericT,
typename VectorType>
868 #ifdef VIENNACL_WITH_OPENCL
874 #ifdef VIENNACL_WITH_CUDA
898 template <
typename SCALARTYPE>
911 #ifdef VIENNACL_WITH_OPENCL
917 #ifdef VIENNACL_WITH_CUDA
937 template <
typename NumericT>
947 #ifdef VIENNACL_WITH_OPENCL
953 #ifdef VIENNACL_WITH_CUDA
974 template <
typename NumericT>
983 #ifdef VIENNACL_WITH_OPENCL
989 #ifdef VIENNACL_WITH_CUDA
1009 template <
typename NumericT>
1019 #ifdef VIENNACL_WITH_OPENCL
1025 #ifdef VIENNACL_WITH_CUDA
1048 template<
typename NumericT>
1061 #ifdef VIENNACL_WITH_OPENCL
1067 #ifdef VIENNACL_WITH_CUDA
1086 template<
typename NumericT>
1097 #ifdef VIENNACL_WITH_OPENCL
1103 #ifdef VIENNACL_WITH_CUDA
1122 template<
typename NumericT>
1133 #ifdef VIENNACL_WITH_OPENCL
1139 #ifdef VIENNACL_WITH_CUDA
1168 template<
typename NumericT>
1186 template<
typename NumericT>
1209 template<
typename NumericT>
1227 template<
typename NumericT>
1236 result = v1 - result;
1250 template<
typename NumericT>
1257 assert(
viennacl::traits::size2(proxy.lhs()) == v1.
size() && bool(
"Size check failed in v1 += trans(A) * v2: size2(A) != size(v1)"));
1271 template<
typename NumericT>
1278 assert(
viennacl::traits::size2(proxy.lhs()) == v1.
size() && bool(
"Size check failed in v1 += trans(A) * v2: size2(A) != size(v1)"));
1293 template<
typename NumericT>
1313 template<
typename NumericT>
1324 result = v1 - result;
void norm_frobenius_cpu(matrix_base< T > const &vec, T &result)
Computes the Frobenius norm of a vector with final reduction on the CPU.
Implementations of dense matrix related operations, including matrix-vector products, using a plain single-threaded or OpenMP-enabled execution on CPU.
void matrix_diag_from_vector(const vector_base< NumericT > &vec, int k, matrix_base< NumericT > &A)
void trans(const matrix_expression< const matrix_base< NumericT, SizeT, DistanceT >, const matrix_base< NumericT, SizeT, DistanceT >, op_trans > &proxy, matrix_base< NumericT > &temp_trans)
void matrix_diag_to_vector(const matrix_base< NumericT > &A, int k, vector_base< NumericT > &v)
Dispatcher interface for v = diag(A, k)
void house_update_QL(matrix_base< NumericT > &Q, vector_base< NumericT > &D, vcl_size_t A_size1)
This function updates the matrix Q, which is needed for the computation of the eigenvectors.
void am(matrix_base< NumericT > &A, matrix_base< NumericT > const &B, ScalarT1 const &alpha, vcl_size_t, bool reciprocal_alpha, bool flip_sign_alpha)
void matrix_column(const matrix_base< NumericT > &A, unsigned int j, vector_base< NumericT > &vec)
This class represents a single scalar value on the GPU and behaves mostly like a built-in scalar type...
Implementations of dense matrix related operations, including matrix-vector products, using OpenCL.
void house_update_A_right(matrix_base< NumericT > &A, vector_base< NumericT > &D)
This function applies a householder transformation to a matrix: A <- A * P with a householder reflect...
vector< NumericT > operator-=(vector_base< NumericT > &v1, const viennacl::vector_expression< const matrix_base< NumericT >, const vector_base< NumericT >, viennacl::op_prod > &proxy)
Implementation of the operation v1 -= A * v2, where A is a matrix.
void matrix_diag_to_vector(const matrix_base< NumericT > &mat, int k, vector_base< NumericT > &vec)
size_type internal_size() const
Returns the total amount of allocated memory in multiples of sizeof(NumericT)
Exception class in case of memory errors.
void exclusive_scan(vector_base< NumericT > &vec1, vector_base< NumericT > &vec2)
This function implements an exclusive scan.
void copy_vec(matrix_base< SCALARTYPE > &A, vector_base< SCALARTYPE > &V, vcl_size_t row_start, vcl_size_t col_start, bool copy_col)
This function copies a row or a column from a matrix to a vector.
Generic size and resize functionality for different vector and matrix types.
void trans(matrix_expression< const matrix_base< NumericT, SizeT, DistanceT >, const matrix_base< NumericT, SizeT, DistanceT >, op_trans > const &proxy, matrix_base< NumericT > &temp_trans)
void exclusive_scan(vector_base< NumericT > &vec1, vector_base< NumericT > &vec2)
Extracts the underlying OpenCL start index handle from a vector, a matrix, an expression etc...
void matrix_assign(matrix_base< NumericT > &mat, NumericT s, bool clear=false)
void house_update_A_right(matrix_base< NumericT > &A, vector_base< NumericT > &D)
This function applies a householder transformation to a matrix: A <- A * P with a householder reflect...
vector< NumericT > operator+=(vector_base< NumericT > &v1, const viennacl::vector_expression< const matrix_base< NumericT >, const vector_base< NumericT >, viennacl::op_prod > &proxy)
Implementation of the operation v1 += A * v2, where A is a matrix.
void matrix_assign(matrix_base< NumericT > &mat, NumericT s, bool clear=false)
vcl_size_t size1(MatrixType const &mat)
Generic routine for obtaining the number of rows of a matrix (ViennaCL, uBLAS, etc.)
void norm_2_cpu(vector_base< T > const &vec, T &result)
Computes the l^2-norm of a vector with final reduction on the CPU - dispatcher interface.
void house_update_QL(matrix_base< NumericT > &Q, vector_base< NumericT > &D, vcl_size_t A_size1)
This function updates the matrix Q, which is needed for the computation of the eigenvectors.
void am(matrix_base< NumericT > &mat1, matrix_base< NumericT > const &mat2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha)
Expression template class for representing a tree of expressions which ultimately result in a matrix...
void ambm(matrix_base< NumericT > &mat1, matrix_base< NumericT > const &mat2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT > const &mat3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
size_type stride2() const
Returns the number of columns.
void clear(VectorType &vec)
Generic routine for setting all entries of a vector to zero. This is the version for non-ViennaCL obj...
This file provides the forward declarations for the main types used within ViennaCL.
void ambm(matrix_base< NumericT > &mat1, matrix_base< NumericT > const &mat2, ScalarT1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT > const &mat3, ScalarT2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Determines row and column increments for matrices and matrix proxies.
void bidiag_pack(matrix_base< NumericT > &A, viennacl::vector< NumericT > &dh, viennacl::vector< NumericT > &sh)
void prod_impl(const matrix_base< NumericT > &mat, bool mat_transpose, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
An expression template class that represents a binary operation that yields a vector.
void element_op(matrix_base< T > &A, matrix_expression< const matrix_base< T >, const matrix_base< T >, OP > const &proxy)
Implementation of the element-wise operation A = B .* C and A = B ./ C for matrices (using MATLAB syn...
result_of::size_type< MatrixType >::type size2(MatrixType const &mat)
Generic routine for obtaining the number of columns of a matrix (ViennaCL, uBLAS, etc...
void scaled_rank_1_update(matrix_base< NumericT > &A, ScalarT1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, const vector_base< NumericT > &vec1, const vector_base< NumericT > &vec2)
The implementation of the operation mat += alpha * vec1 * vec2^T, i.e. a scaled rank 1 update...
viennacl::vector< NumericT > operator-(const vector_base< NumericT > &v1, const vector_expression< const matrix_base< NumericT >, const vector_base< NumericT >, op_prod > &proxy)
Implementation of the operation 'result = v1 - A * v2', where A is a matrix.
void house_update_A_right(matrix_base< NumericT > &A, vector_base< NumericT > &D)
This function applies a householder transformation to a matrix: A <- A * P with a householder reflect...
void copy_vec(matrix_base< NumericT > &A, vector_base< NumericT > &V, vcl_size_t row_start, vcl_size_t col_start, bool copy_col)
void house_update_A_right(matrix_base< NumericT > &A, vector_base< NumericT > &D)
void element_op(matrix_base< NumericT > &A, matrix_expression< const matrix_base< NumericT >, const matrix_base< NumericT >, op_element_binary< OpT > > const &proxy)
Implementation of binary element-wise operations A = OP(B,C)
void norm_2_impl(vector_base< T > const &vec, scalar< T > &result)
Computes the l^2-norm of a vector - dispatcher interface.
void ambm(matrix_base< NumericT > &A, matrix_base< NumericT > const &B, ScalarT1 const &alpha, vcl_size_t, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT > const &C, ScalarT2 const &beta, vcl_size_t, bool reciprocal_beta, bool flip_sign_beta)
void norm_frobenius_impl(matrix_base< T > const &vec, scalar< T > &result)
Computes the Frobenius norm of a matrix - dispatcher interface.
void house_update_QL(matrix_base< NumericT > &Q, vector_base< NumericT > &D, vcl_size_t A_size1)
viennacl::vector< float > v1
VectorT prod(std::vector< std::vector< T, A1 >, A2 > const &matrix, VectorT const &vector)
vcl_size_t size(VectorType const &vec)
Generic routine for obtaining the size of a vector (ViennaCL, uBLAS, etc.)
void matrix_row(const matrix_base< NumericT > &A, unsigned int i, vector_base< NumericT > &v)
void copy_vec(matrix_base< NumericT > &A, vector_base< S1 > &V, vcl_size_t row_start, vcl_size_t col_start, bool copy_col)
This function copies a row or a column from a matrix to a vector.
void prod_impl(const matrix_base< NumericT > &mat, bool trans, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
void ambm_m(matrix_base< NumericT > &mat1, matrix_base< NumericT > const &mat2, ScalarT1 const &alpha, vcl_size_t, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT > const &mat3, ScalarT2 const &beta, vcl_size_t, bool reciprocal_beta, bool flip_sign_beta)
void am(matrix_base< NumericT > &mat1, matrix_base< NumericT > const &mat2, ScalarT const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha)
void matrix_diag_to_vector(matrix_base< NumericT > const &mat, int k, vector_base< NumericT > &vec)
#define VIENNACL_MAKE_UNARY_ELEMENT_OP(funcname)
void matrix_column(const matrix_base< NumericT > &mat, unsigned int j, vector_base< NumericT > &vec)
void bidiag_pack(matrix_base< NumericT > &A, VectorType &dh, VectorType &sh)
This function stores the diagonal and the superdiagonal of a matrix in two vectors.
void house_update_A_left(matrix_base< NumericT > &A, vector_base< NumericT > &D, vcl_size_t start)
This function applies a householder transformation to a matrix. A <- P * A with a householder reflect...
void matrix_diagonal_assign(matrix_base< NumericT > &mat, NumericT s)
void element_op(matrix_base< NumericT > &A, matrix_expression< const matrix_base< NumericT >, const matrix_base< NumericT >, op_element_binary< OpT > > const &proxy)
Implementation of the element-wise operations A = B .* C and A = B ./ C (using MATLAB syntax) ...
result_of::size_type< T >::type start(T const &obj)
void house_update_QL(matrix_base< NumericT > &Q, vector_base< NumericT > &D, vcl_size_t A_size1)
This function updates the matrix Q, which is needed for the computation of the eigenvectors.
void inclusive_scan(vector_base< NumericT > &vec1, vector_base< NumericT > &vec2)
This function implements an inclusive scan.
void scaled_rank_1_update(matrix_base< NumericT > &mat1, ScalarT const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, const vector_base< NumericT > &vec1, const vector_base< NumericT > &vec2)
The implementation of the operation mat += alpha * vec1 * vec2^T, i.e. a scaled rank 1 update...
void ambm_m(matrix_base< NumericT > &mat1, matrix_base< NumericT > const &mat2, ScalarT1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT > const &mat3, ScalarT2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
size_type stride1() const
Returns the number of rows.
void house_update_A_left(matrix_base< NumericT > &A, vector_base< NumericT > &D, vcl_size_t start)
This function applies a householder transformation to a matrix. A <- P * A with a householder reflect...
#define VIENNACL_MAKE_BINARY_OP(OPNAME)
void scaled_rank_1_update(matrix_base< NumericT > &mat1, S1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, const vector_base< NumericT > &vec1, const vector_base< NumericT > &vec2)
The implementation of the operation mat += alpha * vec1 * vec2^T, i.e. a scaled rank 1 update...
void matrix_diag_from_vector(const vector_base< NumericT > &vec, int k, matrix_base< NumericT > &mat)
void matrix_diagonal_assign(matrix_base< NumericT > &mat, NumericT s)
void ambm(matrix_base< NumericT > &mat1, matrix_base< NumericT > const &mat2, ScalarT1 const &alpha, vcl_size_t, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT > const &mat3, ScalarT2 const &beta, vcl_size_t, bool reciprocal_beta, bool flip_sign_beta)
handle_type & handle()
Returns the OpenCL handle, non-const-version.
void trans(const matrix_expression< const matrix_base< NumericT, SizeT, DistanceT >, const matrix_base< NumericT, SizeT, DistanceT >, op_trans > &proxy, matrix_base< NumericT > &temp_trans)
void house_update_A_left(matrix_base< NumericT > &A, vector_base< NumericT > &D, vcl_size_t start)
void matrix_column(const matrix_base< NumericT > &A, unsigned int j, vector_base< NumericT > &v)
void inclusive_scan(vector_base< NumericT > &vec1, vector_base< NumericT > &vec2)
void inclusive_scan(vector_base< NumericT > &vec1, vector_base< NumericT > &vec2)
This function implements an inclusive scan.
Proxy classes for vectors.
void scaled_rank_1_update(matrix_base< NumericT > &mat1, ScalarT const &alpha, vcl_size_t, bool reciprocal_alpha, bool flip_sign_alpha, const vector_base< NumericT > &vec1, const vector_base< NumericT > &vec2)
The implementation of the operation mat += alpha * vec1 * vec2^T, i.e. a scaled rank 1 update...
All the predicates used within ViennaCL. Checks for expressions to be vectors, etc.
void matrix_row(const matrix_base< NumericT > &mat, unsigned int i, vector_base< NumericT > &vec)
viennacl::vector< NumericT > operator+(const vector_base< NumericT > &v1, const vector_expression< const matrix_base< NumericT >, const vector_base< NumericT >, op_prod > &proxy)
Implementation of the operation 'result = v1 + A * v2', where A is a matrix.
void am(matrix_base< NumericT > &mat1, matrix_base< NumericT > const &mat2, ScalarT1 const &alpha, vcl_size_t, bool reciprocal_alpha, bool flip_sign_alpha)
void matrix_column(const matrix_base< NumericT > &mat, unsigned int j, vector_base< NumericT > &vec)
viennacl::matrix_expression< const vector_base< NumericT >, const vector_base< NumericT >, op_prod > outer_prod(const vector_base< NumericT > &vec1, const vector_base< NumericT > &vec2)
Returns a proxy class for the operation mat += vec1 * vec2^T, i.e. a rank 1 update.
A tag class representing matrix-vector products and element-wise multiplications. ...
void matrix_diag_to_vector(const matrix_base< NumericT > &A, int k, vector_base< NumericT > &vec)
Implementations of dense matrix related operations, including matrix-vector products, using CUDA.
void element_op(matrix_base< NumericT, SizeT > &A, matrix_expression< const matrix_base< NumericT, SizeT >, const matrix_base< NumericT, SizeT >, op_element_binary< OpT > > const &proxy)
void inclusive_scan(vector_base< NumericT > &vec1, vector_base< NumericT > &vec2)
This function implements an inclusive scan.
void matrix_row(matrix_base< NumericT > const &mat, unsigned int i, vector_base< NumericT > &vec)
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
void matrix_assign(matrix_base< NumericT > &A, NumericT s, bool up_to_internal_size=false)
void givens_next(matrix_base< NumericT > &Q, vector_base< NumericT > &tmp1, vector_base< NumericT > &tmp2, int l, int m)
This function updates the matrix Q. It is part of the tql2 algorithm.
void trans(const matrix_expression< const matrix_base< NumericT, SizeT, DistanceT >, const matrix_base< NumericT, SizeT, DistanceT >, op_trans > &proxy, matrix_base< NumericT > &temp_trans)
size_type size() const
Returns the length of the vector (cf. std::vector)
void bidiag_pack(matrix_base< NumericT > &A, VectorType &dh, VectorType &sh)
This function stores the diagonal and the superdiagonal of a matrix in two vectors.
void bidiag_pack(matrix_base< NumericT > &A, VectorType &dh, VectorType &sh)
Main abstraction class for multiple memory domains. Represents a buffer in either main RAM...
void givens_next(matrix_base< NumericT > &matrix, vector_base< NumericT > &tmp1, vector_base< NumericT > &tmp2, int l, int m)
A tag class representing transposed matrices.
size_type start2() const
Returns the number of columns.
void house_update_A_left(matrix_base< NumericT > &A, vector_base< NumericT > &D, vcl_size_t start)
This function applies a householder transformation to a matrix. A <- P * A with a householder reflect...
void exclusive_scan(vector_base< NumericT > &vec1, vector_base< NumericT > &vec2)
This function implements an exclusive scan.
void matrix_diagonal_assign(matrix_base< NumericT > &mat, NumericT s)
void matrix_row(const matrix_base< NumericT > &A, unsigned int i, vector_base< NumericT > &vec)
void givens_next(matrix_base< NumericT > &Q, vector_base< NumericT > &tmp1, vector_base< NumericT > &tmp2, int l, int m)
This function updates the matrix Q. It is part of the tql2 algorithm.
Extracts the underlying OpenCL handle from a vector, a matrix, an expression etc. ...
void prod_impl(const matrix_base< NumericT > &mat, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
viennacl::backend::mem_handle & handle(T &obj)
Returns the generic memory handle of an object. Non-const version.
void matrix_diag_from_vector(const vector_base< NumericT > &v, int k, matrix_base< NumericT > &A)
Dispatcher interface for A = diag(v, k)
void matrix_diag_from_vector(const vector_base< NumericT > &vec, int k, matrix_base< NumericT > &mat)
void ambm_m(matrix_base< NumericT > &mat1, matrix_base< NumericT > const &mat2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT > const &mat3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Implementation of the ViennaCL scalar class.
A collection of compile time type deductions.
void matrix_assign(matrix_base< NumericT > &mat, NumericT s, bool clear=false)
void prod_impl(const matrix_base< NumericT > &A, bool trans_A, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
void ambm_m(matrix_base< NumericT > &A, matrix_base< NumericT > const &B, ScalarT1 const &alpha, vcl_size_t, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT > const &C, ScalarT2 const &beta, vcl_size_t, bool reciprocal_beta, bool flip_sign_beta)
void givens_next(matrix_base< NumericT > &Q, vector_base< NumericT > &tmp1, vector_base< NumericT > &tmp2, int l, int m)
This function updates the matrix Q. It is part of the tql2 algorithm.
void matrix_diagonal_assign(matrix_base< NumericT > &A, NumericT s)
void copy_vec(matrix_base< NumericT > &A, vector_base< NumericT > &V, vcl_size_t row_start, vcl_size_t col_start, bool copy_col)
This function copies a row or a column from a matrix to a vector.
Simple enable-if variant that uses the SFINAE pattern.
size_type start1() const
Returns the number of rows.
void exclusive_scan(vector_base< NumericT, F > &vec1, vector_base< NumericT, F > &vec2)
This function implements an exclusive scan.
memory_types get_active_handle_id() const
Returns an ID for the currently active memory buffer. Other memory buffers might contain old or no da...