pub fn s_to_t_topp2(
s: &[f64],
a: &[f64],
t0: f64,
) -> Result<(f64, Vec<f64>), CoppError>Expand description
Compute cumulative time profile t(s) from a(s).
§Semantics
t_s[i]is the time at stations[i].- initial condition is
t_s[0] = t0. - returns
(t_final, t_s)wheret_final == *t_s.last().unwrap().
§Input contract
- valid when
s.len() >= 2anda.len() == s.len(); s,a, andt0must contain only finite values;smust be strictly increasing;- each interval must have finite positive speed denominator.
§Returns
Returns (t_final, t_s) with t_s.len() == s.len() on valid input.
§Errors
Returns CoppError::InvalidInput when dimensions, monotonicity, positivity,
or numeric finiteness requirements are violated.
§Contract
t_sis monotonically increasing whenais nonnegative andsis increasing.t_s[0] == t0always holds on valid input.