P5-math-interpolate

Jul 20, 2023

  • This module contains several useful routines for interpolating data sets and finding where a given value lies in a sorted list. The first is a subroutine used to locate a position in an array of values where a given value would fit using bisection. It has been designed to be efficient in the common situation that it is called repeatedly. The user can supply a different set of comparison operators to replace the standard < and <=. For example, given a list 1, 2, 5, 8, 15 and the number 9.5 it would return 3.
  • The remaining routines all are related to interpolating sets of x,y data pairs. They all take a list of x,y data pairs given another x value, return a sensible y value using the list of x,y data pairs. Three different interpolating functions are provided. The first, called a constant interpolator, assumes that the function being interpolated moves in non-linear jumps from one value to another. The interpolated value for some value x is the y value of the neighboring x,y to the left of the given x. The second interpolator performs a linear interpolation between the neighboring points. The third interpolator is called the robust interpolator and interpolates a smooth curve between all of the x,y pairs. To do the interpolation, it first calculates some reasonable derivatives at the x,y pairs. The robust interpolator can also use derivative information supplied by the user.


Checkout these related ports:
  • Zn_poly - C library for polynomial arithmetic
  • Zimpl - Language to translate the LP models into .lp or .mps
  • Zegrapher - Software for plotting mathematical objects
  • Zarray - Dynamically typed N-D expression system based on xtensor
  • Z3 - Z3 Theorem Prover
  • Yices - SMT solver
  • Yacas - Yet Another Computer Algebra System
  • Xtensor - Multi-dimensional arrays with broadcasting and lazy computing
  • Xtensor-python - Python bindings for xtensor
  • Xtensor-io - Xtensor plugin to read/write images, audio files, numpy npz and HDF5
  • Xtensor-blas - BLAS extension to xtensor
  • Xspread - Spreadsheet program for X and terminals
  • Xppaut - Graphical tool for solving differential equations, etc
  • Xplot - X11 plotting package
  • Xlife++ - XLiFE++ eXtended Library of Finite Elements in C++