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

Implementation of a dataset representing all combinations of values of the input datasets. More...

#include <CartesianProductDataset.h>

Collaboration diagram for CartesianProductDataset< 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

 CartesianProductDataset (T &&dataset1, U &&dataset2)
 Construct dataset from the given datasets. More...
 
 CartesianProductDataset (CartesianProductDataset &&)=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::CartesianProductDataset< T, U >

Implementation of a dataset representing all combinations 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), (2, 3), (2, 4)}.

Definition at line 47 of file CartesianProductDataset.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 71 of file CartesianProductDataset.h.

Constructor & Destructor Documentation

◆ CartesianProductDataset() [1/2]

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

Construct dataset from the given datasets.

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

Definition at line 61 of file CartesianProductDataset.h.

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

◆ CartesianProductDataset() [2/2]

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 153 of file CartesianProductDataset.h.

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

154  {
155  return iterator(&_dataset1, &_dataset2);
156  }

◆ size()

int size ( ) const
inline

Size of the dataset.

Returns
Number of values in the dataset.

Definition at line 162 of file CartesianProductDataset.h.

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

Referenced by CartesianProductDataset< T, U >::iterator::operator++().

163  {
164  return _dataset1.size() * _dataset2.size();
165  }

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