Compute Library
 22.11
RangeDataset< T > Class Template Referencefinal

Implementation of a dataset created from a range of values. More...

#include <RangeDataset.h>

Collaboration diagram for RangeDataset< T >:
[legend]

Data Structures

struct  iterator
 Iterator for the dataset. More...
 

Public Types

using type = std::tuple< T >
 Type of the dataset. More...
 

Public Member Functions

 RangeDataset (std::string name, T start, T end, T step=1)
 Construct dataset with given name and values in the specified range. More...
 
 RangeDataset (RangeDataset &&)=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 NamedDataset
 NamedDataset (NamedDataset &&)=default
 Allow instances of this class to be move constructed. More...
 
std::string name () const
 Return name 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>
class arm_compute::test::framework::dataset::RangeDataset< T >

Implementation of a dataset created from a range of values.

The range is inclusive of the first value but exclusive of the last, i.e. [start, end).

Definition at line 48 of file RangeDataset.h.

Member Typedef Documentation

◆ type

using type = std::tuple<T>

Type of the dataset.

Definition at line 67 of file RangeDataset.h.

Constructor & Destructor Documentation

◆ RangeDataset() [1/2]

RangeDataset ( std::string  name,
start,
end,
step = 1 
)
inline

Construct dataset with given name and values in the specified range.

Parameters
[in]nameDescription of the values.
[in]startBegin of the range.
[in]endEnd of the range.
[in]stepStep size.

Definition at line 58 of file RangeDataset.h.

References arm_compute::mlgo::parser::end(), and arm_compute::cpu::step.

59  : NamedDataset{ std::move(name) }, _start{ start }, _end{ end }, _step{ step }
60  {
61  }
void end(TokenStream &in, bool &valid)
Definition: MLGOParser.cpp:290
constexpr int step
Definition: fp32.cpp:35
std::string name() const
Return name of the dataset.
Definition: Dataset.h:79
NamedDataset(NamedDataset &&)=default
Allow instances of this class to be move constructed.

◆ RangeDataset() [2/2]

RangeDataset ( RangeDataset< T > &&  )
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 RangeDataset.h.

References RangeDataset< T >::iterator::iterator(), and NamedDataset::name().

123  {
124  return iterator(name(), _start, _step);
125  }
std::string name() const
Return name of the dataset.
Definition: Dataset.h:79

◆ size()

int size ( ) const
inline

Size of the dataset.

Returns
Number of values in the dataset.

Definition at line 131 of file RangeDataset.h.

132  {
133  return (_end - _start) / std::abs(_step);
134  }

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