SHOGUN  6.1.3
List of all members | Public Member Functions | Friends
NextSamples Class Reference

Detailed Description

class NextSamples is the return type for next() call in DataManager. If there are no more samples (from any one of the distributions), an empty instance of NextSamples is supposed to be returned. This can be verified from the caller by calling the empty() method. Otherwise, always a get() call with appropriate index would give the samples from that distribution. If an inappropriate index is provided, e.g. get(2) for a two-sample test, a runtime exception is thrown.

Example usage:

NextSamples next_samples(2);
next_samples[0] = fetchers[0].next();
next_samples[1] = fetchers[1].next();
if (!next_samples.empty())
auto first = next_samples[0];
auto second = next_samples[1];
auto third = next_samples[2]; / Runtime Error

Definition at line 68 of file NextSamples.h.

Public Member Functions

NextSamplesoperator= (const NextSamples &other)
 ~NextSamples ()
std::vector< Block > & operator[] (size_t i)
const std::vector< Block > & operator[] (size_t i) const
const index_t num_blocks () const
const bool empty () const
void clear ()


class DataManager

Constructor & Destructor Documentation

◆ ~NextSamples()


Definition at line 50 of file NextSamples.cpp.

Member Function Documentation

◆ clear()

void clear ( )

Method that clears the memory occupied by the feature objects inside.

Definition at line 82 of file NextSamples.cpp.

◆ empty()

const bool empty ( ) const

This returns true if any of the distribution fetched 0 blocks (checked from the size of the vector for that distribution)

whether this instance does not contain any blocks of samples from any of the distribution

Definition at line 76 of file NextSamples.cpp.

◆ num_blocks()

const index_t num_blocks ( ) const
number of blocks fetched from each of the distribution. It is assumed that this number is same for all the distributions.

Definition at line 71 of file NextSamples.cpp.

◆ operator=()

NextSamples & operator= ( const NextSamples other)

Assignment operator. Clears the current blocks.

Definition at line 42 of file NextSamples.cpp.

◆ operator[]() [1/2]

std::vector< Block > & operator[] ( size_t  i)

Contains a number of blocks (of samples) fetched in the current burst from a specified distribution.

idetermines samples from which distribution
a vector of fetched blocks of features from the specified distribution

Definition at line 55 of file NextSamples.cpp.

◆ operator[]() [2/2]

const std::vector< Block > & operator[] ( size_t  i) const

Const version of the above. This is called when a const instance of NextSamples is returned.

Definition at line 63 of file NextSamples.cpp.

Friends And Related Function Documentation

◆ DataManager

friend class DataManager

Definition at line 70 of file NextSamples.h.

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

SHOGUN Machine Learning Toolbox - Documentation