1 #ifndef VIENNACL_LINALG_HOST_BASED_COMMON_HPP_
2 #define VIENNACL_LINALG_HOST_BASED_COMMON_HPP_
35 template <
typename T,
typename VectorType>
41 template <
typename T,
typename VectorType>
48 template <
typename NumericT>
63 return A_[i * inc_ + start_];
80 typedef typename T::ERROR_UNRECOGNIZED_MAJORITY_CATEGORTY_TAG
type;
99 template <
typename NumericT,
typename MajorityCategory,
bool is_transposed>
112 start1_(start1), start2_(start2),
113 inc1_(inc1), inc2_(inc2),
114 internal_size1_(internal_size1), internal_size2_(internal_size2) {}
118 return A_[F::mem_index(i * inc1_ + start1_, j * inc2_ + start2_, internal_size1_, internal_size2_)];
129 template <
typename NumericT,
typename MajorityCategory>
130 class matrix_array_wrapper<NumericT, MajorityCategory, true>
132 typedef typename majority_struct_for_orientation<MajorityCategory>::type F;
142 start1_(start1), start2_(start2),
143 inc1_(inc1), inc2_(inc2),
144 internal_size1_(internal_size1), internal_size2_(internal_size2) {}
148 return A_[F::mem_index(j * inc1_ + start1_, i * inc2_ + start2_, internal_size1_, internal_size2_)];
T::ERROR_UNRECOGNIZED_MAJORITY_CATEGORTY_TAG type
Definition: common.hpp:80
bool is_row_major(viennacl::row_major_tag)
Definition: common.hpp:73
Helper class for accessing a strided subvector of a larger vector.
Definition: common.hpp:49
std::size_t vcl_size_t
Definition: forwards.h:58
T * extract_raw_pointer(VectorType &vec)
Definition: common.hpp:36
result_of::size_type< T >::type start1(T const &obj)
Definition: start.hpp:64
vector_array_wrapper(value_type *A, vcl_size_t start, vcl_size_t inc)
Definition: common.hpp:54
NumericT value_type
Definition: common.hpp:52
value_type & operator()(vcl_size_t i)
Definition: common.hpp:61
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
Returns the row_major or column_major class of a dense matrix based on the majority-tag (layout-tag) ...
Definition: common.hpp:78
Tag class for indicating column-major layout of a matrix. Not passed to the matrix directly...
Definition: forwards.h:243
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
NumericT value_type
Definition: common.hpp:105
Tag class for indicating row-major layout of a matrix. Not passed to the matrix directly, see row_major type.
Definition: forwards.h:241
A tag for column-major storage of a dense matrix.
Definition: forwards.h:263
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. ...
value_type & operator()(vcl_size_t i, vcl_size_t j)
Definition: common.hpp:116
viennacl::backend::mem_handle::ram_handle_type & ram_handle(T &obj)
Generic helper routine for extracting the RAM handle of a ViennaCL object. Non-const version...
Definition: handle.hpp:138
A tag for row-major storage of a dense matrix.
Definition: forwards.h:246
matrix_array_wrapper(value_type *A, vcl_size_t start1, vcl_size_t start2, vcl_size_t inc1, vcl_size_t inc2, vcl_size_t internal_size1, vcl_size_t internal_size2)
Definition: common.hpp:107