Skip to content

Releases: ProjectTorreyPines/FastInterpolations.jl

v0.4.4

14 Mar 22:37

Choose a tag to compare

What's New

Linear Adjoint Operator (1D + ND)

Matrix-free Wᵀȳ for linear interpolation, matching the cubic adjoint API. Supports all extrap modes, 1D and arbitrary-dimension grids. (#77)

Bug Fixes

  • Mutation safety — Constructors now defensively copy grids/data. Zero-cost for Range inputs. (#82)
  • ND NoExtrap pre-validation — Domain checks run before @inbounds eval loop. (#78)

Internal

  • Unified 1D callable protocol via AbstractInterpolant1D (#79)
  • AdaptiveArrayPools v0.3 API update (unsafe_acquire!acquire!)

What's Changed

  • (feat): Linear Adjoint Operator (1D + ND) by @mgyoo86 in #77
  • (fix): Pre-loop NoExtrap domain validation for all ND eval paths by @mgyoo86 in #78
  • (refac): unify 1D callables & remove ND query protocol by @mgyoo86 in #79
  • (fix): mutation safety — defensive copy in all constructors by @mgyoo86 in #82

Full Changelog: v0.4.3...v0.4.4

v0.4.3

12 Mar 22:59

Choose a tag to compare

What's New

Extensible Query Protocol for ND Evaluation

ND batch APIs now accept any query container type via a 3-function protocol — SVector, custom containers, etc. work out of the box. Sorted AoS queries automatically get LinearBinarySearch (~25–55% faster).

Query Protocol Docs 📖

AbstractAdjointND Type Hierarchy

New abstract type for ND adjoint operators. CubicAdjointND now subtypes it; future adjoint operators inherit shared callables for free.

Type Reference 📖

Internal

  • –169 net lines: unified 8 duplicate SoA/AoS batch methods into protocol-based paths
  • Zero-alloc AD pullback paths (ChainRules/Enzyme)

What's Changed

  • (feat): Extensible query protocol for ND batch evaluation by @mgyoo86 in #76

Full Changelog: v0.4.2...v0.4.3

v0.4.2

10 Mar 23:46

Choose a tag to compare

What's New

Cubic Adjoint Operator — Matrix-Free Wᵀȳ

Native matrix-free adjoint for 1D and ND cubic spline interpolation. Computes f̄ = Wᵀȳ without materializing the weight matrix — O(n+m) with zero allocation (in-place). Enables efficient ∂loss/∂data for inverse problems, data assimilation, and PDE-constrained optimization.

Zygote and Enzyme use the adjoint operator automatically via registered AD rules — ∂loss/∂data works out of the box.

# Build once (query-baked, data-free)
adj = cubic_adjoint(x, xq)
f̄ = adj(ȳ)            # allocating
adj(f̄, ȳ)             # in-place, zero-alloc

# AD backends use it automatically
using Zygote
grad = Zygote.gradient(f -> sum(cubic_interp(x, f, xq)), f)[1]

1D Adjoint Docs 📖 · ND Adjoint Docs 📖 (#69, #71)

value_gradient

Computes value and gradient in a single call with one interval search. Zero-allocation on tuple queries. Works with all ND interpolant types.

Docs 📖 (#73)

Bug Fixes

  • Exclusive periodic BC type instability — inline isa branch replaces _extend_grid Union return (#64)
  • Mixed-precision FillExtrap/ClampExtrap — OOB path now promotes result to match kernel return type via arithmetic (#74)

What's Changed

  • Fix/type stability exclusive periodic by @mgyoo86 in #64
  • (ci): Two-tier benchmark regression verification with auto re-runs by @mgyoo86 in #65
  • Streamline plots by @JeffFessler in #66
  • Tweak benchmark readme by @JeffFessler in #67
  • (feat): CubicAdjoint operator for 1D cubic spline interpolation by @mgyoo86 in #69
  • (feat): CubicAdjointND — N-Dimensional Cubic Adjoint Operator by @mgyoo86 in #71
  • (feat): new value_gradient API for ND Interpolants by @mgyoo86 in #73
  • Fix mixed-precision type instability in FillExtrap/ClampExtrap OOB paths by @mgyoo86 in #74

Full Changelog: v0.4.1...v0.4.2

v0.4.1

06 Mar 06:39

Choose a tag to compare

New: FillExtrap(v)

Returns a user-specified constant for out-of-domain queries. (Docs 📖)

itp = cubic_interp(x, y; extrap=FillExtrap(NaN))              # 1D
itp = cubic_interp((x, y), data; extrap=FillExtrap(0.0))      # ND

itp = cubic_interp(x, y; extrap=Extrap(:fill; fill_value=NaN)) # factory-style 

Deprecation: ConstExtrapClampExtrap

Renamed to better reflect its behavior (clamp to boundary value). Old names remain functional with depwarn. (Docs 📖)

Deprecated Replacement
ConstExtrap() ClampExtrap()
Extrap(:constant) Extrap(:clamp)

Bug Fixes

  • ND autodiff TypeError — ChainRulesCore extension updated for DerivOp API (was still passing Int tuples) (Docs 📖)
  • AD generalized to all methodsfrule/rrule now dispatch on AbstractInterpolant/AbstractInterpolantND, not just Cubic (Docs 📖)
  • Complex-valued pullback — corrected adjoint to real(conj(Δy) * f'(x)) for f: R → C

Style

  • Applied Runic.jl formatting (173 files) + added CI enforcement workflow

What's Changed

  • (feat): Rename ConstExtrapClampExtrap and add FillExtrap by @mgyoo86 in #61
  • (fix): ChainRulesCore extension + improve AD docs by @mgyoo86 in #62
  • (style): Apply Runic formatting and add CI check by @mgyoo86 in #63

Full Changelog: v0.4.0...v0.4.1

v0.4.0

04 Mar 07:26

Choose a tag to compare

⚠️ Breaking Changes

1. Multi-series API changed

Passing bare Matrix or Vector{Vector} to create a SeriesInterpolant is no longer supported. Use the Series() wrapper:

# Before
itp = cubic_interp(x, [y1, y2])

# After (v0.4)
itp = cubic_interp(x, Series(y1, y2))

2. PeriodicBC() strict endpoint check

The default :inclusive mode now checks y[1] == y[end] (strict) instead of isapprox. This catches silent data errors from floating-point periodic data (e.g., sin(2π) ≈ -2.4e-16 ≠ 0.0). Ensure your periodic data satisfies y[1] === y[end] exactly.

📖 See details:

New Features

Custom value types

  • Any vector-space type (SVector, measurement types, etc.) that supports +, -, * now works across all interpolation methods, BCs, derivatives, and ND paths. (docs)

Adjoint AD (∂f/∂y)

  • Compute derivatives with respect to data values via ForwardDiff, enabled by the custom value type support above. (docs)

What's Changed

  • Introduce Series wrapper for multi-series interpolation by @mgyoo86 in #53
  • Support custom value types (Duck-typing) by @mgyoo86 in #54
  • Add Aqua.jl Quality Assurance by @mgyoo86 in #57

Full Changelog: v0.3.1...v0.4.0

v0.3.1

01 Mar 18:19

Choose a tag to compare

New Feature

Adds a lazy-loaded extension for Symbolics.jl / ModelingToolkit.jl users — FastInterpolations interpolants can now be used directly inside symbolic expressions with derivative chain rule support.

  • Symbolics.jl bridge (FastInterpolationsSymbolicsExt): enables Symbolics.jl users to call 1D/ND interpolants in symbolic contexts, with expand_derivatives resolving derivative chain rules automatically. No impact on non-Symbolics workflows.

What's Changed

Full Changelog: v0.3.0...v0.3.1

v0.3.0

28 Feb 03:45

Choose a tag to compare

FastInterpolations.jl v0.3.0

v0.3.0 completes the migration from Symbol-based APIs to fully typed dispatch, unifies derivative specification, and introduces factory functions for ergonomic API access.

This is a major breaking release. For detailed before/after examples and search-replace patterns, see the Migration Guide.

⚠️ Breaking Changes

  • Extrapolation: extrap=:symbol removed — use Extrap(:extend) or ExtendExtrap() directly
  • Side selection: side=:symbol removed — use Side(:left) or LeftSide() directly
  • Derivatives: deriv=Int / Val removed — use DerivOp(n) or aliases (EvalDeriv1(), etc.)
  • BC renames: NaturalBCZeroCurvBC, ClampedBCZeroSlopeBC
  • BC default: cubic interpolation now defaults to CubicFit() (was ZeroCurvBC())
  • Search renames: BinaryBinarySearch, LinearLinearSearch, LinearBinaryLinearBinarySearch
  • Search removal: HintedBinarySearch removed — use LinearBinarySearch(linear_window=0)

New Features

  • Factory functions: Search(:binary), Extrap(:extend), Side(:left) — zero-allocation, type-stable convenience API with ND variadic form (Extrap(:extend, :none, :wrap))
  • AutoSearch: adaptive default that resolves to BinarySearch (scalar) or LinearBinarySearch (sorted vector) per query — up to ~5x faster for sorted batch queries
  • DerivOp{N}: unified parametric type for derivative specification with ND convenience constructor DerivOp(1, 0)

What's Changed

  • (breaking): remove legacy Symbol extrapolation API by @mgyoo86 in #40
  • (breaking): new AbstractSide API replacing old Symbol-based API by @mgyoo86 in #41
  • (refactor!): replace deriv::Int with DerivOp{N} parametric dispatch by @mgyoo86 in #42
  • (refac!): Rename BC types and change default cubic BC to CubicFit by @mgyoo86 in #43
  • (feat): new AutoSearch policy as an adaptive default search policy by @mgyoo86 in #44
  • (refac!): Remove HintedBinary, route Binary+hint to LinearBinary by @mgyoo86 in #45
  • (perf): Optimize LinearBinary search & adaptive AutoSearch by @mgyoo86 in #46
  • (perf): Fix Range Grid Performance Regression in PR#46 by @mgyoo86 in #47
  • (refac!): Normalize Search Resolution & Rename Search Policies by @mgyoo86 in #48
  • (feat): Factory functions — Search(), Extrap(), Side() by @mgyoo86 in #49

Full Changelog: v0.2.13...v0.3.0

v0.2.13

20 Feb 19:13

Choose a tag to compare

What's Fixed

PolyFit BC Type Stability

Fixed type instability when using any PolyFit boundary condition (CubicFit(), QuadraticFit(), or custom PolyFit{D}) with cubic_interp and CubicSeriesInterpolant.

What's Changed

  • (fix): PolyFit BC type stability and cache normalization by @mgyoo86 in #39

Full Changelog: v0.2.12...v0.2.13

v0.2.12

19 Feb 22:26

Choose a tag to compare

What's Fixed

ND Interpolant Type Stability

Fixed type inference for all ND interpolant constructors (cubic_interp, quadratic_interp, linear_interp, constant_interp). Constructing an ND interpolant inside a function no longer causes boxing (heap allocation) — all constructors are now fully @inferred.

What's Improved

Typed Extrapolation Dispatch for 1D Interpolants

All 1D interpolants now store extrapolation mode as a compile-time type parameter (E<:AbstractExtrap), aligning with the ND pattern. This eliminates runtime macro branching in one-shot hot paths.

New typed extrap values: NoExtrap(), ConstExtrap(), ExtendExtrap(), WrapExtrap().

Warning: Symbol-based extrap arguments (:none, :constant, :extension, :wrap) are now deprecated. They remain functional in v0.2.x for backward compatibility, but will be removed in v0.3.0. Please migrate to the typed AbstractExtrap values listed above.

What's Changed

  • (fix): ND interpolant type inference by @mgyoo86 in #37
  • (refactor): typed AbstractExtrap dispatch for all 1D interpolants by @mgyoo86 in #38

Full Changelog: v0.2.11...v0.2.12

v0.2.11

18 Feb 00:08

Choose a tag to compare

What's New

Zero-Allocation ND One-Shot APIs

All four ND interpolation methods (constant, linear, quadratic, cubic) are now zero-allocation for one-shot calls, including mixed grids (Range + Vector) and periodic BCs. New *_interp!(out, grids, data, queries) in-place batch variants are also available for all four methods.

What's Changed

  • (perf): zero-allocation for ND one-shot APIs by @mgyoo86 in #36

Full Changelog: v0.2.10...v0.2.11