template<typename T, typename U = T>
struct tts::reverse_ramp< T, U >
Generates a ramp of values read backward.
The element at index i of a sequence of size N is start + (N-1-i)*step, which gives start+(N-1)*step, ..., start+step, start. A scalar target gets start.
- 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;
auto const last = ramp1.size() - 1;
for(std::size_t i = 0; i < ramp1.size(); ++i)
{
TTS_EQUAL(ramp1[ i ],
static_cast<value_type
>(65) +
static_cast<value_type
>(last - i));
}
for(std::size_t i = 0; i < ramp2.size(); ++i)
{
TTS_EQUAL(ramp2[ i ],
static_cast<value_type
>(10) +
static_cast<value_type
>((last - i) * 2));
}
}
};