batch_constant¶
-
template<class
batch_type, typename batch_type::value_type...Values>
structxsimd::batch_constant¶ batch of integral constants
Abstract representation of a batch of integral constants.
- Template Parameters
batch_type: the type of the associated batch values.Values: constants represented by this batch
Public Functions
-
operator batch_type() const noexcept¶ Generate a batch of
batch_typefrom thisbatch_constant.
-
constexpr value_type
get(size_t i) const noexcept¶ Get the
ith element of thisbatch_constant.
-
template<class
batch_type, classG>
constexpr autoxsimd::make_batch_constant() noexcept -> decltype(detail::make_batch_constant<batch_type, G>(detail::make_index_sequence<batch_type::size>()))¶ Build a
batch_constantout of a generator function.The following generator produces a batch of
(n - 1, 0, 1, ... n-2)- Template Parameters
batch_type: type of the (non-constant) batch to buildG: type used to generate that batch. That type must have a static membergetthat’s used to generate the batch constant. Conversely, the generated batch_constant has value{G::get(0, batch_size), ... , G::get(batch_size - 1, batch_size)}
struct Rot { static constexpr unsigned get(unsigned i, unsigned n) { return (i + n - 1) % n; } };