diff options
| author | Ethan Werner <mail@ethanwerner.com> | 2026-07-01 09:42:39 +0400 |
|---|---|---|
| committer | Ethan Werner <mail@ethanwerner.com> | 2026-07-01 09:42:39 +0400 |
| commit | 07e18043145f3d91c8ea7ec3ad41b3c905585277 (patch) | |
| tree | 2bdeae46973f4bdfce263679a4008ac768011f28 /test/cv.c | |
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
Diffstat (limited to 'test/cv.c')
| -rw-r--r-- | test/cv.c | 25 |
1 files changed, 25 insertions, 0 deletions
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 <stddef.h> +#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); +} |