template<typename T, typename U = T>
struct tts::reverse_ramp< T, U >
Defines a data generator that produce a reverse ramp of data.
This generator produces a ramp starting from a final value and decreasing by a fixed step at each call. I.e., for a size N, the produced values are: start, start-step, start-2*step, ...,
start-(N-1)*step.
- Template Parameters
-
| T | Type of the initial value |
| U | Type of the step value |
#define TTS_MAIN
#include <tts/tts.hpp>
#include <array>
(std::array<float, 10>, int, double),
<typename T>(T const& ramp1, T const& ramp2)
{
if constexpr(std::is_arithmetic_v<T>)
{
}
else
{
using value_type = typename T::value_type;
for(std::size_t i = 0; i < ramp1.size(); ++i)
{
TTS_EQUAL(ramp1[ i ],
static_cast<value_type
>(65) -
static_cast<value_type
>(i));
}
for(std::size_t i = 0; i < ramp2.size(); ++i)
{
TTS_EQUAL(ramp2[ i ],
static_cast<value_type
>(10) -
static_cast<value_type
>(i * 2));
}
}
};