最新バージョンの新機能

Version 10.0.0での新機能 (2025/11)

Updated .NET Support

Numerics.NET 10 supports the following frameworks:

  • .NET 10 (new)
  • .NET 8 and .NET 9
  • .NET Framework 4.6.2
  • .NET Standard 2.0

Two older, out-of-support platforms have been removed:

  • Dropped: .NET Core 3.1
  • Dropped: .NET 6.0

This ensures consistency with Microsoft’s current support policies.

This version also supports C# 14 features like compound assignment operators for vectors, matrices, and tensors.

Modern Matrix and Vector Construction

This version introduces a more consistent and intention-revealing API for creating matrices and vectors. The goal is to remove ambiguity, make intent crystal clear, and make code easier to read and maintain.

Generative constructors

The new static factory methods create matrices and vectors from scratch:

C#
var zeros  = Matrix.Zeros(5, 5);
var random = Matrix.Random(3, 4);
You can also create matrices and vectors from collection expressions:
C#
Vector v = [1.0, 2.0, 3.0, 4.0, 5.0];
Matrix m =
   [[1.0, 2.0],
    [3.0, 4.0]];

Clear copy vs. wrap semantics

The previous Create* methods combined both copy and wrap semantics, which could lead to confusion about whether data was being duplicated or referenced.

The new factory methods make this distinction explicit: methods that copy data into a new matrix are prefixed with CopyFrom, while those that wrap existing buffers without copying use the Wrap prefix.

C#
// Copy data into a new matrix
var A = Matrix.CopyFrom(data);

// Wrap an existing buffer without copying
var B = Matrix.Wrap(buffer, rows: 100, cols: 100);

Shape-aware creation

New methods allow you to create matrices directly from collections of rows or columns:

C#
var C = Matrix.FromRows(rowArrays);
var D = Matrix.FromColumns(columnArrays);

Specialized constructors are also available for symmetric, Hermitian, triangular, and diagonal matrices.

Legacy Create* methods remain available but are now marked obsolete and will be removed in a future release.

Interpolation

New in this version is the static Interpolation class for common one-off interpolation tasks and simple curve creation.

One-off interpolation

In some scenarios, all you need is a quick interpolation result. The new Interpolation class allows you to perform interpolation without creating a full interpolator object. The new static methods cover the most common cases:

C#
var smooth  = Interpolation.Cubic(x, y, xQuery);
var linear  = Interpolation.Linear(x, y, xQuery);
var inverse = Interpolation.InverseLinear(x, y, yQuery);

Transformed interpolation

Several new transformed interpolation methods are included:

  • Log-linear: Interpolates linearly in log(x) space, suitable for data spanning orders of magnitude on the x-axis.
  • Log-log: Interpolates linearly in log(x)–log(y) space, preserving power-law relationships.
  • Periodic: Treats the data as repeating seamlessly across the domain; endpoints are joined smoothly.
  • Circular: Interpolates angular data (e.g., degrees or radians) using the shortest arc across the 2π wrap-around.

Examples:

C#
var hourly = Interpolation.Periodic(x, y, xQuery, period: 24);
var logfit = Interpolation.LogLinear(x, y, xQuery);

Convenience methods

For scenarios where you need to create an interpolating curve for repeated use, the Interpolation class provides static methods that return fully configured interpolator instances:

C#
var linear  = Interpolation.PiecewiseLinearCurve(x, y);
var spline = Interpolation.CubicSpline(x, y);
var akima  = Interpolation.AkimaSpline(x, y);

1D Signal Processing

v10 adds two significant improvements for signal processing:

A new SignalMath convenience class

This class provides high-level operations for common signal processing workflows:

  • Fourier transforms (real and complex)
  • Convolution, cross-correlation and autocorrelation
  • Windowing (Hamming, Hanning, Blackman, and others)
  • Power spectral density estimation

Example:

C#
var spectrum = SignalMath.FourierTransform(signal);
var corr = SignalMath.Convolve(signal, kernel, mode: ConvolutionMode.Same);

Optimized convolution and cross-correlation

