back to home

JuliaMath / Interpolations.jl

Fast, continuous interpolation of discrete datasets in Julia

View on GitHub
569 stars
114 forks
114 issues

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing JuliaMath/Interpolations.jl in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/JuliaMath/Interpolations.jl)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

Interpolations.jl This package implements a variety of interpolation schemes for the Julia language. It has the goals of ease-of-use, broad algorithmic support, and exceptional performance. Currently this package supports B-splines and also irregular grids. The API has been designed with intent to support more options. Initial support for Lanczos interpolation was recently added. Pull-requests are more than welcome! It should be noted that the API may continue to evolve over time. At the bottom of this page, you can find a "performance shootout" among these methods (as well as SciPy's ). Installation Interpolations.jl can be installed via the following invocation since it is a registered Julia package. Example Usage Create a grid and an array of values to be interpolated Create linear interpolation object without extrapolation Create linear interpolation object with extrapolation Other Examples More examples, such as plotting and cubic interpolation, can be found at the convenience constructions documentation. Other Interpolation Packages Other interpolation packages for Julia include: • ApproXD.jl implements B-spline and linear interpolation in Julia. • BarycentricInterpolation.jl implements the Barycentric formula for polynomial interpolation on equispaced points and Chebyshev points of the first and second kind. • BasicInterpolators.jl provides a collection of common interpolation recipes for basic applications. • BSplineKit.jl offers tools for B-spline based Galerkin and collocation methods, including for interpolation and approximation. • Curves.jl supports log-interpolation via immutable objects. • DataInterpolations.jl is a library for performing interpolations of one-dimensional data. • Dierckx.jl is a wrapper for the dierckx Fortran library, which also underlies scipy.interpolate. • DIVAnd.jl for N-dimensional smoothing interpolation. • FastChebInterp.jl does fast multidimensional Chebyshev interpolation on a hypercube using separable grid of interpolation points. • FastInterpolations.jl has fast multi-dimensional 0th–3rd order splines on nonuniform Cartesian grids, with optimized derivatives, integrals, Hessians, and adjoints/reverse-mode rules. • FEMBasis.jl contains interpolation routines for standard finite element function spaces. • FineShift.jl does fast sub-sample shifting of multidimensional arrays. • FourierTools.jl includes sinc interpolation for up and down sampling. • GeoStats.jl provides interpolation and simulation methods over complex 2D and 3D meshes. • GridInterpolations.jl performs multivariate interpolation on a rectilinear grid. • InterpolationKernels.jl provides a library of interpolation kernels. • KernelInterpolation.jl implements scattered data interpolations in arbitrary dimensions by radial basis functions with support for solving linear partial differential equations. • KissSmoothing.jl implements denoising and a Radial Basis Function estimation procedure. • LinearInterpolations.jl allows for interpolation using weighted averages allowing probability distributions, rotations, and other Lie groups to be interpolated. • LinearInterpolators.jl provides linear interpolation methods for Julia based on InterpolationKernels.jl, above. • LocalFunctionApproximation.jl provides local function approximators that interpolates a scalar-valued function across a vector space. • NaturalNeighbours.jl provides natural neighbour interpolation methods for scattered two-dimensional point sets, with support for derivative generation. • PCHIPInterpolation.jl for monotonic interpolation. • PiecewiseLinearApprox.jl performs piecewise linear interpolation over an arbitrary number of dimensions. • ScatteredInterpolation.jl interpolates scattered data in arbitrary dimensions. Some of these packages support methods that does not, so if you can't find what you need here, check one of them or submit a pull request here. If you would like to list a registered package that is related to interpolation, please create a Github issue. Performance shootout In the directory, you can find a script that tests interpolation with several different packages. We consider interpolation in 1, 2, 3, and 4 dimensions, with orders 0 ( ), 1 ( ), and 2 ( ). Methods include Interpolations ( ) and ( ), methods from the Grid.jl package, methods from the Dierckx.jl package, methods from the GridInterpolations.jl package ( ), methods from the ApproXD.jl package, and methods from SciPy's accessed via ( ). All methods are tested using an with approximately elements, and the interpolation task is simply to visit each grid point. First, let's look at the two B-spline algorithms, and . Here's a plot of the "construction time," the amount of time it takes to initialize an interpolation object (smaller is better): The construction time is negligible until you get to second order (quadratic); that's because quadratic is the lowest order requiring the solution of tridiagonal systems upon construction. The solvers used by Interpolations are much faster than the approach taken in Grid. Now let's examine the interpolation performance. Here we'll measure "throughput", the number of interpolations performed per second (larger is better): Once again, Interpolations wins on every test, by a factor that ranges from 7 to 13. Now let's look at the "gridded" methods that allow irregular spacing along each axis. For some of these, we compare interpolation performance in both "vectorized" form and in "scalar" form . First, construction time (smaller is better): Missing dots indicate cases that were not tested, or not supported by the package. (For construction, differences between "vec" and "scalar" are just noise, since no interpolation is performed during construction.) The only package that takes appreciable construction time is Dierckx. And here's "throughput" (larger is better). To ensure we can see the wide range of scales, here we use "square-root" scaling of the y-axis: For 1d, the "Dierckx s…