35 using namespace internal;
37 NextSamples::NextSamples(
index_t num_distributions) : m_num_blocks(0)
39 next_samples.resize(num_distributions);
45 m_num_blocks=other.m_num_blocks;
46 next_samples=other.next_samples;
50 NextSamples::~NextSamples()
55 std::vector<Block>& NextSamples::operator[](
size_t i)
57 REQUIRE(i>=0 && i<next_samples.size(),
58 "index (%d) must be between [0,%d]!\n",
59 i, next_samples.size()-1);
60 return next_samples[i];
63 const std::vector<Block>& NextSamples::operator[](
size_t i)
const 65 REQUIRE(i>=0 && i<next_samples.size(),
66 "index (%d) must be between [0,%d]!\n",
67 i, next_samples.size()-1);
68 return next_samples[i];
71 const index_t NextSamples::num_blocks()
const 76 const bool NextSamples::empty()
const 78 typedef const std::vector<Block> type;
79 return std::any_of(next_samples.cbegin(), next_samples.cend(), [](type& f) {
return f.size()==0; });
82 void NextSamples::clear()
84 typedef std::vector<Block> type;
85 std::for_each(next_samples.begin(), next_samples.end(), [](type& f) { f.clear(); });
all of classes and functions are contained in the shogun namespace
class NextSamples is the return type for next() call in DataManager. If there are no more samples (fr...