Behind the high-level convenience methods are improved low-level components we call kernel processors. These handle the heavy lifting for convolution and correlation and give you fine-grained control when you need it. The updated implementations provide:

  • Flexible padding options, including zero, constant, reflect, replicate, and wrap
  • Explicit control over the kernel’s anchor (origin)
  • Automatic selection between direct and FFT-based algorithms
  • Efficient reuse of the same processed kernel across many signals
  • Full support for real and complex inputs

Together, these enhancements offer more predictable control in advanced scenarios and significantly better performance on large inputs.

Nonlinear Curve Fitting

This release adds several new curve models across scientific, engineering, and reliability domains:

  • Michaelis–Menten (enzyme kinetics)
  • Gompertz and Richards curves (growth models)
  • Weibull CDF (reliability and life-testing)
  • Exponentially Modified Gaussian (EMG)
  • Pseudo-Voigt (line-shapes and spectroscopy)
  • Damped Sine
  • Power law
  • Double Sigmoid

Example:

C#
var curve = new MichaelisMentenCurve();
var fitter = new NonlinearCurveFitter() { 
    XValues = x,
    YValues = y,
    Curve = curve
};
fitter.Fit();

Compatibility Notes

  • Version 10 removes all binary serialization APIs.
  • Many matrix and vector factory Create* methods are now obsolete.

Version 10.1.0での新機能 (2025/12)

Interpolation of Regular Grids and Scattered Data

This release introduces a unified set of APIs for interpolating both grid-based and scattered data in two or more dimensions. The goal is to provide a consistent, extensible foundation for numerical work involving surfaces, volumes, or higher-dimensional datasets.

Interpolation on Rectilinear Grids

Interpolation on rectilinear grids (1D, 2D, 3D, and higher) is now supported through a flexible set of spline kernels:

  • Linear and cubic-Hermite tensor product interpolation
  • Optional spline kernels for alternative cubic or future higher-order methods
  • Configurable boundary conditions (construction) and extrapolation modes (evaluation)
  • Gradient/Hessian evaluation for cubic spline surfaces (1D/2D/3D)

Here is a simple example using a 2D cubic tensor-product spline:

C#
// Axes
var x = Vector.Create(0.0, 1.0, 2.0, 3.0);
var y = Vector.Create(0.0, 1.0, 2.0);

