ChebyshevSharp
Multi-dimensional Chebyshev tensor interpolation with analytical derivatives for .NET.
ChebyshevSharp builds fast, reusable polynomial surrogates for smooth multi-dimensional functions. Use it when direct model evaluations are expensive but repeated values, derivatives, integrals, roots, or optimizers are needed inside .NET applications.
Key Features
- Multi-dimensional Chebyshev interpolation with spectral convergence
- Analytical derivatives via spectral differentiation matrices
- Vectorized evaluation routing N-D tensor contractions through BLAS (via BlasSharp.OpenBlas)
- Piecewise Chebyshev splines with user-specified knots at singularities
- Sliding technique for high-dimensional approximation
- Tensor Train decomposition for 5+ dimensional functions
- Chebyshev algebra — combine interpolants via
+,-,*,/ - Spectral calculus — integration, rootfinding, and optimization
- Targets .NET 8 and .NET 10
Installation
dotnet add package ChebyshevSharp
Quick Start
using ChebyshevSharp;
// Define a function to interpolate
double MyFunction(double[] x, object? data) => Math.Sin(x[0]) + Math.Sin(x[1]);
// Build a 2D Chebyshev interpolant
var cheb = new ChebyshevApproximation(
function: MyFunction,
numDimensions: 2,
domain: new[] { new[] { -1.0, 1.0 }, new[] { -1.0, 1.0 } },
nNodes: new[] { 11, 11 }
);
cheb.Build();
// Evaluate at a point
double value = cheb.VectorizedEval(new[] { 0.5, 0.3 }, new[] { 0, 0 });
// Compute partial derivative df/dx1
double dfdx = cheb.VectorizedEval(new[] { 0.5, 0.3 }, new[] { 1, 0 });
Where to Go Next
| Path | Start here |
|---|---|
| Build your first interpolant | Getting Started |
| Choose an approximation family | Which Class Should I Use? |
| Understand the numerical assumptions | Mathematical Concepts |
| Improve accuracy or handle kinks | Error-Driven Construction, then Piecewise Chebyshev Interpolation |
| Work in higher dimensions | Sliding Technique or Tensor Train Interpolation |
| Use saved or external function values | Serialization & Construction and Pre-computed Values |
| Validate or contribute changes | Testing & Validation, Support & Reporting, and Contributing |
| Check mathematical sources | Citations |
| Check release history | Release Notes |
Project Links
- GitHub repository - source code, pull requests, issues, and CI history.
- NuGet package - installable package and published versions.
- Project links - releases, support, reporting, and contribution entry points.
API Reference
See the API documentation for full class and method reference, auto-generated from XML documentation comments.