Type conversion¶
Cast:
|
|
|
|
|
|
Conversion:
|
per slot conversion to floating point |
|
per slot conversion to integer |
- template <class T_out, class T_in, class A>
-
batch_bool<T_out, A>
xsimd::batch_bool_cast(batch_bool<T_in, A> const &x)¶ Perform a static_cast from
T_intoT_outon.- Return
xcast toT_out- Parameters
x: batch_bool ofT_in
- template <class T_out, class T_in, class A>
-
batch<T_out, A>
xsimd::batch_cast(batch<T_in, A> const &x)¶ Perform a static_cast from
T_intoT_outon.- Return
xcast toT_out- Parameters
x: batch ofT_in
- template <class T_out, class T_in, class A>
-
batch<T_out, A>
xsimd::bitwise_cast(batch<T_in, A> const &x)¶ Perform a reinterpret_cast from
T_intoT_outonx.- Return
xreinterpreted asT_out- Parameters
x: batch ofT_in
- template <class T, class A>
-
batch<as_float_t<T>, A>
xsimd::to_float(batch<T, A> const &i)¶ Perform a conversion from
ito a value of an floating point type of the same size asT.This is equivalent to
batch_cast<as_float_t<T>>(i)- Return
iconverted to a value of an floating point type of the same size asT- Parameters
i: batch of integers.
- template <class T, class A>
-
batch<as_integer_t<T>, A>
xsimd::to_int(batch<T, A> const &x)¶ Perform a conversion from
xto a value of an integer type of the same size asTThis is equivalent tobatch_cast<as_integer_t<T>>(x)- Return
xconverted to a value of an integer type of the same size asT- Parameters
x: batch.
- template <class T, class A, typename std::enable_if< std::is_integral< T >::value, int >::type = 3>
-
batch<T, A>
xsimd::bitwise_cast(batch_bool<T, A> const &self)¶ Cast a
batch_boolofTinto abatchof the same type using the following rule: if an element ofselfis true, it maps to -1 in the returned integral batch, otherwise it maps to 0.- Return
selfcast to abatchofT- Parameters
self: batch_bool ofT