From 07e18043145f3d91c8ea7ec3ad41b3c905585277 Mon Sep 17 00:00:00 2001 From: Ethan Werner Date: Wed, 1 Jul 2026 09:42:39 +0400 Subject: initial commit: ts time series analysis library v0.1.0 - 354 financial and mathematical time-series indicators - Uniform C11 API with consistent function signatures - 349 passing tests with -Werror - Static and shared library builds - pkg-config integration - Python bindings - Fuzzing and sanitizer support - Security hardening flags --- test/qstick.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/qstick.c (limited to 'test/qstick.c') diff --git a/test/qstick.c b/test/qstick.c new file mode 100644 index 0000000..daa13d2 --- /dev/null +++ b/test/qstick.c @@ -0,0 +1,24 @@ +#include +#include +#include "ts.h" + +bool ts_test_qstick( void ) +{ + fp_t const x0[] = { 10, 10, 10, 20, 20, 30 }; + fp_t const x1[] = { 12, 13, 12, 22, 23, 33 }; + fp_t const x2[] = { 9, 9, 10, 19, 20, 29 }; + fp_t const x3[] = { 11, 12, 11, 21, 22, 31 }; + + fp_t const * const x[] = { x0, x1, x2, x3 }; + + uint_t k = 3; + fp_t e[4]; + e[0] = ((11 - 10) + (12 - 10) + (11 - 10)) / 3.0; + e[1] = e[0] + ((21 - 20) - (11 - 10)) / 3.0; + e[2] = e[1] + ((22 - 20) - (12 - 10)) / 3.0; + e[3] = e[2] + ((31 - 30) - (11 - 10)) / 3.0; + + fp_t const * const exp[1] = { e }; + + return ts_test(ts_qstick, ts_qstick_offset, x, exp, sizeof( x0 ) / sizeof( *x0 ), (ts_constant_t *)&k, &ts_qstick_p); +} -- cgit v1.3.1