Skip to main content

t_to_s_topp3

Function t_to_s_topp3 

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

Interpolate inverse mapping s(t) from a TOPP3/COPP3 profile 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, profile slice lengths equal to s.len(), and 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 under the requested interpolation mode.

§Errors

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

§Contract