pulsatrix
Loading...
Searching...
No Matches
pulsatrix::SequentialSampler Class Reference

Visits indices [0, dataset_size) in ascending order. More...

#include <sampler.hpp>

Inheritance diagram for pulsatrix::SequentialSampler:
Collaboration diagram for pulsatrix::SequentialSampler:

Public Member Functions

void reset (int64_t dataset_size) override
 Begins a new epoch over a dataset of the given size.
 
std::optional< int64_t > next () override
 Fetches the next index in this epoch's order.
 
- Public Member Functions inherited from pulsatrix::Sampler
virtual ~Sampler ()=default
 

Detailed Description

Visits indices [0, dataset_size) in ascending order.

Member Function Documentation

◆ next()

std::optional< int64_t > pulsatrix::SequentialSampler::next ( )
overridevirtual

Fetches the next index in this epoch's order.

Returns
The next index, or std::nullopt once every index has been produced.

Implements pulsatrix::Sampler.

◆ reset()

void pulsatrix::SequentialSampler::reset ( int64_t  dataset_size)
overridevirtual

Begins a new epoch over a dataset of the given size.

Parameters
dataset_sizeNumber of samples to produce indices for. Must be >= 0 – internal invariant (PULSATRIX_ASSERT, not throw): DataLoader always calls this with Dataset::size()'s return value directly, never unvalidated external input.

Implements pulsatrix::Sampler.


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