1 #ifndef VIENNACL_LINALG_HOST_BASED_MATRIX_OPERATIONS_HPP_
2 #define VIENNACL_LINALG_HOST_BASED_MATRIX_OPERATIONS_HPP_
51 template <
typename NumericT,
typename F,
typename ScalarType1>
55 typedef NumericT value_type;
57 value_type * data_A = detail::extract_raw_pointer<value_type>(mat1);
58 value_type
const * data_B = detail::extract_raw_pointer<value_type>(mat2);
60 value_type data_alpha = alpha;
62 data_alpha = -data_alpha;
89 #ifdef VIENNACL_WITH_OPENMP
90 #pragma omp parallel for
92 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
93 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
94 wrapper_A(
row, col) = wrapper_B(
row, col) / data_alpha;
98 #ifdef VIENNACL_WITH_OPENMP
99 #pragma omp parallel for
101 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
102 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
103 wrapper_A(
row, col) = wrapper_B(
row, col) * data_alpha;
108 if (reciprocal_alpha)
110 #ifdef VIENNACL_WITH_OPENMP
111 #pragma omp parallel for
113 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
114 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
115 wrapper_A(
row, col) = wrapper_B(
row, col) / data_alpha;
119 #ifdef VIENNACL_WITH_OPENMP
120 #pragma omp parallel for
122 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
123 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
124 wrapper_A(
row, col) = wrapper_B(
row, col) * data_alpha;
130 template <
typename NumericT,
typename F,
131 typename ScalarType1,
typename ScalarType2>
136 typedef NumericT value_type;
138 value_type * data_A = detail::extract_raw_pointer<value_type>(mat1);
139 value_type
const * data_B = detail::extract_raw_pointer<value_type>(mat2);
140 value_type
const * data_C = detail::extract_raw_pointer<value_type>(mat3);
142 value_type data_alpha = alpha;
144 data_alpha = -data_alpha;
146 value_type data_beta = beta;
148 data_beta = -data_beta;
179 if (reciprocal_alpha && reciprocal_beta)
181 #ifdef VIENNACL_WITH_OPENMP
182 #pragma omp parallel for
184 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
185 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
186 wrapper_A(
row, col) = wrapper_B(
row, col) / data_alpha + wrapper_C(
row, col) / data_beta;
188 else if (reciprocal_alpha && !reciprocal_beta)
190 #ifdef VIENNACL_WITH_OPENMP
191 #pragma omp parallel for
193 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
194 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
195 wrapper_A(
row, col) = wrapper_B(
row, col) / data_alpha + wrapper_C(
row, col) * data_beta;
197 else if (!reciprocal_alpha && reciprocal_beta)
199 #ifdef VIENNACL_WITH_OPENMP
200 #pragma omp parallel for
202 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
203 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
204 wrapper_A(
row, col) = wrapper_B(
row, col) * data_alpha + wrapper_C(
row, col) / data_beta;
206 else if (!reciprocal_alpha && !reciprocal_beta)
208 #ifdef VIENNACL_WITH_OPENMP
209 #pragma omp parallel for
211 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
212 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
213 wrapper_A(
row, col) = wrapper_B(
row, col) * data_alpha + wrapper_C(
row, col) * data_beta;
218 if (reciprocal_alpha && reciprocal_beta)
220 #ifdef VIENNACL_WITH_OPENMP
221 #pragma omp parallel for
223 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
224 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
225 wrapper_A(
row, col) = wrapper_B(
row, col) / data_alpha + wrapper_C(
row, col) / data_beta;
227 else if (reciprocal_alpha && !reciprocal_beta)
229 #ifdef VIENNACL_WITH_OPENMP
230 #pragma omp parallel for
232 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
233 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
234 wrapper_A(
row, col) = wrapper_B(
row, col) / data_alpha + wrapper_C(
row, col) * data_beta;
236 else if (!reciprocal_alpha && reciprocal_beta)
238 #ifdef VIENNACL_WITH_OPENMP
239 #pragma omp parallel for
241 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
242 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
243 wrapper_A(
row, col) = wrapper_B(
row, col) * data_alpha + wrapper_C(
row, col) / data_beta;
245 else if (!reciprocal_alpha && !reciprocal_beta)
247 #ifdef VIENNACL_WITH_OPENMP
248 #pragma omp parallel for
250 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
251 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
252 wrapper_A(
row, col) = wrapper_B(
row, col) * data_alpha + wrapper_C(
row, col) * data_beta;
259 template <
typename NumericT,
typename F,
260 typename ScalarType1,
typename ScalarType2>
265 typedef NumericT value_type;
267 value_type * data_A = detail::extract_raw_pointer<value_type>(mat1);
268 value_type
const * data_B = detail::extract_raw_pointer<value_type>(mat2);
269 value_type
const * data_C = detail::extract_raw_pointer<value_type>(mat3);
271 value_type data_alpha = alpha;
273 data_alpha = -data_alpha;
275 value_type data_beta = beta;
277 data_beta = -data_beta;
312 if (reciprocal_alpha && reciprocal_beta)
314 #ifdef VIENNACL_WITH_OPENMP
315 #pragma omp parallel for
317 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
318 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
319 wrapper_A(
row, col) += wrapper_B(
row, col) / data_alpha + wrapper_C(
row, col) / data_beta;
321 else if (reciprocal_alpha && !reciprocal_beta)
323 #ifdef VIENNACL_WITH_OPENMP
324 #pragma omp parallel for
326 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
327 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
328 wrapper_A(
row, col) += wrapper_B(
row, col) / data_alpha + wrapper_C(
row, col) * data_beta;
330 else if (!reciprocal_alpha && reciprocal_beta)
332 #ifdef VIENNACL_WITH_OPENMP
333 #pragma omp parallel for
335 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
336 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
337 wrapper_A(
row, col) += wrapper_B(
row, col) * data_alpha + wrapper_C(
row, col) / data_beta;
339 else if (!reciprocal_alpha && !reciprocal_beta)
341 #ifdef VIENNACL_WITH_OPENMP
342 #pragma omp parallel for
344 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
345 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
346 wrapper_A(
row, col) += wrapper_B(
row, col) * data_alpha + wrapper_C(
row, col) * data_beta;
351 if (reciprocal_alpha && reciprocal_beta)
353 #ifdef VIENNACL_WITH_OPENMP
354 #pragma omp parallel for
356 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
357 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
358 wrapper_A(
row, col) += wrapper_B(
row, col) / data_alpha + wrapper_C(
row, col) / data_beta;
360 else if (reciprocal_alpha && !reciprocal_beta)
362 #ifdef VIENNACL_WITH_OPENMP
363 #pragma omp parallel for
365 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
366 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
367 wrapper_A(
row, col) += wrapper_B(
row, col) / data_alpha + wrapper_C(
row, col) * data_beta;
369 else if (!reciprocal_alpha && reciprocal_beta)
371 #ifdef VIENNACL_WITH_OPENMP
372 #pragma omp parallel for
374 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
375 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
376 wrapper_A(
row, col) += wrapper_B(
row, col) * data_alpha + wrapper_C(
row, col) / data_beta;
378 else if (!reciprocal_alpha && !reciprocal_beta)
380 #ifdef VIENNACL_WITH_OPENMP
381 #pragma omp parallel for
383 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
384 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
385 wrapper_A(
row, col) += wrapper_B(
row, col) * data_alpha + wrapper_C(
row, col) * data_beta;
394 template <
typename NumericT,
typename F>
397 typedef NumericT value_type;
399 value_type * data_A = detail::extract_raw_pointer<value_type>(mat);
400 value_type alpha =
static_cast<value_type
>(s);
415 #ifdef VIENNACL_WITH_OPENMP
416 #pragma omp parallel for
418 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
419 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
420 wrapper_A(
row, col) = alpha;
426 #ifdef VIENNACL_WITH_OPENMP
427 #pragma omp parallel for
429 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
430 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
431 wrapper_A(
row, col) = alpha;
439 template <
typename NumericT,
typename F>
442 typedef NumericT value_type;
444 value_type * data_A = detail::extract_raw_pointer<value_type>(mat);
445 value_type alpha =
static_cast<value_type
>(s);
458 #ifdef VIENNACL_WITH_OPENMP
459 #pragma omp parallel for
461 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
462 wrapper_A(
row,
row) = alpha;
465 template <
typename NumericT,
typename F>
468 typedef NumericT value_type;
470 value_type *data_A = detail::extract_raw_pointer<value_type>(mat);
471 value_type
const *data_vec = detail::extract_raw_pointer<value_type>(vec);
499 wrapper_A(row_start + i, col_start + i) = data_vec[v_start + i * v_inc];
503 template <
typename NumericT,
typename F>
506 typedef NumericT value_type;
508 value_type
const *data_A = detail::extract_raw_pointer<value_type>(mat);
509 value_type *data_vec = detail::extract_raw_pointer<value_type>(vec);
535 data_vec[v_start + i * v_inc] = wrapper_A(row_start + i, col_start + i);
538 template <
typename NumericT,
typename F>
541 typedef NumericT value_type;
543 value_type
const *data_A = detail::extract_raw_pointer<value_type>(mat);
544 value_type *data_vec = detail::extract_raw_pointer<value_type>(vec);
562 data_vec[v_start + j * v_inc] = wrapper_A(i, j);
565 template <
typename NumericT,
typename F>
568 typedef NumericT value_type;
570 value_type
const *data_A = detail::extract_raw_pointer<value_type>(mat);
571 value_type *data_vec = detail::extract_raw_pointer<value_type>(vec);
589 data_vec[v_start + i * v_inc] = wrapper_A(i, j);
603 template <
typename NumericT,
typename F,
typename OP>
607 typedef NumericT value_type;
610 value_type * data_A = detail::extract_raw_pointer<value_type>(A);
611 value_type
const * data_B = detail::extract_raw_pointer<value_type>(proxy.lhs());
612 value_type
const * data_C = detail::extract_raw_pointer<value_type>(proxy.rhs());
643 #ifdef VIENNACL_WITH_OPENMP
644 #pragma omp parallel for
646 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
647 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
648 OpFunctor::apply(wrapper_A(
row, col), wrapper_B(
row, col), wrapper_C(
row, col));
655 #ifdef VIENNACL_WITH_OPENMP
656 #pragma omp parallel for
658 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
659 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
660 OpFunctor::apply(wrapper_A(
row, col), wrapper_B(
row, col), wrapper_C(
row, col));
671 template <
typename NumericT,
typename F,
typename OP>
675 typedef NumericT value_type;
678 value_type * data_A = detail::extract_raw_pointer<value_type>(A);
679 value_type
const * data_B = detail::extract_raw_pointer<value_type>(proxy.lhs());
702 #ifdef VIENNACL_WITH_OPENMP
703 #pragma omp parallel for
705 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
706 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
707 OpFunctor::apply(wrapper_A(
row, col), wrapper_B(
row, col));
711 #ifdef VIENNACL_WITH_OPENMP
712 #pragma omp parallel for
714 for (
long col = 0; col < static_cast<long>(A_size2); ++col)
715 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
716 OpFunctor::apply(wrapper_A(
row, col), wrapper_B(
row, col));
736 template <
typename NumericT,
typename F>
741 typedef NumericT value_type;
743 value_type
const * data_A = detail::extract_raw_pointer<value_type>(mat);
744 value_type
const * data_x = detail::extract_raw_pointer<value_type>(vec);
745 value_type * data_result = detail::extract_raw_pointer<value_type>(result);
764 #ifdef VIENNACL_WITH_OPENMP
765 #pragma omp parallel for
767 for (
long row = 0; row < static_cast<long>(A_size1); ++
row)
770 for (
vcl_size_t col = 0; col < A_size2; ++col)
779 value_type temp = data_x[
start1];
783 for (
vcl_size_t col = 1; col < A_size2; ++col)
785 value_type temp = data_x[col * inc1 +
start1];
803 template <
typename NumericT,
typename F>
808 typedef NumericT value_type;
810 value_type
const * data_A = detail::extract_raw_pointer<value_type>(mat_trans.lhs());
811 value_type
const * data_x = detail::extract_raw_pointer<value_type>(vec);
812 value_type * data_result = detail::extract_raw_pointer<value_type>(result);
832 value_type temp = data_x[
start1];
837 for (
vcl_size_t col = 1; col < A_size1; ++col)
839 value_type temp = data_x[col * inc1 +
start1];
848 #ifdef VIENNACL_WITH_OPENMP
849 #pragma omp parallel for
851 for (
long row = 0; row < static_cast<long>(A_size2); ++
row)
854 for (
vcl_size_t col = 0; col < A_size1; ++col)
869 template <
typename A,
typename B,
typename C,
typename NumericT>
872 NumericT alpha, NumericT beta)
874 #ifdef VIENNACL_WITH_OPENMP
875 #pragma omp parallel for
877 for (
long i=0; i<static_cast<long>(C_size1); ++i)
883 temp += a(i, k) * b(k, j);
887 temp += beta * c(i,j);
900 template <
typename NumericT,
typename F1,
typename F2,
typename F3,
typename ScalarType >
907 typedef NumericT value_type;
909 value_type
const * data_A = detail::extract_raw_pointer<value_type>(A);
910 value_type
const * data_B = detail::extract_raw_pointer<value_type>(B);
911 value_type * data_C = detail::extract_raw_pointer<value_type>(C);
941 detail::prod(wrapper_A, wrapper_B, wrapper_C, C_size1, C_size2, A_size2, static_cast<value_type>(alpha), static_cast<value_type>(beta));
951 template <
typename NumericT,
typename F1,
typename F2,
typename F3,
typename ScalarType >
960 typedef NumericT value_type;
962 value_type
const * data_A = detail::extract_raw_pointer<value_type>(A.lhs());
963 value_type
const * data_B = detail::extract_raw_pointer<value_type>(B);
964 value_type * data_C = detail::extract_raw_pointer<value_type>(C);
994 detail::prod(wrapper_A, wrapper_B, wrapper_C, C_size1, C_size2, A_size1, static_cast<value_type>(alpha), static_cast<value_type>(beta));
1005 template <
typename NumericT,
typename F1,
typename F2,
typename F3,
typename ScalarType >
1012 typedef NumericT value_type;
1014 value_type
const * data_A = detail::extract_raw_pointer<value_type>(A);
1015 value_type
const * data_B = detail::extract_raw_pointer<value_type>(B.lhs());
1016 value_type * data_C = detail::extract_raw_pointer<value_type>(C);
1046 detail::prod(wrapper_A, wrapper_B, wrapper_C, C_size1, C_size2, A_size2, static_cast<value_type>(alpha), static_cast<value_type>(beta));
1056 template <
typename NumericT,
typename F1,
typename F2,
typename F3,
typename ScalarType >
1063 typedef NumericT value_type;
1065 value_type
const * data_A = detail::extract_raw_pointer<value_type>(A.lhs());
1066 value_type
const * data_B = detail::extract_raw_pointer<value_type>(B.lhs());
1067 value_type * data_C = detail::extract_raw_pointer<value_type>(C);
1097 detail::prod(wrapper_A, wrapper_B, wrapper_C, C_size1, C_size2, A_size1, static_cast<value_type>(alpha), static_cast<value_type>(beta));
1119 template <
typename NumericT,
typename F,
typename S1>
1121 S1
const & alpha,
vcl_size_t ,
bool reciprocal_alpha,
bool flip_sign_alpha,
1125 typedef NumericT value_type;
1127 value_type * data_A = detail::extract_raw_pointer<value_type>(mat1);
1128 value_type
const * data_v1 = detail::extract_raw_pointer<value_type>(vec1);
1129 value_type
const * data_v2 = detail::extract_raw_pointer<value_type>(vec2);
1146 value_type data_alpha = alpha;
1147 if (flip_sign_alpha)
1148 data_alpha = -data_alpha;
1149 if (reciprocal_alpha)
1150 data_alpha =
static_cast<value_type
>(1) / data_alpha;
1156 value_type value_v1 = data_alpha * data_v1[
row * inc1 +
start1];
1157 for (
vcl_size_t col = 0; col < A_size2; ++col)
1163 for (
vcl_size_t col = 0; col < A_size2; ++col)
1165 value_type value_v2 = data_alpha * data_v2[col * inc2 +
start2];
bool is_row_major(viennacl::row_major_tag)
Definition: common.hpp:73
std::size_t vcl_size_t
Definition: forwards.h:58
void matrix_column(const matrix_base< NumericT, F > &mat, unsigned int j, vector_base< NumericT > &vec)
Definition: matrix_operations.hpp:566
result_of::size_type< matrix_base< NumericT, F > >::type stride2(matrix_base< NumericT, F > const &s)
Definition: stride.hpp:68
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
Generic size and resize functionality for different vector and matrix types.
static vcl_size_t mem_index(vcl_size_t i, vcl_size_t j, vcl_size_t, vcl_size_t num_cols)
Returns the memory offset for entry (i,j) of a dense matrix.
Definition: forwards.h:256
void prod(A &a, B &b, C &c, vcl_size_t C_size1, vcl_size_t C_size2, vcl_size_t A_size2, NumericT alpha, NumericT beta)
Definition: matrix_operations.hpp:870
Extracts the underlying OpenCL start index handle from a vector, a matrix, an expression etc...
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
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
Worker class for decomposing expression templates.
Definition: op_applier.hpp:43
A dense matrix class.
Definition: forwards.h:290
Expression template class for representing a tree of expressions which ultimately result in a matrix...
Definition: forwards.h:283
result_of::size_type< viennacl::vector_base< T > >::type stride(viennacl::vector_base< T > const &s)
Definition: stride.hpp:46
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.
result_of::size_type< T >::type start1(T const &obj)
Definition: start.hpp:64
Determines row and column increments for matrices and matrix proxies.
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
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
void matrix_diag_from_vector(const vector_base< NumericT > &vec, int k, matrix_base< NumericT, F > &mat)
Definition: matrix_operations.hpp:466
void matrix_diag_to_vector(const matrix_base< NumericT, F > &mat, int k, vector_base< NumericT > &vec)
Definition: matrix_operations.hpp:504
result_of::size_type< matrix_base< NumericT, F > >::type stride1(matrix_base< NumericT, F > const &s)
Definition: stride.hpp:57
vcl_size_t size(VectorType const &vec)
Generic routine for obtaining the size of a vector (ViennaCL, uBLAS, etc.)
Definition: size.hpp:144
result_of::size_type< T >::type start2(T const &obj)
Definition: start.hpp:83
Helper array for accessing a strided submatrix embedded in a larger matrix.
Definition: common.hpp:100
result_of::size_type< T >::type start(T const &obj)
Definition: start.hpp:43
static vcl_size_t mem_index(vcl_size_t i, vcl_size_t j, vcl_size_t num_rows, vcl_size_t)
Returns the memory offset for entry (i,j) of a dense matrix.
Definition: forwards.h:273
Common base class for dense vectors, vector ranges, and vector slices.
Definition: forwards.h:205
vcl_size_t internal_size2(matrix_base< NumericT, F > const &mat)
Helper routine for obtaining the internal number of entries per column of a ViennaCL matrix...
Definition: size.hpp:287
Proxy classes for vectors.
vector_expression< const matrix_base< NumericT, F >, const unsigned int, op_row > row(const matrix_base< NumericT, F > &A, unsigned int i)
Definition: matrix.hpp:910
All the predicates used within ViennaCL. Checks for expressions to be vectors, etc.
Common routines for single-threaded or OpenMP-enabled execution on CPU.
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...
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
A tag class representing transposed matrices.
Definition: forwards.h:165
A tag class representing element-wise binary operations (like multiplication) on vectors or matrices...
Definition: forwards.h:86
void matrix_diagonal_assign(matrix_base< NumericT, F > &mat, NumericT s)
Definition: matrix_operations.hpp:440
vcl_size_t internal_size1(matrix_base< NumericT, F > const &mat)
Helper routine for obtaining the internal number of entries per row of a ViennaCL matrix...
Definition: size.hpp:279
Extracts the underlying OpenCL handle from a vector, a matrix, an expression etc. ...
Defines the action of certain unary and binary operators and its arguments (for host execution)...
A tag class representing element-wise unary operations (like sin()) on vectors or matrices...
Definition: forwards.h:90
Implementation of the ViennaCL scalar class.
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 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
Simple enable-if variant that uses the SFINAE pattern.