1 #ifndef jb_testing_create_square_timeseries_hpp 2 #define jb_testing_create_square_timeseries_hpp 12 template <
typename timeseries>
15 typedef typename timeseries::value_type value_type;
16 for (
int i = 0; i !=
nsamples; ++i) {
17 if (i < nsamples / 4) {
18 ts[i] = value_type(-100);
19 }
else if (i < 3 * nsamples / 4) {
20 ts[i] = value_type(+100);
22 ts[i] = value_type(-100);
30 #endif // jb_testing_create_square_timeseries_hpp void resize_if_applicable(timeseries &ts, std::size_t newsize, std::true_type)
Resize a timeseries to a newsize.
void create_square_timeseries(int nsamples, timeseries &ts)
Create a simple timeseries where the values look like a square.
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.