42#ifndef KOKKOS_ARITHTRAITS_MP_VECTOR_HPP
43#define KOKKOS_ARITHTRAITS_MP_VECTOR_HPP
46#include "Kokkos_ArithTraits.hpp"
47#include "KokkosBatched_Vector.hpp"
56class ArithTraits<
Sacado::MP::Vector<S> > {
62 typedef ArithTraits<base_value_type>
BAT;
64#ifdef HAVE_STOKHOS_ENSEMBLE_REDUCT
65 typedef typename BAT::mag_type
mag_type;
79 res = res || BAT::isInf(x.fastAccessCoeff(i));
85 res = res || BAT::isInf(x.fastAccessCoeff(i));
90#ifdef HAVE_STOKHOS_ENSEMBLE_REDUCT
93 n += BAT::abs( x.fastAccessCoeff(i) );
97 n.fastAccessCoeff(i) = BAT::abs( x.fastAccessCoeff(i) );
117 y.fastAccessCoeff(i) = BAT::real(x.fastAccessCoeff(i));
124 y.fastAccessCoeff(i) = BAT::imag(x.fastAccessCoeff(i));
131 y.fastAccessCoeff(i) = BAT::conj(x.fastAccessCoeff(i));
136 return std::pow(x, y);
145 return std::log10(x);
151 return BAT::epsilon();
158 typedef typename Sacado::mpl::apply<S,ordinal_type,base_half_precision>::type
half_storage;
159 typedef typename Sacado::mpl::apply<S,ordinal_type,base_double_precision>::type
double_storage;
176 return Sacado::StringName<val_type>::eval();
187 static KOKKOS_FORCEINLINE_FUNCTION
int base () {
193 static KOKKOS_FORCEINLINE_FUNCTION
int t () {
199 static KOKKOS_FORCEINLINE_FUNCTION
int emin () {
205 static KOKKOS_FORCEINLINE_FUNCTION
int emax () {
217 template <
typename S>
218 struct MagnitudeScalarType<
Sacado::MP::Vector<S> > {
220 typedef typename Kokkos::ArithTraits<val_type>::mag_type
type;
Sacado::mpl::apply< S, ordinal_type, base_half_precision >::type half_storage
static KOKKOS_FORCEINLINE_FUNCTION int emin()
static KOKKOS_FORCEINLINE_FUNCTION mag_type rmax()
static KOKKOS_FORCEINLINE_FUNCTION bool isNan(const val_type &x)
ArithTraits< base_value_type > BAT
static const bool is_exact
static KOKKOS_FORCEINLINE_FUNCTION val_type max()
static KOKKOS_FORCEINLINE_FUNCTION mag_type sfmin()
static KOKKOS_FORCEINLINE_FUNCTION mag_type magnitude(const val_type &x)
Sacado::mpl::apply< S, ordinal_type, base_double_precision >::type double_storage
static KOKKOS_FORCEINLINE_FUNCTION val_type log(const val_type &x)
static KOKKOS_FORCEINLINE_FUNCTION int emax()
Sacado::MP::Vector< half_storage > halfPrecision
static KOKKOS_FORCEINLINE_FUNCTION val_type squareroot(const val_type &x)
Sacado::MP::Vector< double_storage > doublePrecision
static const bool isOrdinal
val_type::value_type base_value_type
static KOKKOS_FORCEINLINE_FUNCTION mag_type rnd()
static KOKKOS_FORCEINLINE_FUNCTION val_type sqrt(const val_type &x)
static KOKKOS_FORCEINLINE_FUNCTION val_type log10(const val_type &x)
static KOKKOS_FORCEINLINE_FUNCTION val_type min()
static KOKKOS_FORCEINLINE_FUNCTION mag_type abs(const val_type &x)
static KOKKOS_FORCEINLINE_FUNCTION val_type real(const val_type &x)
val_type::ordinal_type ordinal_type
static KOKKOS_FORCEINLINE_FUNCTION val_type pow(const val_type &x, const val_type &y)
static KOKKOS_FORCEINLINE_FUNCTION val_type zero()
static KOKKOS_FORCEINLINE_FUNCTION bool isInf(const val_type &x)
Sacado::MP::Vector< S > val_type
static KOKKOS_FORCEINLINE_FUNCTION val_type one()
static const bool is_signed
static KOKKOS_FORCEINLINE_FUNCTION val_type conj(const val_type &x)
static KOKKOS_FORCEINLINE_FUNCTION mag_type epsilon()
static const bool hasMachineParameters
static bool isnaninf(const val_type &x)
static const bool is_complex
BAT::doublePrecision base_double_precision
static const bool isComparable
static KOKKOS_FORCEINLINE_FUNCTION val_type nan()
static const bool is_specialized
static KOKKOS_FORCEINLINE_FUNCTION mag_type rmin()
static KOKKOS_FORCEINLINE_FUNCTION val_type imag(const val_type &x)
static KOKKOS_FORCEINLINE_FUNCTION mag_type prec()
static const bool isComplex
static KOKKOS_FORCEINLINE_FUNCTION int t()
static std::string name()
BAT::halfPrecision base_half_precision
static KOKKOS_FORCEINLINE_FUNCTION int base()
static KOKKOS_FORCEINLINE_FUNCTION val_type conjugate(const val_type &x)
static KOKKOS_FORCEINLINE_FUNCTION mag_type eps()
static const bool is_integer
Sacado::MP::Vector< S > val_type
Kokkos::ArithTraits< val_type >::mag_type type