Skip to main content

t_to_s_topp2

Function t_to_s_topp2 

Source
pub fn t_to_s_topp2(
    s: &[f64],
    a: &[f64],
    t_s: &[f64],
    mode: InterpolationMode<'_>,
) -> Result<Vec<f64>, CoppError>
Expand description

Interpolate inverse mapping s(t) from a(s) and sampled t(s).

§Modes

  • UniformTimeGrid(t0, dt, include_final): generate uniform time samples;
  • NonUniformTimeGrid(t_sample): use caller-provided increasing samples.

§Input contract

  • requires s.len() >= 2, a.len() == s.len(), t_s.len() == s.len();
  • requires t_s strictly increasing.
  • all profile and time-grid values must be finite.

§Output semantics

  • output length matches requested sample count in each mode;
  • for out-of-range time samples, output entries are NaN.

§Returns

Returns sampled s(t) values according to mode.

§Errors

Returns CoppError::InvalidInput when dimensions, monotonicity, positivity, or numeric finiteness requirements are violated.

§Contract