E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ zip

eve::zip = functor<zip_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
constexpr auto zip(scalar_value auto... parts) noexcept; //1
constexpr auto zip(as<Target> t, scalar_value auto... parts) noexcept; //2
constexpr auto zip()(simd_value auto... parts) noexcept; //3
constexpr auto zip(as<Target> t, simd_value auto... parts) noexcept; //4
}
Specify that a type represents a scalar value The concept scalar_value<T> is satisfied if and only if...
Definition: scalar.hpp:127
Specifies that a type is a SIMD type. The concept simd_value<T> is satisfied if and only if T satisfi...
Definition: vectorized.hpp:33
constexpr auto zip
Callable for SoA value constructions.
Definition: zip.hpp:85
EVE Main Namespace.
Definition: abi.hpp:18
Lightweight type-wrapper.
Definition: as.hpp:29

Parameters

  • parts: Variadic list of value to zip together.
  • t: Type wrapper instance embedding the type to construct from parts.

Return value

  1. a kumi::tuple made from all the scalars passed as argument.
  2. a Target instance made from all the scalars passed as argument.
  3. a kumi::tuple made from all the SIMD values passed as argument.
  4. a Target instance made from all the SIMD values passed as argument.

Example

// revision 1
#include <eve/module/core.hpp>
#include <iostream>
struct data_block : eve::struct_support<data_block, float, std::int16_t,double>
{
friend std::ostream& operator<<(std::ostream& os, data_block const& d)
{
return os << "{" << get<0>(d) << " x " << get<1>(d) << " - " << get<2>(d) << "}";
}
};
int main()
{
using card_t = eve::cardinal_t<eve::wide<double>>;
eve::wide<double> wd = [](auto i, auto) { return 1.25 * (i+1); };
eve::wide<float , card_t> wf = [](auto i, auto) { return 1.f/(1+i); };
eve::wide<std::int16_t, card_t> wi = [](auto i, auto) { return i+1; };
std::cout << "-> zip(wf0,wi,wd) = " << eve::zip(wf,wi,wd) << std::endl;
std::cout << "-> zip(eve::as<data_block>(),wf,wi,wd)) = " << eve::zip(eve::as<data_block>(),wf,wi,wd) << std::endl;
}
CRTP base-class to declare operators for user-defined product type.
Definition: product_type.hpp:154
Wrapper for SIMD registers.
Definition: wide.hpp:71