1 #ifndef VIENNACL_LINALG_MATRIX_OPERATIONS_HPP_
2 #define VIENNACL_LINALG_MATRIX_OPERATIONS_HPP_
40 #ifdef VIENNACL_WITH_OPENCL
44 #ifdef VIENNACL_WITH_CUDA
53 template <
typename NumericT,
typename F,
63 #ifdef VIENNACL_WITH_OPENCL
68 #ifdef VIENNACL_WITH_CUDA
81 template <
typename NumericT,
typename F,
82 typename ScalarType1,
typename ScalarType2>
91 mat2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
92 mat3, beta, len_beta, reciprocal_beta, flip_sign_beta);
94 #ifdef VIENNACL_WITH_OPENCL
97 mat2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
98 mat3, beta, len_beta, reciprocal_beta, flip_sign_beta);
101 #ifdef VIENNACL_WITH_CUDA
104 mat2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
105 mat3, beta, len_beta, reciprocal_beta, flip_sign_beta);
116 template <
typename NumericT,
typename F,
117 typename ScalarType1,
typename ScalarType2>
126 mat2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
127 mat3, beta, len_beta, reciprocal_beta, flip_sign_beta);
129 #ifdef VIENNACL_WITH_OPENCL
132 mat2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
133 mat3, beta, len_beta, reciprocal_beta, flip_sign_beta);
136 #ifdef VIENNACL_WITH_CUDA
139 mat2, alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
140 mat3, beta, len_beta, reciprocal_beta, flip_sign_beta);
151 template <
typename NumericT,
typename F>
159 #ifdef VIENNACL_WITH_OPENCL
164 #ifdef VIENNACL_WITH_CUDA
177 template <
typename NumericT,
typename F>
185 #ifdef VIENNACL_WITH_OPENCL
190 #ifdef VIENNACL_WITH_CUDA
204 template <
typename NumericT,
typename F>
212 #ifdef VIENNACL_WITH_OPENCL
217 #ifdef VIENNACL_WITH_CUDA
230 template <
typename NumericT,
typename F>
238 #ifdef VIENNACL_WITH_OPENCL
243 #ifdef VIENNACL_WITH_CUDA
255 template <
typename NumericT,
typename F>
263 #ifdef VIENNACL_WITH_OPENCL
268 #ifdef VIENNACL_WITH_CUDA
280 template <
typename NumericT,
typename F>
288 #ifdef VIENNACL_WITH_OPENCL
293 #ifdef VIENNACL_WITH_CUDA
310 template <
typename T,
typename F>
324 template <
typename T,
typename F>
349 template <
typename NumericT,
typename F>
362 #ifdef VIENNACL_WITH_OPENCL
367 #ifdef VIENNACL_WITH_CUDA
390 template <
typename NumericT,
typename F>
403 #ifdef VIENNACL_WITH_OPENCL
408 #ifdef VIENNACL_WITH_CUDA
430 template <
typename NumericT,
typename F1,
typename F2,
typename F3,
typename ScalarType >
447 #ifdef VIENNACL_WITH_OPENCL
452 #ifdef VIENNACL_WITH_CUDA
471 template <
typename NumericT,
typename F1,
typename F2,
typename F3,
typename ScalarType >
489 #ifdef VIENNACL_WITH_OPENCL
494 #ifdef VIENNACL_WITH_CUDA
514 template <
typename NumericT,
typename F1,
typename F2,
typename F3,
typename ScalarType >
530 #ifdef VIENNACL_WITH_OPENCL
535 #ifdef VIENNACL_WITH_CUDA
554 template <
typename NumericT,
typename F1,
typename F2,
typename F3,
typename ScalarType >
570 #ifdef VIENNACL_WITH_OPENCL
575 #ifdef VIENNACL_WITH_CUDA
597 template <
typename T,
typename F,
typename OP>
609 #ifdef VIENNACL_WITH_OPENCL
614 #ifdef VIENNACL_WITH_CUDA
627 #define VIENNACL_MAKE_BINARY_OP(OPNAME)\
628 template <typename T, typename F>\
629 viennacl::matrix_expression<const matrix_base<T, F>, const matrix_base<T, F>, op_element_binary<op_##OPNAME> >\
630 element_##OPNAME(matrix_base<T, F> const & A, matrix_base<T, F> const & B)\
632 return viennacl::matrix_expression<const matrix_base<T, F>, const matrix_base<T, F>, op_element_binary<op_##OPNAME> >(A, B);\
635 template <typename M1, typename M2, typename OP, typename T, typename F>\
636 viennacl::matrix_expression<const matrix_expression<const M1, const M2, OP>,\
637 const matrix_base<T, F>,\
638 op_element_binary<op_##OPNAME> >\
639 element_##OPNAME(matrix_expression<const M1, const M2, OP> const & proxy, matrix_base<T, F> const & B)\
641 return viennacl::matrix_expression<const matrix_expression<const M1, const M2, OP>,\
642 const matrix_base<T, F>,\
643 op_element_binary<op_##OPNAME> >(proxy, B);\
646 template <typename T, typename F, typename M2, typename M3, typename OP>\
647 viennacl::matrix_expression<const matrix_base<T, F>,\
648 const matrix_expression<const M2, const M3, OP>,\
649 op_element_binary<op_##OPNAME> >\
650 element_##OPNAME(matrix_base<T, F> const & A, matrix_expression<const M2, const M3, OP> const & proxy)\
652 return viennacl::matrix_expression<const matrix_base<T, F>,\
653 const matrix_expression<const M2, const M3, OP>,\
654 op_element_binary<op_##OPNAME> >(A, proxy);\
657 template <typename M1, typename M2, typename OP1,\
658 typename M3, typename M4, typename OP2>\
659 viennacl::matrix_expression<const matrix_expression<const M1, const M2, OP1>,\
660 const matrix_expression<const M3, const M4, OP2>,\
661 op_element_binary<op_##OPNAME> >\
662 element_##OPNAME(matrix_expression<const M1, const M2, OP1> const & proxy1,\
663 matrix_expression<const M3, const M4, OP2> const & proxy2)\
665 return viennacl::matrix_expression<const matrix_expression<const M1, const M2, OP1>,\
666 const matrix_expression<const M3, const M4, OP2>,\
667 op_element_binary<op_##OPNAME> >(proxy1, proxy2);\
674 #undef VIENNACL_GENERATE_BINARY_OP_OVERLOADS
678 #define VIENNACL_MAKE_UNARY_ELEMENT_OP(funcname) \
679 template <typename T, typename F> \
680 viennacl::matrix_expression<const matrix_base<T, F>, const matrix_base<T, F>, op_element_unary<op_##funcname> > \
681 element_##funcname(matrix_base<T, F> const & A) \
683 return viennacl::matrix_expression<const matrix_base<T, F>, const matrix_base<T, F>, op_element_unary<op_##funcname> >(A, A); \
685 template <typename LHS, typename RHS, typename OP> \
686 viennacl::matrix_expression<const matrix_expression<const LHS, const RHS, OP>, \
687 const matrix_expression<const LHS, const RHS, OP>, \
688 op_element_unary<op_##funcname> > \
689 element_##funcname(matrix_expression<const LHS, const RHS, OP> const & proxy) \
691 return viennacl::matrix_expression<const matrix_expression<const LHS, const RHS, OP>, \
692 const matrix_expression<const LHS, const RHS, OP>, \
693 op_element_unary<op_##funcname> >(proxy, proxy); \
714 #undef VIENNACL_MAKE_UNARY_ELEMENT_OP
727 template <
typename NumericT>
729 outer_prod(
const vector_base<NumericT> & vec1,
const vector_base<NumericT> & vec2)
747 template <
typename NumericT,
typename F,
typename S1>
749 S1
const & alpha,
vcl_size_t len_alpha,
bool reciprocal_alpha,
bool flip_sign_alpha,
750 const vector_base<NumericT> & vec1,
751 const vector_base<NumericT> & vec2)
757 alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
760 #ifdef VIENNACL_WITH_OPENCL
763 alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
767 #ifdef VIENNACL_WITH_CUDA
770 alpha, len_alpha, reciprocal_alpha, flip_sign_alpha,
797 template <
typename NumericT,
typename F>
815 template <
typename NumericT,
typename F>
838 template <
typename NumericT,
typename F>
856 template <
typename NumericT,
typename F>
865 result = v1 - result;
879 template <
typename NumericT,
typename F>
886 assert(
viennacl::traits::size2(proxy.lhs()) == v1.
size() && bool(
"Size check failed in v1 += trans(A) * v2: size2(A) != size(v1)"));
900 template <
typename NumericT,
typename F>
907 assert(
viennacl::traits::size2(proxy.lhs()) == v1.
size() && bool(
"Size check failed in v1 += trans(A) * v2: size2(A) != size(v1)"));
922 template <
typename NumericT,
typename F>
942 template <
typename NumericT,
typename F>
953 result = v1 - result;
Implementations of dense matrix related operations, including matrix-vector products, using a plain single-threaded or OpenMP-enabled execution on CPU.
void ambm_m(matrix_base< NumericT, F > &mat1, matrix_base< NumericT, F > const &mat2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT, F > const &mat3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Definition: matrix_operations.hpp:118
std::size_t vcl_size_t
Definition: forwards.h:58
size_type internal_size() const
Returns the total amount of allocated memory in multiples of sizeof(SCALARTYPE)
Definition: matrix.hpp:651
void matrix_column(const matrix_base< NumericT, F > &mat, unsigned int j, vector_base< NumericT > &vec)
Definition: matrix_operations.hpp:566
void ambm_m(matrix_base< NumericT, F > &mat1, matrix_base< NumericT, F > const &mat2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT, F > const &mat3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Definition: matrix_operations.hpp:148
Implementations of dense matrix related operations, including matrix-vector products, using OpenCL.
Definition: forwards.h:478
void scaled_rank_1_update(matrix_base< NumericT, F > &mat1, S1 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...
Definition: matrix_operations.hpp:1120
Exception class in case of memory errors.
Definition: forwards.h:485
Generic size and resize functionality for different vector and matrix types.
Extracts the underlying OpenCL start index handle from a vector, a matrix, an expression etc...
This class represents a single scalar value on the GPU and behaves mostly like a built-in scalar type...
Definition: forwards.h:172
void matrix_diag_to_vector(const matrix_base< NumericT, F > &A, int k, vector_base< NumericT > &v)
Dispatcher interface for v = diag(A, k)
Definition: matrix_operations.hpp:231
void matrix_row(const matrix_base< NumericT, F > &mat, unsigned int i, vector_base< NumericT > &vec)
Definition: matrix_operations.hpp:539
void element_op(matrix_base< NumericT, F > &A, matrix_expression< const matrix_base< NumericT, F >, const matrix_base< NumericT, F >, op_element_binary< OP > > const &proxy)
Implementation of the element-wise operations A = B .* C and A = B ./ C (using MATLAB syntax) ...
Definition: matrix_operations.hpp:604
void matrix_column(const matrix_base< NumericT, F > &mat, unsigned int j, vector_base< NumericT > &vec)
Definition: matrix_operations.hpp:406
vcl_size_t size1(MatrixType const &mat)
Generic routine for obtaining the number of rows of a matrix (ViennaCL, uBLAS, etc.)
Definition: size.hpp:216
void matrix_assign(matrix_base< NumericT, F > &mat, NumericT s, bool clear=false)
Definition: matrix_operations.hpp:395
void am(matrix_base< NumericT, F > &mat1, matrix_base< NumericT, F > const &mat2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha)
Definition: matrix_operations.hpp:55
void ambm(matrix_base< NumericT, F > &mat1, matrix_base< NumericT, F > const &mat2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT, F > const &mat3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Definition: matrix_operations.hpp:83
void matrix_diagonal_assign(matrix_base< NumericT, F > &mat, NumericT s)
Definition: matrix_operations.hpp:289
Common base class for dense vectors, vector ranges, and vector slices.
Definition: forwards.h:205
void clear(VectorType &vec)
Generic routine for setting all entries of a vector to zero. This is the version for non-ViennaCL obj...
Definition: clear.hpp:57
This file provides the forward declarations for the main types used within ViennaCL.
Determines row and column increments for matrices and matrix proxies.
void matrix_row(const matrix_base< NumericT, F > &A, unsigned int i, vector_base< NumericT > &v)
Definition: matrix_operations.hpp:256
void prod_impl(const matrix_base< NumericT, F > &mat, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
Definition: matrix_operations.hpp:737
void matrix_diag_from_vector(const vector_base< NumericT > &vec, int k, matrix_base< NumericT, F > &mat)
Definition: matrix_operations.hpp:318
void matrix_assign(matrix_base< NumericT, F > &mat, NumericT s, bool clear=false)
Definition: matrix_operations.hpp:257
void matrix_assign(matrix_base< NumericT, F > &mat, NumericT s, bool clear=false)
Definition: matrix_operations.hpp:152
result_of::size_type< MatrixType >::type size2(MatrixType const &mat)
Generic routine for obtaining the number of columns of a matrix (ViennaCL, uBLAS, etc...
Definition: size.hpp:245
Definition: forwards.h:481
void matrix_diag_from_vector(const vector_base< NumericT > &vec, int k, matrix_base< NumericT, F > &mat)
Definition: matrix_operations.hpp:466
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...
Definition: mem_handle.hpp:91
A dense matrix class.
Definition: forwards.h:290
void matrix_diag_to_vector(const matrix_base< NumericT, F > &mat, int k, vector_base< NumericT > &vec)
Definition: matrix_operations.hpp:504
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
Definition: cpu_ram.hpp:29
void matrix_diag_from_vector(const vector_base< NumericT > &vec, int k, matrix_base< NumericT, F > &mat)
Definition: matrix_operations.hpp:245
void am(matrix_base< NumericT, F > &mat1, matrix_base< NumericT, F > const &mat2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha)
Definition: matrix_operations.hpp:66
void ambm_m(matrix_base< NumericT, F > &mat1, matrix_base< NumericT, F > const &mat2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT, F > const &mat3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Definition: matrix_operations.hpp:182
void scaled_rank_1_update(matrix_base< NumericT, F > &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...
Definition: matrix_operations.hpp:2470
VectorT prod(std::vector< std::vector< T, A1 >, A2 > const &matrix, VectorT const &vector)
Definition: prod.hpp:91
vector< NumericT > operator-=(vector_base< NumericT > &v1, const viennacl::vector_expression< const matrix_base< NumericT, F >, const vector_base< NumericT >, viennacl::op_prod > &proxy)
Implementation of the operation v1 -= A * v2, where A is a matrix.
Definition: matrix_operations.hpp:817
void element_op(matrix_base< T, F > &A, matrix_expression< const matrix_base< T, F >, const matrix_base< T, F >, op_element_binary< OP > > const &proxy)
Definition: matrix_operations.hpp:489
vcl_size_t size(VectorType const &vec)
Generic routine for obtaining the size of a vector (ViennaCL, uBLAS, etc.)
Definition: size.hpp:144
Definition: forwards.h:480
void scaled_rank_1_update(matrix_base< NumericT, F > &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...
Definition: matrix_operations.hpp:748
void norm_frobenius_cpu(matrix_base< T, F > const &vec, T &result)
Computes the Frobenius norm of a vector with final reduction on the CPU.
Definition: matrix_operations.hpp:325
#define VIENNACL_MAKE_UNARY_ELEMENT_OP(funcname)
Definition: matrix_operations.hpp:678
void element_op(matrix_base< T, F > &A, matrix_expression< const matrix_base< T, F >, const matrix_base< T, F >, op_element_binary< OP > > const &proxy)
Implementation of binary element-wise operations A = OP(B,C)
Definition: matrix_operations.hpp:460
vector< NumericT > operator+=(vector_base< NumericT > &v1, const viennacl::vector_expression< const matrix_base< NumericT, F >, const vector_base< NumericT >, viennacl::op_prod > &proxy)
Implementation of the operation v1 += A * v2, where A is a matrix.
Definition: matrix_operations.hpp:799
void matrix_assign(matrix_base< NumericT, F > &mat, NumericT s, bool clear=false)
Definition: matrix_operations.hpp:198
void matrix_row(const matrix_base< NumericT, F > &mat, unsigned int i, vector_base< NumericT > &vec)
Definition: matrix_operations.hpp:363
An expression template class that represents a binary operation that yields a vector.
Definition: forwards.h:181
#define VIENNACL_MAKE_BINARY_OP(OPNAME)
Definition: matrix_operations.hpp:627
size_type size() const
Returns the length of the vector (cf. std::vector)
Definition: vector.hpp:837
void matrix_diagonal_assign(matrix_base< NumericT, F > &mat, NumericT s)
Definition: matrix_operations.hpp:223
void element_op(matrix_base< T, F > &A, matrix_expression< const matrix_base< T, F >, const matrix_base< T, F >, OP > const &proxy)
Implementation of the element-wise operation A = B .* C and A = B ./ C for matrices (using MATLAB syn...
Definition: matrix_operations.hpp:598
Expression template class for representing a tree of expressions which ultimately result in a matrix...
Definition: forwards.h:283
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.
Definition: vector_operations.hpp:669
handle_type & handle()
Returns the OpenCL handle, non-const-version.
Definition: matrix.hpp:654
viennacl::vector< NumericT > operator-(const vector_base< NumericT > &v1, const vector_expression< const matrix_base< NumericT, F >, const vector_base< NumericT >, op_prod > &proxy)
Implementation of the operation 'result = v1 - A * v2', where A is a matrix.
Definition: matrix_operations.hpp:858
Proxy classes for vectors.
All the predicates used within ViennaCL. Checks for expressions to be vectors, etc.
A vector class representing a linear memory sequence on the GPU. Inspired by boost::numeric::ublas::v...
Definition: forwards.h:208
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.
Definition: matrix_operations.hpp:729
A tag class representing matrix-vector products and element-wise multiplications. ...
Definition: forwards.h:76
Implementations of dense matrix related operations, including matrix-vector products, using CUDA.
void matrix_column(const matrix_base< NumericT, F > &A, unsigned int j, vector_base< NumericT > &v)
Definition: matrix_operations.hpp:281
void matrix_diag_to_vector(const matrix_base< NumericT, F > &mat, int k, vector_base< NumericT > &vec)
Definition: matrix_operations.hpp:370
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
void scaled_rank_1_update(matrix_base< NumericT, F > &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...
Definition: matrix_operations.hpp:955
void am(matrix_base< NumericT, F > &mat1, matrix_base< NumericT, F > const &mat2, ScalarType1 const &alpha, vcl_size_t, bool reciprocal_alpha, bool flip_sign_alpha)
Definition: matrix_operations.hpp:52
Definition: forwards.h:479
void matrix_diag_from_vector(const vector_base< NumericT > &v, int k, matrix_base< NumericT, F > &A)
Dispatcher interface for A = diag(v, k)
Definition: matrix_operations.hpp:205
void norm_2_impl(vector_base< T > const &vec, scalar< T > &result)
Computes the l^2-norm of a vector - dispatcher interface.
Definition: vector_operations.hpp:624
Main abstraction class for multiple memory domains. Represents a buffer in either main RAM...
Definition: mem_handle.hpp:62
A tag class representing transposed matrices.
Definition: forwards.h:165
void prod_impl(const matrix_base< NumericT, F > &mat, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
Definition: matrix_operations.hpp:547
void prod_impl(const matrix_base< NumericT, F > &mat, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
Definition: matrix_operations.hpp:350
void norm_frobenius_impl(matrix_base< T, F > const &vec, scalar< T > &result)
Computes the Frobenius norm of a matrix - dispatcher interface.
Definition: matrix_operations.hpp:311
void matrix_diagonal_assign(matrix_base< NumericT, F > &mat, NumericT s)
Definition: matrix_operations.hpp:440
Extracts the underlying OpenCL handle from a vector, a matrix, an expression etc. ...
viennacl::backend::mem_handle & handle(T &obj)
Returns the generic memory handle of an object. Non-const version.
Definition: handle.hpp:41
void am(matrix_base< NumericT, F > &mat1, matrix_base< NumericT, F > const &mat2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha)
Definition: matrix_operations.hpp:58
void matrix_row(const matrix_base< NumericT, F > &mat, unsigned int i, vector_base< NumericT > &vec)
Definition: matrix_operations.hpp:417
Implementation of the ViennaCL scalar class.
void ambm(matrix_base< NumericT, F > &mat1, matrix_base< NumericT, F > const &mat2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT, F > const &mat3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Definition: matrix_operations.hpp:108
viennacl::vector< NumericT > operator+(const vector_base< NumericT > &v1, const vector_expression< const matrix_base< NumericT, F >, const vector_base< NumericT >, op_prod > &proxy)
Implementation of the operation 'result = v1 + A * v2', where A is a matrix.
Definition: matrix_operations.hpp:840
void ambm_m(matrix_base< NumericT, F > &mat1, matrix_base< NumericT, F > const &mat2, ScalarType1 const &alpha, vcl_size_t, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT, F > const &mat3, ScalarType2 const &beta, vcl_size_t, bool reciprocal_beta, bool flip_sign_beta)
Definition: matrix_operations.hpp:261
A collection of compile time type deductions.
void matrix_diagonal_assign(matrix_base< NumericT, F > &mat, NumericT s)
Definition: matrix_operations.hpp:178
void matrix_column(const matrix_base< NumericT, F > &mat, unsigned int j, vector_base< NumericT > &vec)
Definition: matrix_operations.hpp:450
void ambm(matrix_base< NumericT, F > &mat1, matrix_base< NumericT, F > const &mat2, ScalarType1 const &alpha, vcl_size_t, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT, F > const &mat3, ScalarType2 const &beta, vcl_size_t, bool reciprocal_beta, bool flip_sign_beta)
Definition: matrix_operations.hpp:132
void ambm(matrix_base< NumericT, F > &mat1, matrix_base< NumericT, F > const &mat2, ScalarType1 const &alpha, vcl_size_t len_alpha, bool reciprocal_alpha, bool flip_sign_alpha, matrix_base< NumericT, F > const &mat3, ScalarType2 const &beta, vcl_size_t len_beta, bool reciprocal_beta, bool flip_sign_beta)
Definition: matrix_operations.hpp:98
void prod_impl(const matrix_base< NumericT, F > &mat, const vector_base< NumericT > &vec, vector_base< NumericT > &result)
Carries out matrix-vector multiplication.
Definition: matrix_operations.hpp:1364
Simple enable-if variant that uses the SFINAE pattern.
void matrix_diag_to_vector(const matrix_base< NumericT, F > &mat, int k, vector_base< NumericT > &vec)
Definition: matrix_operations.hpp:306