Compute Library
 22.11
ZipDataset< T, U > Class Template Reference

Implementation of a dataset representing pairs of values of the input datasets. More...

#include <ZipDataset.h>

Collaboration diagram for ZipDataset< T, U >:
[legend]

Data Structures

struct  iterator
 Iterator for the dataset. More...
 

Public Types

using type = decltype(std::tuple_cat(*std::declval< iter1_type >(), *std::declval< iter2_type >()))
 Type of the dataset. More...
 

Public Member Functions

 ZipDataset (T &&dataset1, U &&dataset2)
 Construct dataset from the given datasets. More...
 
 ZipDataset (ZipDataset &&)=default
 Allow instances of this class to be move constructed. More...
 
iterator begin () const
 Iterator pointing at the begin of the dataset. More...
 
int size () const
 Size of the dataset. More...
 
- Public Member Functions inherited from Dataset
 Dataset (Dataset &&)=default
 Allow instances of this class to be move constructed. More...
 

Detailed Description

template<typename T, typename U>
class arm_compute::test::framework::dataset::ZipDataset< T, U >

Implementation of a dataset representing pairs of values of the input datasets.

For example, for the inputs {1, 2} and {3, 4} this dataset virtually represents the values {(1, 3), (1, 4)}.

Definition at line 47 of file ZipDataset.h.

Member Typedef Documentation

◆ type

using type = decltype(std::tuple_cat(*std::declval<iter1_type>(), *std::declval<iter2_type>()))

Type of the dataset.

Definition at line 69 of file ZipDataset.h.

Constructor & Destructor Documentation

◆ ZipDataset() [1/2]

ZipDataset ( T &&  dataset1,
U &&  dataset2 
)
inline

Construct dataset from the given datasets.

Parameters
[in]dataset1First dataset.
[in]dataset2Second dataset.

Definition at line 59 of file ZipDataset.h.

60  : _dataset1{ std::forward<T>(dataset1) },
61  _dataset2{ std::forward<U>(dataset2) }
62  {
63  }

◆ ZipDataset() [2/2]

ZipDataset ( ZipDataset< T, U > &&  )
default

Allow instances of this class to be move constructed.

Member Function Documentation

◆ begin()

iterator begin ( ) const
inline

Iterator pointing at the begin of the dataset.

Returns
Iterator for the dataset.

Definition at line 122 of file ZipDataset.h.

References ZipDataset< T, U >::iterator::iterator().

123  {
124  return iterator(_dataset1.begin(), _dataset2.begin());
125  }

◆ size()

int size ( ) const
inline

Size of the dataset.

Returns
Number of values in the dataset.

Definition at line 131 of file ZipDataset.h.

References arm_compute::utils::cast::U.

132  {
133  return std::min(_dataset1.size(), _dataset2.size());
134  }

The documentation for this class was generated from the following file: