diff options
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; |