// Grid values f(x,y)
var values = Matrix.CopyFrom(new double[,]
{
    { 0,  1,  4 },
    { 1,  2,  5 },
    { 4,  5,  8 },
    { 9, 10, 13 }
};

// Create a 2D cubic grid surface
var surface = Interpolation.GridCubic2DInterpolator(x, y, values);

// Evaluate at (1.2, 0.8)
double z = surface.Evaluate(1.2, 0.8);

Interpolation of Scattered Data

For unstructured point sets, the library now includes:

  • 2D triangulated linear interpolation (Delaunay-based)
  • Nearest-neighbor interpolation in any dimension
  • Radial Basis Function (RBF) interpolation (with optional polynomial tail) in any dimension
  • Example using a 2D RBF interpolator:
C#
var x = Vector.Create(0.0, 1.0, 2.0, 1.5);
var y = Vector.Create(0.0, 1.0, 0.5, 0.3);
var f = Vector.Create(1.0, 2.0, 1.5, 1.2);

var rbf = Interpolation.ScatteredRbfInterpolator(x, y, f);

double value = rbf.Evaluate(0.6, 0.4);

Vector and matrix factory enhancements

This update adds further improvements to the Vector and Matrix factory APIs:

・Simple factories for constructing constant-valued objects:

C#
var v1 = Vector.Ones(100);
var m1 = Matrix.Full(50, 50, 2.5);

・Shape-preserving “like” constructors:

C#
var m2 = Matrix.ZerosLike(m1);
var m3 = Matrix.OnesLike(m1);
var m4 = Matrix.FullLike(m1, 7.0);

・Random vector and matrix creation using existing probability distributions:

C#
var dist = new ExponentialDistribution(rate: 2.0);
var v2 = Vector.Random(100, dist);
var m5 = Matrix.Random(40, 40, dist);

Dense generators for structured matrices, such as Toeplitz:

C#
var t = Matrix.CreateToeplitz(
    firstColumn: [1.0, 2.0, 3.0],
    firstRow:    [1.0, 4.0, 5.0]);

Signal Generation

The SignalMath class now includes a comprehensive set of analytical signal generators for creating test signals, waveforms, pulses, chirps, and noise. These functions operate purely on numeric sequences—no sampling metadata, no allocations unless requested—and provide both span-based and allocating overloads.

The raw layer covers all core DSP waveforms:

  • Periodic waves: sine, square (with duty cycle), triangle, sawtooth
  • Pulses: sinc, Gaussian pulse
  • Chirps: linear, quadratic, logarithmic
  • Discrete shapes: impulse, step
  • Noise: Gaussian and uniform (explicit RNG)

Each generator follows a consistent signature pattern, using implicit discrete coordinates (n = 0..count-1) or optional explicit x-values.

Example — Generating a Linear Chirp

Below we create a linear chirp once using implicit sample indices and once using custom x-coordinates.

C#
double amplitude = 1.0;
double startW = 0.2;    // radians per sample
double endW   = 2.0;    // radians per sample
double phase  = 0.0;

// --- Implicit form (x = 0,1,2,...)
int count = 12;
var implicitChirp = SignalMath.GenerateLinearChirp(
    count,
    amplitude,
    startW,
    endW,
    phase
);

// --- Explicit form (custom x-values)
var x = Vector.FromFunction(count, i => -1.0 + 0.1 * i);
var explicitChirp = SignalMath.GenerateLinearChirp(
    x,
    amplitude,
    startW,
    endW,
    phase
);

// Print results
Console.WriteLine($"Implicit chirp: {implicitChirp:F4}");
Console.WriteLine($"Explicit chirp: {explicitChirp:F4}");

These new generators provide a concise and efficient way to synthesize test signals, frequency sweeps, and analytical sequences for simulations, filter development, numerical experimentation, and verification workflows.

v10リリースノート

Version 10.1.0 (2025/12)

Interpolation on Rectilinear Grids

  • Linear, cubic (natural + other spline kinds), and tensor-product cubic splines
  • Supports arbitrary dimensionality (2D, 3D, N-D)
  • Configurable kernel types for tensor splines
  • Boundary conditions and extrapolation modes fully supported
  • Gradient/Hessian evaluation for grid-based interpolants

Interpolation of Scattered Data

  • Nearest-neighbor and linear (via Delaunay triangulation in 2D)
  • Unified API consistent with grid-based interpolators

Vector and matrix factory enhancements

  • New simple factories (Ones, full) for objects with constant valueds.
  • Shape-preserving “like” constructors for generating objects matching existing dimensions.
  • Support for random vector and matrix creation using arbitrary probability distributions.
  • Dense generators for structured matrices, including Toeplitz and Hankel matrices.

Signal Generation

  • SignalMath now includes a full set of analytical signal generators for test signals, waveforms, pulses, chirps, and noise.
  • Generators operate directly on numeric sequences with optional span-based or allocating overloads.
  • Consistent function signatures support implicit discrete coordinates or explicit x-values.

Version 10.0.0 (2025/11)

Platform support

  • Added support for .NET 10 and corresponding C# 14 features.
  • Dropped support for .NET Core 3.1 and .NET 6.0. Both platforms have reached end-of-life and are no longer supported by Microsoft. Applications targeting these runtimes should migrate to .NET 8 (LTS) or later to continue receiving updates and security fixes.
  • All binary serialization APIs have been removed.

Linear Algebra

  • New unified factory API for vectors and matrices (CopyFrom, Wrap, Zeros, Identity, FromRows, etc.) with clearer semantics.
  • Compound assignment operators for vectors and matrices (.NET 10 only).
  • Native libraries have been updated to the latest stable release (Intel OneAPI 2025.3).

Mathematics

  • New static Interpolation class with linear, cubic, Akima, and inverse-linear methods.
  • New 1D interpolation methods: log-linear, log-log, periodic, circular.
  • New SignalMath convenience API for FFT, convolution/correlation, windowing, and PSD estimation.
  • New optimized convolution/cross-correlation kernels with configurable padding and kernel anchor.
  • New built-in nonlinear curve types, including: Michaelis–Menten, Gompertz, Richards, Weibull CDF, EMG, Pseudo-Voigt, Damped Sine, Power, and Double Sigmoid.

 

page_top_icon