Repository navigation
HOME
0.10.24
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
-
- 🔖 ArrayExtension class
- 🔖 BaseConverter class
- 🔖 BitMathExtension class
- 🔖 Combinatorics class
- 🔖 ConstantsFp32 class
- 🔖 NumberMapper class
- 🔖 PinnableArray<T> class
- 🔖 SimpleRNG_Fp32 and SimpleRNG_Fp64 classes
- 🔖 TrigonometryHelper class
- 🔖 VMath class
- 🔖 Pinned buffers (Buffers)
- 🔖 IPinnedBuffer<T> interface
- 🔖 POHBuffer<T> class
- 🔖 NativeBuffer<T> class
-
- 🔖 0.9 classifier walkthrough
- 🔖 KNN<T> class
- 🔖 MultipleLinearRegression<T> class
- 🔖 SimpleLinearRegression<T> class
- 🔖 SupportVectorMachine<TSelf> class
- 🔖 DBSCAN<T> class
- 🔖 ExpectationMaximization<T> class
- 🔖 GMM<T> class
- 🔖 HierarchicalClustering<T> class
- 🔖 KMeansClusterer<T> class
- 🔖 VectorQuantization<T> class
- 🔖 FactorAnalysis<T> class
- 🔖 PCA<TSelf> class
- 🔖 TSNE<T> class
- 🔖 Distance metric classes
-
📒 Examples
-
📒 GPU 策略说明
- 🔖 为何放弃主包 GPU
- 🔖 当前性能路径
- 🔖 若仍需要更强算力
-
📒 计算上下文模块
-
📒 核心模块
-
📒 深度学习模块
-
📒 线性代数模块
-
📒 机器学习模块
- 🔖 0.9 分类器完整示例
- 🔖 KNN<T> 类
- 🔖 MultipleLinearRegression<T> 类
- 🔖 SimpleLinearRegression<T> 类
- 🔖 SupportVectorMachine<TSelf> 类
- 🔖 DBSCAN<T> 类
- 🔖 ExpectationMaximization<T> 类
- 🔖 GMM<T> 类
- 🔖 HierarchicalClustering<T> 类
- 🔖 KMeansClusterer<T> 类
- 🔖 VectorQuantization<T> 类
- 🔖 FactorAnalysis<T> 类
- 🔖 PCA<TSelf> 类
- 🔖 TSNE<T> 类
- 🔖 距离度量类
-
📒 信号处理模块
-
📒 数值模块
-
📒 统计模块
- 🔖 基础统计函数
- 🔖 高级统计函数
- 🔖 稳健统计 / RunningMoments
- 🔖 其它统计函数
- 🔖 分布相关函数
- 🔖 时间序列分析
- 🔖 IComparable 扩展
- 🔖 ExtremeValueFinder
- 🔖 INumber 扩展
-
📒 FFTW 扩展
-
📒 示例