1#ifndef TATAMI_TEST_SIMULATE_VECTOR_HPP
2#define TATAMI_TEST_SIMULATE_VECTOR_HPP
37 uint64_t
seed = 1234567890;
49template<
typename Type_>
51 std::vector<Type_> output(length);
52 std::mt19937_64 rng(options.
seed);
53 std::uniform_real_distribution<> unif(options.
lower, options.
upper);
56 for (
auto& v : output) {
60 std::uniform_real_distribution<> nonzero(0.0, 1.0);
61 for (
auto& v : output) {
62 if (nonzero(rng) <= options.
density) {
Utilities for testing tatami libraries.
Definition create_indexed_subset.hpp:15
std::vector< Type_ > simulate_vector(size_t length, const SimulateVectorOptions &options)
Definition simulate_vector.hpp:50
Options for simulate_vector().
Definition simulate_vector.hpp:18
double upper
Definition simulate_vector.hpp:27
double density
Definition simulate_vector.hpp:32
double lower
Definition simulate_vector.hpp:22
uint64_t seed
Definition simulate_vector.hpp:37