3#include <cusp/array1d.h>
41template<
class ThrustVector >
44 using iterator = std::conditional_t<std::is_const<ThrustVector>::value,
45 typename ThrustVector::const_iterator,
46 typename ThrustVector::iterator>;
48 using pointer = std::conditional_t<std::is_const<ThrustVector>::value,
49 typename ThrustVector::const_pointer,
50 typename ThrustVector::pointer>;
53 View(
void): m_ptr(), m_size(0){}
61 template<
class OtherView>
65 template<
class InputIterator>
77 template<
class InputIterator>
132 std::swap( m_ptr, src.m_ptr);
133 std::swap( m_size, src.m_size);
144template<
class ThrustVector>
typename TensorTraits< std::decay_t< Vector > >::value_type get_value_type
Definition: tensor_traits.h:38
typename TensorTraits< std::decay_t< Vector > >::execution_policy get_execution_policy
Definition: tensor_traits.h:42
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
get_value_type< ThrustVector > value_type
Definition: view.h:147
get_execution_policy< ThrustVector > execution_policy
Definition: view.h:149
The vector traits.
Definition: tensor_traits.h:31
Indicate thrust/std - like behaviour.
Definition: vector_categories.h:88
A vector view class, usable in dg functions.
Definition: view.h:43
View(OtherView &src)
Construct from another View or Vector.
Definition: view.h:62
unsigned size() const
Get the size.
Definition: view.h:123
typename ThrustVector::const_iterator const_iterator
Definition: view.h:47
iterator end() const
Iterator to the end.
Definition: view.h:109
View(void)
Initialize empty view.
Definition: view.h:53
void swap(View &src)
Swap pointer and size with another View.
Definition: view.h:131
const_iterator cbegin() const
const Iterator to the beginning
Definition: view.h:102
pointer data() const
Constant Reference of the pointer.
Definition: view.h:88
std::conditional_t< std::is_const< ThrustVector >::value, typename ThrustVector::const_iterator, typename ThrustVector::iterator > iterator
Definition: view.h:46
iterator begin() const
Iterator to the beginning.
Definition: view.h:95
void construct(InputIterator data, unsigned size)
Construct view from pointer and size.
Definition: view.h:78
const_iterator cend() const
const Iterator to the end
Definition: view.h:116
std::conditional_t< std::is_const< ThrustVector >::value, typename ThrustVector::const_pointer, typename ThrustVector::pointer > pointer
Definition: view.h:50
View(InputIterator data, unsigned size)
Construct view from pointer and size.
Definition: view.h:66
typename ThrustVector::const_pointer const_pointer
Definition: view.h:51