E.V.E
v2023.02.15
Loading...
Searching...
No Matches
◆
zip
auto eve::zip =
functor
<zip_t>
inline
constexpr
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
}
eve::scalar_value
Specify that a type represents a scalar value The concept scalar_value<T> is satisfied if and only if...
Definition
scalar.hpp:138
eve::simd_value
Specifies that a type is a SIMD type. The concept simd_value<T> is satisfied if and only if T satisfi...
Definition
vectorized.hpp:34
eve::zip
constexpr auto zip
Callable for SoA value constructions.
Definition
zip.hpp:85
eve
EVE Main Namespace.
Definition
abi.hpp:19
eve::as
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
a kumi::tuple made from all the scalars passed as argument.
a
Target
instance made from all the scalars passed as argument.
a kumi::tuple made from all the SIMD values passed as argument.
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) {
return
1.25 * (i+1); };
eve::wide<float , card_t>
wf = [](
auto
i) {
return
1.f/(1+i); };
eve::wide<std::int16_t, card_t>
wi = [](
auto
i) {
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;
}
eve::struct_support
CRTP base-class to declare operators for user-defined product type.
Definition
product_type.hpp:148
eve::wide
Wrapper for SIMD registers.
Definition
wide.hpp:94
eve