Bilinear spline is a fast (although less precise than bicubic spline) two-dimensional interpolation method. ALGLIB package contains an implementation of 2D splines available in several programming languages:
Our implementation of 2D splines:
The rest of this article focuses on bilinear splines. More information on bicubic splines can be found in the corresponding article.
1 Getting started and examples
Getting started
Examples
2 Comparison with bicubic splines
3 Fitting 2D splines to scattered data
4 Downloads section
Bilinear spline interpolation functionality is provided by the spline2d subpackage of ALGLIB package. A bilinear spline can be created from the data sampled at the regular grid (to be exact, more general rectilinear one) with spline2dbuildbilinearv function. This function supports both scalar and vector-valued splines.
After an instance of spline object is built, you can perform following operations:
ALGLIB Reference Manual includes following examples which show how to work with bilinear splines:
Bilinear spline is a fast and compact method for interpolation of 2D data. For the same amount of input data it needs 4x less memory than bicubic spline. Spline calculation/evaluation is an order of magnitude faster than that of bicubic splines.
From the other side, following drawbacks can be noted:
Thus, unless you have really tight memory and performance constraints, we recommend you to use bicubic splines in your work.
Although internally all 2D splines use a rectilinear grid as the basis, it is possible to fit a spline to scattered (irregular) data with least squares solver.
ALGLIB has two high-performance algorithms which can do so. However, because of inherent non-smoothness and low precision of bilinear splines, these algorithms fit only bicubic splines. See corresponding part of the article on bicubic splines for more information.
This article is licensed for personal use only.
ALGLIB Project offers you two editions of ALGLIB:
ALGLIB Free Edition:
+delivered for free
+offers full set of numerical functionality
+extensive algorithmic optimizations
-no multithreading
-non-commercial license
ALGLIB Commercial Edition:
+flexible pricing
+offers full set of numerical functionality
+extensive algorithmic optimizations
+high performance (SMP, SIMD)
+commercial license with support plan
Links to download sections for Free and Commercial editions can be found below: