Skip to main content

Neuralyzer::Transforms::V2::FlatZipView

Neuralyzer::Transforms::V2::FlatZipView

A view that zips two time-ordered ranges with time synchronization and broadcasting. More…

#include <FlatZipView.hpp>

Public Classes

Name
class Iterator

Public Types

Name
using std::ranges::range_value_t< Range1 > Elem1
using std::ranges::range_value_t< Range2 > Elem2
using typename DataExtractor< Elem1 >::type Data1
using typename DataExtractor< Elem2 >::type Data2
using std::tuple< TimeFrameIndex, Data1 const &, Data2 const & > value_type

Public Functions

Name
template <typename R1 ,typename R2 >
FlatZipView(R1 && range1, R2 && range2)
Construct from two ranges (materializes them into vectors).
auto begin() const
auto end() const
bool empty() const

Detailed Description

template <typename Range1 ,
typename Range2 >
class Neuralyzer::Transforms::V2::FlatZipView;

A view that zips two time-ordered ranges with time synchronization and broadcasting.

Works with ranges from RaggedTimeSeries::elements() or flattened_data(). Handles three cases:

  1. 1:1 matching: Both ranges have the same number of entries at each time
  2. Broadcast left: Left has 1 entry at time, right has N entries - broadcast left to all right
  3. Broadcast right: Right has 1 entry at time, left has N entries - broadcast right to all left

Skips times that only exist in one range.

Usage: // Using elements() from RaggedTimeSeries for (auto [time, line, point] : FlatZipView(lines->elements(), points->elements())) { // process line and point at time }

// Can also create from materialized vectors auto line_elements = lines->elements() | std::ranges::to(); auto point_elements = points->elements() | std::ranges::to(); for (auto [time, line, point] : FlatZipView(line_elements, point_elements)) { // … }

Public Types Documentation

using Elem1

using Neuralyzer::Transforms::V2::FlatZipView< Range1, Range2 >::Elem1 =  std::ranges::range_value_t<Range1>;

using Elem2

using Neuralyzer::Transforms::V2::FlatZipView< Range1, Range2 >::Elem2 =  std::ranges::range_value_t<Range2>;

using Data1

using Neuralyzer::Transforms::V2::FlatZipView< Range1, Range2 >::Data1 =  typename DataExtractor<Elem1>::type;

using Data2

using Neuralyzer::Transforms::V2::FlatZipView< Range1, Range2 >::Data2 =  typename DataExtractor<Elem2>::type;

using value_type

using Neuralyzer::Transforms::V2::FlatZipView< Range1, Range2 >::value_type =  std::tuple<TimeFrameIndex, Data1 const &, Data2 const &>;

Public Functions Documentation

function FlatZipView

template <typename R1 ,
typename R2 >
inline FlatZipView(
    R1 && range1,
    R2 && range2
)

Construct from two ranges (materializes them into vectors).

The ranges are materialized to allow random access during iteration. This works with any input range, including lazy views from elements().

function begin

inline auto begin() const

function end

inline auto end() const

function empty

inline bool empty() const

Updated on 2026-11-13 at 20:25:41 +0000