Home - vorcyc/Vorcyc.Mathematics GitHub Wiki
0.10.24
๐Full navigation
Vorcycยฎ Mathematics is a .NET-oriented math library designed to leverage the latest .NET features and deliver high-performance, accurate mathematical functions and operations. It is written in C# and can be used in any .NET application.
Main goals:
- Leverage the latest .NET features for best performance, for example:
- SIMD-accelerated serial CPU computation, parallel computation, and generic math.
- Use
Span<T>instead of arrays for parameters; useMemory<T>for fields. - Use managed pointers and memory pools to improve performance.
- Fill gaps in built-in .NET math where common functions are missing.
- Provide additional mathematical algorithms and operations.
Targets .NET 10.0 and above.
This package targets a minimum of .NET 10.
- SIMD-accelerated serial CPU computation
- Parallel computation (
ComputingContext) - Generic math
GPU / CUDA policy: The main package does not include GPU acceleration; ILGPU and experimental CudaFFT have been removed. Computation runs on the CPU by default (ComputingContext). See the dedicated note for rationale, alternatives, and future extension principles.
๐GPU policy
- System.Numerics.Tensors: version 10.0.9
Core module: Provides basic math operations, common functions, and extension methods, covering array operations, base conversion, bit math, combinatorics, constants, number mapping, pinnable arrays, random number generation, trigonometry, and various math functions.
๐Manual
ComputingContext: Lightweight CPU execution policy (scalar / SIMD / parallel / auto), supporting context parameters and ComputingScope; integrated into FFT, statistics, matrix/vector ops, curve fitting, batch DL, parallel MFCC, Mel audio frontends, and Trainer.Fit* training entry points. Includes numerical equivalence tests (see the manual section "Verification and tests").
๐Manual
Deep learning module: 0.9 provides a differentiable training stack: BatchTensor (NHWC), BatchSequential / Sequential model containers, 20+ batch layers (convolution, depthwise, LayerNorm, Dropout, residual/SE, etc.), Trainer.FitBatchSequential / FitCnnMlp, IBatchLoss, Adam/SGD optimizers, and ModelSerializer v3 (architecture metadata + weights). The legacy static Layers class remains.
๐Manual
Linear algebra module: :blue_book:Manual
Also includes SVM, KNN regression, clustering (DBSCAN, GMM, KMeans, etc.), dimensionality reduction (PCA with out-of-sample Transform from 0.10.18, t-SNE, LDA), blind source separation (ICA / FastICA), Isolation Forest anomaly detection with JSON snapshots (0.10.11), GPR predictive std / variance (0.10.10), CurveFitting SIMD large-N StackOverflow fix (0.10.16), classic fitter CancellationToken (0.10.17), extended model JSON persistence, and various distance metrics. Runnable examples: Examples/MachineLearning_example/.
๐Manual
Signal processing module: Rich signal processing across audio effects, feature extraction, filtering (IirFilter<T> / FirFilter<T> / ZiFilter<T> / FDA-in-T from 0.10.18; empty zpk ZpToTf([]) โ [1] from 0.10.20), Fourier transforms (Fft<T> / RealFft<T> from 0.10.18), convolution (Convolver<T> / Operation.Convolve<T> from 0.10.19), common operations, signal definition and manipulation, transforms (mode decomposition stays in T from 0.10.18), and window functions. From 0.9, Signal / SignalSegment are the primary time-domain APIs (float sample rate, zero-copy slicing, ReadOnlySpan hot paths); DiscreteSignal remains but is obsolete. See Signal definition and related operations.
๐Manual
Numerics module: Types for numerical computation including integers, floating-point numbers, complex numbers, rationals, fractions, and more. High-precision numeric operations with conversion between numeric types.
๐Manual
Statistics module: Statistical analysis of numeric data across multiple data structures and numeric types. Includes extreme value search, sum, mean, variance, and methods to find max/min values and their indices. Uses hardware acceleration where possible.
๐Manual
Calculus module: Comprehensive tools including limits, integration, derivatives, Taylor series, Fourier series, Runge-Kutta ODE solvers, and Newton-Raphson root finding.
๐Manual
FFTW extension (separate NuGet package: Vorcyc.Mathematics.Extensions.FFTW, 0.10.24; no FFTW API change): .NET wrapper over the native FFTW library for high-performance discrete Fourier transforms. Supports single- and double-precision 1D / 2D / 3D / N-D complex-to-complex (C2C), real-to-complex (R2C), complex-to-real (C2R), and real-to-real (R2R) transforms. Also includes FFT-based Hilbert transform, envelope computation, and extension methods to convert experimental signal types to the frequency domain.
๐Manual
The Examples/ directory contains standalone runnable projects that demonstrate real-world use of the main library (not published on NuGet). Currently includes: Audio_example (NAudio WAV I/O, MFCC analysis, training and inference); Core_example (matrix multiply, Span statistics, VectorSpan, ComputingContext scope); MachineLearning_example (classification/regression pipelines); Colorization_example (image colorization, Emgu.CV); SignalProcessing_example (Signal, FFT, MFCC, filtering, and effects); DeepLearning_example (training, serialization, curve fitting); Calculus_example (integration, ODEs, root finding, series).
๐Manual