1#ifndef _DG_VECTOR_TRAITS_
2#define _DG_VECTOR_TRAITS_
5#include <thrust/memory.h>
36template<
class Vector,
class Enable=
void>
56using get_pointer_type = std::conditional_t< std::is_const< std::remove_reference_t<T> >::value,
60using get_element_type = std::conditional_t< std::is_const< std::remove_reference_t<T> >::value,
61 const typename std::decay_t<T>::value_type&,
typename std::decay_t<T>::value_type& >;
63using get_mapped_type = std::conditional_t< std::is_const< std::remove_reference_t<T> >::value,
64 const typename std::decay_t<T>::mapped_type&,
typename std::decay_t<T>::mapped_type& >;
67using get_data_type = std::conditional_t< std::is_const< std::remove_reference_t<T> >::value,
68 const typename std::decay_t<T>::container_type&,
typename std::decay_t<T>::container_type& >;
71inline get_element_type<T> do_get_vector_element( T&& v,
unsigned i,
RecursiveVectorTag)
75template<
class T,
class Key>
76inline get_mapped_type<T> do_get_vector_element( T&& v,
const Key& key, StdMapTag)
80template<
class T,
class Key>
81inline T&& do_get_vector_element( T&& v,
const Key& i, AnyScalarTag){
82 return std::forward<T>(v);
86inline get_data_type<T> do_get_data( T&& v, MPIVectorTag)
91inline T&& do_get_data( T&& v, AnyScalarTag){
92 return std::forward<T>(v);
96inline get_pointer_type<T> do_get_pointer_or_reference( T&& v, AnyVectorTag)
98 return thrust::raw_pointer_cast(v.data());
101inline T&& do_get_pointer_or_reference( T&& v, AnyScalarTag){
102 return std::forward<T>(v);
typename TensorTraits< std::decay_t< Vector > >::tensor_category get_tensor_category
Definition tensor_traits.h:47
typename TensorTraits< std::decay_t< Vector > >::execution_policy get_execution_policy
Definition tensor_traits.h:49
typename TensorTraits< std::decay_t< Vector > >::value_type get_value_type
Definition tensor_traits.h:45
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
Indicate that a type does not have an execution policy.
Definition execution_policy.h:20
Indicate that a type is not a tensor.
Definition matrix_categories.h:13
This tag indicates composition/recursion.
Definition vector_categories.h:62
The vector traits.
Definition tensor_traits.h:38
void value_type
Definition tensor_traits.h:39