Skip to main content

s_to_t_topp3

Function s_to_t_topp3 

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

Compute cumulative time profile t(s) from TOPP3/COPP3 profiles a(s), b(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 + num_stationary.0 + num_stationary.1;
  • requires a.len() == s.len() and b.len() == s.len();
  • invalid input returns (NaN, empty).

§Returns

Returns (t_final, t_s) where t_s[i] is cumulative time at s[i].

§Errors

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

§Contract

  • t_s.len() == s.len() on valid input.
  • t_s[0] == t0 on valid input.