JayBeams  0.1
Another project to have fun coding.
create_random_timeseries.hpp
Go to the documentation of this file.
1 #ifndef jb_testing_create_random_timeseries_hpp
2 #define jb_testing_create_random_timeseries_hpp
3 
5 
6 namespace jb {
7 namespace testing {
8 
9 /**
10  * Create a simple timeseries where the values look like a random.
11  */
12 template <typename timeseries, typename generator>
13 void create_random_timeseries(generator& gen, int nsamples, timeseries& ts) {
14  typedef typename timeseries::value_type value_type;
15  ts.resize(nsamples);
17  for (int i = 0; i != nsamples; ++i) {
18  ts[i] = create(gen);
19  }
20 }
21 
22 } // namespace testing
23 } // namespace jb
24 
25 #endif // jb_testing_create_random_timeseries_hpp
void create_random_timeseries(generator &gen, int nsamples, timeseries &ts)
Create a simple timeseries where the values look like a random.
Wrap a random number generator so it can be used for both real and complex numbers.
std::size_t nsamples(container_type const &a)
Count the elements in the last dimension of a vector-like container.
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7