12#ifndef __cxz_utils_h__
13#define __cxz_utils_h__
21 template <
typename T, SizeT N>
24 return iter<0,N>( [&](
auto i) {
return std::get<i>(a); },
25 [](
const auto&...
e) {
return Vector<T> {
e... }; } );
40 template <
typename T, SizeT N1, SizeT N2>
44 ( [&](
auto i) {
if constexpr(
i <
N1) {
return std::get<i>(
a1); }
else {
return std::get<
i-
N1>(
a2); } },
48 template <
typename T, SizeT N1>
52 ( [&](
auto i) {
return std::get<i>(
a1); },
56 template <
typename T, SizeT N1>
60 ( [&](
auto i) {
return std::get<i>(
a2); },
70 template <
typename T, SizeT N2>
74 std::copy(
a1.begin(),
a1.end(), o.begin());
75 std::copy(
a2.begin(),
a2.end(), o.begin()+
a1.size());
79 template <
typename T, SizeT N1>
83 std::copy(
a1.begin(),
a1.end(), o.begin());
84 std::copy(
a2.begin(),
a2.end(), o.begin()+
N1);
92 std::copy(
a1.begin(),
a1.end(), o.begin());
93 std::copy(
a2.begin(),
a2.end(), o.begin()+
a1.size());
105 template <
typename T, SizeT N1>
109 o.insert(o.end(),
a2.begin(),
a2.end());
113 template <
typename T1,
typename T2,
typename...
Ts>
116 if constexpr(
sizeof...(Ts) != 0){
124 template <
typename T, SizeT N>
127 return iter<0,N>( [&](
auto i) {
return std::get<i>(a) *
b; },
128 [](
const auto&...
e) {
return Arr<T,N> {
e... }; } );
131 template <
typename T>
135 std::transform(a.begin(), a.end(), o.begin(), [&](
const auto& x) { return x*b; } );
139 template <
typename T>
decltype(auto) concat(const T1 &a1, const T2 &a2, const Ts &... as)
constexpr Arr< T, N1+N2 > cat2(const Arr< T, N1 > &a1, const Arr< T, N2 > &a2)
std::vector< T, Allocator< T > > Vector
Sptr< Range > rangeCast(const RangePtr r)
constexpr Arr< T, N > mul(const Arr< T, N > &a, const T &b)
Vector< T > toVec(const Arr< T, N > &a)
Declaration of all library types.