1 #ifndef VIENNACL_LINALG_HOST_BASED_COMMON_HPP_
2 #define VIENNACL_LINALG_HOST_BASED_COMMON_HPP_
36 template<
typename ResultT,
typename VectorT>
42 template<
typename ResultT,
typename VectorT>
49 template<
typename NumericT>
72 template<
typename NumericT,
typename LayoutT,
bool is_transposed>
83 start1_(start1), start2_(start2),
84 inc1_(inc1), inc2_(inc2),
85 internal_size1_(internal_size1), internal_size2_(internal_size2) {}
89 return A_[LayoutT::mem_index(i * inc1_ + start1_,
91 internal_size1_, internal_size2_)];
97 value_type &
operator()(
long i,
long j) {
return operator()(static_cast<vcl_size_t>(i), static_cast<vcl_size_t>(j)); }
107 template<
typename NumericT,
typename LayoutT>
108 class matrix_array_wrapper<
NumericT, LayoutT, true>
118 start1_(start1), start2_(start2),
119 inc1_(inc1), inc2_(inc2),
120 internal_size1_(internal_size1), internal_size2_(internal_size2) {}
125 return A_[LayoutT::mem_index(j * inc1_ + start1_,
127 internal_size1_, internal_size2_)];
133 value_type &
operator()(
long i,
long j) {
return operator()(static_cast<vcl_size_t>(i), static_cast<vcl_size_t>(j)); }
value_type & operator()(vcl_size_t i, vcl_size_t j)
Helper class for accessing a strided subvector of a larger vector.
value_type & operator()(long i, long j)
value_type & operator()(vcl_size_t i, long j)
vcl_size_t internal_size1(matrix_base< NumericT > const &mat)
Helper routine for obtaining the internal number of entries per row of a ViennaCL matrix...
value_type & operator()(long i, vcl_size_t j)
vcl_size_t internal_size2(matrix_base< NumericT > const &mat)
Helper routine for obtaining the internal number of entries per column of a ViennaCL matrix...
result_of::size_type< T >::type start1(T const &obj)
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
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)
result_of::size_type< T >::type start2(T const &obj)
Helper array for accessing a strided submatrix embedded in a larger matrix.
result_of::size_type< T >::type start(T const &obj)
vector_array_wrapper(value_type *A, vcl_size_t start, vcl_size_t inc)
value_type & operator()(vcl_size_t i)
ResultT * extract_raw_pointer(VectorT &vec)
Extracts the underlying OpenCL handle from a vector, a matrix, an expression etc. ...
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...