1#ifndef _DG_VECTOR_TRAITS_
2#define _DG_VECTOR_TRAITS_
5#include <thrust/memory.h>
29template<
class Vector,
class Enable=
void>
49using get_pointer_type = std::conditional_t< std::is_const< std::remove_reference_t<T> >::value,
53using get_element_type = std::conditional_t< std::is_const< std::remove_reference_t<T> >::value,
54 const typename std::decay_t<T>::value_type&,
typename std::decay_t<T>::value_type& >;
56using get_mapped_type = std::conditional_t< std::is_const< std::remove_reference_t<T> >::value,
57 const typename std::decay_t<T>::mapped_type&,
typename std::decay_t<T>::mapped_type& >;
60using get_data_type = std::conditional_t< std::is_const< std::remove_reference_t<T> >::value,
61 const typename std::decay_t<T>::container_type&,
typename std::decay_t<T>::container_type& >;
64inline get_element_type<T> do_get_vector_element( T&& v,
unsigned i,
RecursiveVectorTag)
68template<
class T,
class Key>
69inline get_mapped_type<T> do_get_vector_element( T&& v,
const Key& key, StdMapTag)
73template<
class T,
class Key>
74inline T&& do_get_vector_element( T&& v,
const Key& i, AnyScalarTag){
75 return std::forward<T>(v);
79inline get_data_type<T> do_get_data( T&& v, MPIVectorTag)
84inline T&& do_get_data( T&& v, AnyScalarTag){
85 return std::forward<T>(v);
89inline get_pointer_type<T> do_get_pointer_or_reference( T&& v, AnyVectorTag)
91 return thrust::raw_pointer_cast(v.data());
94inline T&& do_get_pointer_or_reference( T&& v, AnyScalarTag){
95 return std::forward<T>(v);
typename TensorTraits< std::decay_t< Vector > >::tensor_category get_tensor_category
Definition: tensor_traits.h:40
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...
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:31
void value_type
Definition: tensor_traits.h:32