Skip to main content

s_to_t_topp2

Function s_to_t_topp2 

Source
pub fn s_to_t_topp2(s: &[f64], a: &[f64], t0: f64) -> (f64, Vec<f64>)
Expand description

Compute cumulative time profile t(s) from a(s).

§Semantics

  • t_s[i] is the time at station s[i].
  • initial condition is t_s[0] = t0.
  • returns (t_final, t_s) where t_final == *t_s.last().unwrap().

§Input contract

  • valid when s.len() >= 2 and a.len() == s.len();
  • otherwise returns (NaN, empty).

§Returns

Returns (t_final, t_s) with t_s.len() == s.len() on valid input.

§Errors

This function does not return Result; invalid input is mapped to (NaN, vec![]).

§Contract

  • t_s is monotonically increasing when a is nonnegative and s is increasing.
  • t_s[0] == t0 always holds on valid input.