| 326 | */ |
| 327 | template<typename ArrayView, class Orientation = cusp::row_major> |
| 328 | class array2d_view |
| 329 | : public cusp::detail::matrix_base<int, |
| 330 | typename ArrayView::value_type, |
| 331 | typename ArrayView::memory_space, |
| 332 | cusp::array2d_format> |
| 333 | { |
| 334 | private: |
| 335 | |
| 336 | typedef cusp::detail::matrix_base<int, |
| 337 | typename ArrayView::value_type, |
| 338 | typename ArrayView::memory_space, |
| 339 | cusp::array2d_format> Parent; |
| 340 | |
| 341 | public: |
| 342 | |
| 343 | /*! \cond */ |
| 344 | typedef Orientation orientation; |
| 345 | |
| 346 | typedef ArrayView values_array_type; |
| 347 | |
| 348 | typedef cusp::array2d<typename Parent::value_type, typename Parent::memory_space, Orientation> container; |
| 349 | |
| 350 | typedef cusp::array2d_view<ArrayView, Orientation> view; |
| 351 | |
| 352 | typedef cusp::detail::row_or_column_view< |
| 353 | typename values_array_type::iterator,::cuda::std::is_same<Orientation,cusp::row_major>::value |
| 354 | > row_view_type; |
| 355 | typedef typename row_view_type::ArrayType row_view; |
| 356 | |
| 357 | typedef cusp::detail::row_or_column_view< |
| 358 | typename values_array_type::iterator,::cuda::std::is_same<Orientation,cusp::column_major>::value |
| 359 | > column_view_type; |
| 360 | typedef typename column_view_type::ArrayType column_view; |
| 361 | |
| 362 | typedef typename cusp::detail::transpose_orientation<Orientation>::type transpose_orientation; |
| 363 | typedef cusp::array2d_view<ArrayView, transpose_orientation> transpose_const_view_type; |
| 364 | /*! \endcond */ |
| 365 | |
| 366 | /*! The stride between consecutive elements along the major dimension. |
| 367 | */ |
| 368 | size_t pitch; |
| 369 | |
| 370 | /*! 1D array of values. |
| 371 | */ |
| 372 | values_array_type values; |
| 373 | |
| 374 | /*! This constructor creates an empty \p array2d vector. |
| 375 | */ |
| 376 | array2d_view(void) |
| 377 | : Parent(), pitch(0), values(0) {} |
| 378 | |
| 379 | /*! This constructor creates a array2d_view from another array2d_view. |
| 380 | * \param a array2d_view used to create this array2d_view. |
| 381 | */ |
| 382 | array2d_view(const array2d_view& a) |
| 383 | : Parent(a), pitch(a.pitch), values(a.values) {} |
| 384 | |
| 385 | // TODO handle different Orientation (pitch = major) |
nothing calls this directly
no outgoing calls
no test coverage detected