1#ifndef TATAMI_TEST_CREATE_INDEXED_SUBSET_HPP
2#define TATAMI_TEST_CREATE_INDEXED_SUBSET_HPP
35template<
typename Index_>
37 auto ptr =
new std::vector<Index_>;
40 Index_ start = extent * relative_start;
41 if (start >= extent) {
45 ptr->push_back(Fix(start));
47 std::uniform_real_distribution udist;
48 for (Index_ i = start + 1; i < extent; ++i) {
49 if (udist(rng) < probability) {
50 ptr->push_back(Fix(i));
Utilities for testing tatami libraries.
Definition create_indexed_subset.hpp:16
tatami::VectorPtr< Index_ > create_indexed_subset(const Index_ extent, const double relative_start, const double probability, const SeedType seed)
Definition create_indexed_subset.hpp:36
std::mt19937_64 RngEngine
Definition utils.hpp:34
RngEngine::result_type SeedType
Definition utils.hpp:39
std::shared_ptr< const std::vector< Index_ > > VectorPtr