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/cv.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/cv.c (limited to 'test/cv.c') diff --git a/test/cv.c b/test/cv.c new file mode 100644 index 0000000..2c41604 --- /dev/null +++ b/test/cv.c @@ -0,0 +1,25 @@ +#include +#include "ts.h" + +bool ts_test_cv( void ) +{ + fp_t const o[] = { 10, 11, 12, 11, 12, 13, 14, 13, 14, 15, 14 }; + fp_t const h[] = { 12, 13, 14, 12, 14, 15, 16, 14, 16, 17, 16 }; + fp_t const l[] = { 8, 9, 10, 9, 10, 11, 12, 11, 12, 13, 12 }; + fp_t const c[] = { 11, 12, 10, 11, 11, 14, 15, 13, 15, 16, 15 }; + fp_t const v[] = { 100, 200, 300, 400, 500, 150, 250, 350, 450, 550, 650 }; + + fp_t const * const x[] = { o, h, l, c, v }; + + fp_t fast = 3; + fp_t slow = 5; + + + fp_t e[] = { -0.020148, 0.003635, -0.117257, -0.040582, 0.003017, 0.026068 }; + + fp_t const * const e_arr[1] = { e }; + + fp_t constants[2] = { fast, slow }; + + return ts_test(ts_cv, ts_cv_offset, x, e_arr, 11, (ts_constant_t *)constants, &ts_cv_p); +} -- cgit v1.3.1