package torch

  1. Overview
  2. Docs
type t
val create : (float * float) list -> t

create vs creates a linear interpolation function using vs as knots. vs is a list of pairs (x, y), has to be sorted by x and cannot have two elements with the same x.

val eval : t -> float -> float

eval t x returns the linear interpolation value of t at x. If t was built from (x1, y1) to (xn, yn). If x is below x1, the returned value is y1. If x is above xn, the returned value is yn. If x is between too knots, linear interpolation is used.

OCaml

Innovation. Community. Security.