46 #ifndef _ZOLTAN2_TPLTRAITS_HPP_ 47 #define _ZOLTAN2_TPLTRAITS_HPP_ 49 #include <Teuchos_RCP.hpp> 50 #include <Teuchos_ArrayView.hpp> 51 #include <Teuchos_as.hpp> 66 template <
typename tpl_t,
typename zno_t>
72 return ((
sizeof(tpl_t) ==
sizeof(zno_t)) &&
73 (std::numeric_limits<tpl_t>::is_signed ==
74 std::numeric_limits<zno_t>::is_signed));
78 const RCP<const Environment> &env)
82 a = Teuchos::asSafe<tpl_t, zno_t>(b);
84 catch (std::exception &e) {
85 env->localInputAssertion(__FILE__, __LINE__,
86 "Value too large for TPL index type. " 87 "Rebuild TPL with larger index type or rebuild without the TPL.",
93 const RCP<const Environment> &env)
96 size_t size = b.size();
99 for (
size_t i = 0; i < size; i++)
ASSIGN_TPL_T((*a)[i], b[i], env);
125 template <
typename tpl_t>
131 const RCP<const Environment> &env)
135 const RCP<const Environment> &env)
138 *a = const_cast<tpl_t *> (b.getRawPtr());
static bool OK_TO_CAST_TPL_T()
static void DELETE_TPL_T_ARRAY(tpl_t **a)
fast typical checks for valid arguments
static void DELETE_TPL_T_ARRAY(tpl_t **a)
static void ASSIGN_TPL_T(tpl_t &a, zno_t b, const RCP< const Environment > &env)
static void ASSIGN_TPL_T(tpl_t &a, tpl_t b, const RCP< const Environment > &env)
static void ASSIGN_TPL_T_ARRAY(tpl_t **a, ArrayView< const tpl_t > &b, const RCP< const Environment > &env)
static bool OK_TO_CAST_TPL_T()
static void ASSIGN_TPL_T_ARRAY(tpl_t **a, ArrayView< const zno_t > &b, const RCP< const Environment > &env)
Gathering definitions used in software development.
Defines the Environment class.