Skip to main content

findInterval_unchecked

Function findInterval_unchecked 

Source
unsafe extern "C-unwind" fn findInterval_unchecked(
    xt: *const f64,
    n: c_int,
    x: f64,
    rightmost_closed: Rboolean,
    all_inside: Rboolean,
    ilo: c_int,
    mflag: *mut c_int,
) -> c_int
Expand description

Find the interval containing a value (binary search).

Used for interpolation and binning.

§Parameters

  • xt: Sorted breakpoints array
  • n: Number of breakpoints
  • x: Value to find
  • rightmost_closed: If TRUE, rightmost interval is closed
  • all_inside: If TRUE, out-of-bounds values map to endpoints
  • ilo: Initial guess for interval (1-indexed)
  • mflag: Output flag (see R documentation)

§Returns

Interval index (1-indexed). Unchecked FFI binding for findInterval. Generated from source location line 3591, column 8. Generated from source file miniextendr-api/src/ffi.rs.