diff options
| author | Ethan Werner <mail@ethanwerner.com> | 2026-08-09 15:02:21 +0400 |
|---|---|---|
| committer | Ethan Werner <mail@ethanwerner.com> | 2026-08-09 15:02:21 +0400 |
| commit | 3d92926a902017e7cf1f5738e99ff62da596ce12 (patch) | |
| tree | 2b55422c26a48759d56fa91f06df24449e9dfa88 /lib/ppo.c | |
| parent | 07e18043145f3d91c8ea7ec3ad41b3c905585277 (diff) | |
refactormain
Diffstat (limited to 'lib/ppo.c')
| -rw-r--r-- | lib/ppo.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -24,7 +24,7 @@ ts_parameter_t const ts_ppo_p = { .n_inputs = 5, .n_outputs = 2, .n_constants = uint_t ts_ppo_offset( ts_constant_t const *c ) { ( void )c; - return ( c ? (uint_t)(((ts_ppo_params_t *)c)->slow_k + ((ts_ppo_params_t *)c)->signal_k - 2) : 0 ); + return ( c ? (uint_t)(((ts_ppo_params_t const *)c)->slow_k + ((ts_ppo_params_t const *)c)->signal_k - 2) : 0 ); } int ts_ppo( @@ -35,12 +35,11 @@ int ts_ppo( { TS_PROLOGUE( ts_ppo_p ); if ( !c ) return -1; - fp_t fast_k = ((ts_ppo_params_t *)c)->fast_k; - fp_t slow_k = ((ts_ppo_params_t *)c)->slow_k; - fp_t signal_k = ((ts_ppo_params_t *)c)->signal_k; + fp_t fast_k = ((ts_ppo_params_t const *)c)->fast_k; + fp_t slow_k = ((ts_ppo_params_t const *)c)->slow_k; + fp_t signal_k = ((ts_ppo_params_t const *)c)->signal_k; if (fast_k == 0 || slow_k == 0 || signal_k == 0) return -1; - if (n == 0) return -1; fp_t fast_a = 1.0 / fast_k; fp_t slow_a = 1.0 / slow_k; |