π Changelog
All notable changes to CSharpNumerics are documented here.
This format is based on Keep a Changelog and follows Semantic Versioning.
Legend:
π΄ Breaking Change β requires code changes when upgrading
π’ Added β new features
π΅ Changed β changes in existing functionality
π‘ Deprecated β features that will be removed in a future version
π§ Fixed β bug fixes
ποΈ Removed β features that have been removed
[2.6.5] β 2026-03-21β
π’ Addedβ
Reinforcement Learning (CSharpNumerics.ML.ReinforcementLearning)β
A complete RL framework under ML/ReinforcementLearning/:
- Tabular Agents β
QLearning,SARSA, andMonteCarloControlwith sharedTabularAgentbase class, Q-table access, and state-mapper support. - Value-Based (Deep) Agents β
DQNwith target network and experience replay,DoubleDQNto reduce overestimation bias, andDuelingDQNwith separate value/advantage streams. - Policy Gradient Agents β
REINFORCE(Monte Carlo policy gradient with optional baseline),ActorCritic(A2C with entropy bonus), andPPO(clipped surrogate + GAE). - Continuous Control β
DDPG(deterministic actor-critic with Polyak-averaged target networks). - Environments β
GridWorld,CartPole,MountainCar(discrete), andPendulum(continuous torque). - Exploration Policies β
EpsilonGreedy,SoftmaxPolicy,GaussianNoise, andOrnsteinUhlenbeckprocess, all with per-episode decay andClone(). - Replay Buffers β
ReplayBuffer(uniform circular buffer) andPrioritizedReplayBuffer(TD-error prioritized sampling). - Experiment API β
RLExperimentfluent builder withRun(),RunGrid(), andRunMonteCarlo()modes;RLPipelineGridfor hyperparameter grid search across agent types;EpisodeEvaluatorfor standalone agent evaluation with confidence intervals. - Diagnostics β
QValueHeatmap(tabular Q-value / greedy-policy maps),PolicyVisualizer(action probabilities, entropy, dominant action), andValueFunctionSurface(1D/2D value-function sampling for deep agents). - Interfaces β
IAgent,IEnvironment,IPolicy,IReplayBuffer. - Core Types β
Transition,Episode,TrainingResult(return/loss/exploration curves).
Neural Network (CSharpNumerics.ML.NeuralNetwork)β
- Shared
NeuralNetworkclass used by all deep RL agents and MLP models β forward pass, backpropagation, and weight management.
GIS-RL Integration (CSharpNumerics.Engines.GIS.RL)β
Bridges the GIS simulation engine with the RL framework:
IGISEnvironmentβ interface extendingIEnvironmentwithGeoGrid,TimeFrame,Threshold,ActionCost,MaxSteps, andGridSnapshot.PlumeEnvironmentβ RL environment wrappingPlumeSimulatorin transient mode (8-dim observation, 6 discrete actions: barriers + emission filter).ScenarioRLAnalyzerβ fluent API for training RL agents on GIS scenarios withFor(emissionRate, position),For(IGISEnvironment), andFor(IEnvironment)entry points; supports physics config, environment tuning, grid search, and replay buffers.
Optimization (CSharpNumerics.Numerics.Optimization)β
A numerical optimization module under Numerics/Optimization/:
- Single-Objective β
GradientDescent,Adam,CoordinateDescent, andMinimizer(high-level wrapper). - Multi-Objective β
NSGA2(Non-dominated Sorting Genetic Algorithm II) andParetoFrontfor Pareto-optimal solution sets. - Convergence Strategies β
EarlyStopping,LearningRateSchedule, andMaxIterationsOrTolerance. - Interfaces β
IOptimizer,IObjectiveFunction,IConvergenceCriterion.
Dimensionality Reduction β PCA (CSharpNumerics.ML.DimensionalityReduction)β
- Reworked
PCAimplementation with power iteration and deflation for eigendecomposition. ExposesComponents,ExplainedVariance,ExplainedVarianceRatio, andMean. Integrates into both supervised and clustering pipelines viaAddReducer<PCA>()andWithReducer().
π§ Fixedβ
- Experiment bug β Fixed issue in
ClusteringExperiment(and related experiment infrastructure). - Supervised model corrections β Fixes across
Logistic,LinearSVC,KernelSVC,MLPClassifier,ElasticNet,Lasso,LinearSVR,KernelSVR, andMLPRegressor(numerical stability, hyperparameter handling, andNeuralNetworkintegration for MLP models).
[2.6.3] β 2026-03-15β
π’ Addedβ
GIS / Geo-Engine (CSharpNumerics.Engines.GIS)β
A full geospatial simulation engine under Engines/GIS/:
- Coordinates & Projections β
GeoCoordinatetype andProjectionclass with coordinate-system transforms. - GeoGrid β
GeoGrid,GeoCell, andGridSnapshotfor spatial grid-based modelling. - Plume Simulation β
PlumeSimulatorfor atmospheric plume dispersion on a geo-grid, andPlumeMonteCarloModelfor stochastic ensemble runs withScenarioVariationsupport. - Scenario Analysis β
RiskScenario,RiskScenarioBuilder,ScenarioResult, andTimeFramefor building and evaluating risk scenarios. - Spatial Analysis β
ProbabilityMap,ScenarioClusterAnalyzer, andTimeAnimatorfor post-processing simulation results. - Export β
GeoJsonExporter,CesiumExporter, andUnityBinaryExporterfor shipping results to web maps, Cesium 3D globe, or Unity.
Nuclear Physics (CSharpNumerics.Physics.Materials.Nuclear)β
A nuclear-physics module under Physics/Materials/Nuclear/:
- Isotopes β
Isotopedata type andIsotopeLibrarywith built-in entries (Cs-137, I-131, Sr-90, Co-60, etc.) and runtime registration of custom isotopes. - Radioactive Decay β
Decayclass for activity, remaining mass, and time-dependent calculations. - Decay Chains β
DecayChainwith Bateman-equation solver (e.g. Cs-137 β Ba-137m β Ba-137, I-131 β Xe-131). - Radiation Dose β
RadiationDosewith point-source dose rate, ground-shine dose, and inhalation dose models. - Materials β
Materialshelper class for physical material properties.
Environmental Extensionsβ
- Added
GaussianPufftransient dispersion model toEnvironmentalExtensions(time-dependent puff advecting downwind with Briggs Ο).
[2.6.1] β 2026-03-07β
π’ Addedβ
Complex Linear Algebraβ
ComplexMatrixβ full complex-valued matrix typeComplexVectorandComplexVectorNβ complex-valued vector types
Tensor & Scalar Fieldsβ
ScalarFieldandTensorFieldobjectsElectroMagneticFieldExtensionsfor electromagnetic field computations
Environmental Physicsβ
EnvironmentalExtensionswith atmospheric/environmental calculationsStabilityClassenum for atmospheric stability classification
Finite Difference Frameworkβ
BoundaryCondition,Grid2D, andGridOperatorsfor 2D finite difference methods
Time Steppingβ
ITimeStepperinterface andTimeStepResultmodelEulerStepper,RK4Stepper,AdaptiveRK45Stepper, andVelocityVerletStepperimplementations
Heat Physicsβ
HeatExtensionsfor heat transfer computations
Dimensionality Reduction (ML)β
IDimensionalityReducerinterfacePCA(Principal Component Analysis) implementation- Updated
ClusteringExperiment,ClusteringGrid,ClusteringPipeline,Pipeline, andPipelineGridto support dimensionality reduction
π΅ Changedβ
Game Physics Engine β Refactoringβ
- Moved physics world, collision detection/response, constraint solver, broad-phase algorithms, constraints (ball socket, distance, hinge, spring joints), and physics objects (AABB, bounding sphere, contact point) from
Physics/Applied/toEngines/Game/ - Moved
FileExtensionsfromExtensions/toEngines/Common/Extensions/
[2.6.0] β 2026-03-12β
π’ Addedβ
Fluid Dynamics (CSharpNumerics.Physics)β
- Added
FluidExtensionsbridgingVectorField/ScalarFieldto classical fluid dynamics:- NavierβStokes:
ConvectiveAcceleration(this VectorField, (double, double, double), double),ViscousTerm(this VectorField, double, (double, double, double), double),PressureGradientForce(this ScalarField, (double, double, double)),NavierStokesResidual(this VectorField, ScalarField, double, double, (double, double, double), Vector)(full and Euler inviscid forms),IncompressibilityResidual(this VectorField, (double, double, double)) - Bernoulli's principle:
BernoulliConstant(this double, double, double, double),BernoulliPressure(this double, double, double, double, double, double),DynamicPressure(this double, double),StagnationPressure(this double, double, double) - Continuity:
MassFlux(this VectorField, double)(constant and variable density),ContinuityResidual(this VectorField, double, (double, double, double)),VolumeFlowRate(this double, double),ContinuitySpeed(this double, double, double) - Vorticity & topology:
Vorticity(this VectorField, (double, double, double)),Enstrophy(this VectorField, (double, double, double)),HelicityDensity(this VectorField, (double, double, double)),VelocityFromStreamFunction(this ScalarField) - Drag & lift:
DragForce(this double, double, double, Vector),LiftForce(this double, double, double, double),TerminalVelocity(this double, double, double, double),StokesDrag(this double, double, double) - Dimensionless numbers:
ReynoldsNumber(this double, double, double, double),MachNumber(this double, double),FroudeNumber(this double, double),StrouhalNumber(this double, double, double),WeberNumber(this double, double, double, double) - Viscous flows:
PoiseuilleFlowRate(this double, double, double, double),PoiseuilleVelocity(this double, double, double, double, double) - Hydrostatics:
HydrostaticPressure(this double, double, double),BuoyantForce(this double, double),KineticEnergyDensity(this Vector, double),MomentumDensity(this Vector, double)
- NavierβStokes:
Wave Equations (CSharpNumerics.Physics.Waves)β
- Added
WaveEquation1Dβ finite-difference solver for the 1D wave equation with fixed or open boundaries. IncludesSnapshot(),SpaceTimeField(double, double),EnergyDensity(this Vector, Vector),FrequencyContent(int, double, double),StandingWaveMode(int), and CFL stability check - Added
WaveEquation2Dβ finite-difference solver for the 2D wave equation on a rectangular grid. Supports initial conditions, energy tracking, and 2D snapshot arrays - Added
DampedDrivenWaveEquation1Dβ 1D wave equation with damping (Ξ±) and an external driving source term - Added
WavePacketβ Gaussian wave packet with dispersion. ComputesPhaseVelocity(double, double),GroupVelocity(double, double),Width(t),SpreadRate(double, double), andPropagate(t) - Added
WaveSuperpositionβ harmonic superposition engine withBeatFrequency(),InterferencePattern(double[], double), andFourierCoefficients(double[], double) - Added
IWaveFieldinterface andBoundaryTypeenum
Audio Engine (CSharpNumerics.Engines.Audio)β
- Added
SignalGeneratorβ waveform generation (Sine, Square, Sawtooth, Triangle, WhiteNoise) - Added
AudioOscillatorβ stateful oscillator with continuous phase for click-free real-time synthesis - Added
AudioBufferβ sample container with Mix, Normalize, Trim, Fade, Reverse, Resample, and WAV export - Added
Envelope(double)β ADSR (Attack-Decay-Sustain-Release) amplitude shaping - Added
Synthesizerβ additive synthesis combining multiple oscillators with ADSR envelope - Added
AudioFilterβ frequency-domain filtering (LowPass, HighPass, BandPass) via FFT - Added
Reverbβ Schroeder-model reverb with parallel comb filters and series all-pass filters - Added
Delayβ circular-buffer delay line with feedback - Added
Compressorβ dynamic range compression with attack/release envelope - Added
SpatialAudioβ stereo panning (constant-power) and inverse-distance attenuation - Added
SpectrumAnalyzerβ windowed FFT analysis (Hann, Hamming, Blackman, Rectangular) - Added
PitchDetectorβ fundamental frequency detection via autocorrelation or Harmonic Product Spectrum - Added
BeatDetectorβ onset detection via spectral flux with tempo (BPM) estimation
Fourier Series (CSharpNumerics.Numerics.SignalProcessing)β
- Added
FourierSeriesβ real Fourier coefficient analysis and synthesis withPowerSpectrum(),ParsevalEnergy(),TimeDomainEnergy(Func<double, double>, int), and partial-sum reconstruction (SynthesizeRange(double[], int)) for Gibbs phenomenon demonstration
Hypothesis Testing (CSharpNumerics.Statistics)β
- Added
HypothesisTestsExtensionswith full test infrastructure:- Parametric:
TTest(this IEnumerable<double>, double, Alternative, double)(one-sample, two-sample with Welch correction),PairedTTest<T>(this IEnumerable<T>, Func<T, (double before, double after)>, double),ZTest<T>(this IEnumerable<T>, Func<T, double>, double, double, double),FTest(this IEnumerable<double>, IEnumerable<double>, Alternative, double),Anova(this IEnumerable<IEnumerable<double>>, double) - Non-parametric:
MannWhitneyUTest(this IEnumerable<double>, IEnumerable<double>, Alternative, double),WilcoxonSignedRankTest(this IEnumerable<double>, Alternative, double),ChiSquaredTest<T>(this IEnumerable<T>, Func<T, (double observed, double expected)>, double) - All tests return
HypothesisTestResultwith test statistic, p-value, reject/accept decision, confidence interval, effect size, and degrees of freedom
- Parametric:
- Added
Alternativeenum (TwoSided, Less, Greater)
Engine Infrastructure (CSharpNumerics.Engines.Common)β
- Added
ISimulationEngineinterface,SimulationClock,EventBus,FieldSerializer, andPlatformAdapteras shared infrastructure for simulation engines
[2.5.0] β 2026-03-01β
π’ Addedβ
Statistics β Extended Descriptive & Inferential Statisticsβ
- New distributions:
StudentTDistribution,ChiSquaredDistribution,FDistribution(withInverseCdf,TwoTailedPValue,UpperTailPValue) - New descriptive functions:
Median,Percentile,InterquartileRange,Skewness,Kurtosis,SampleVariance,Mode,Range,CumulativeSum,ConfidenceIntervals - New inferential tests:
OneSampleTTest,TwoSampleTTest,PairedTTest,ZTest,ChiSquaredTest,OneWayAnova - New correlations:
PearsonCorrelation(with p-value),SpearmanCorrelation - New regressions:
ExponentialRegression,LogarithmicRegression,PowerRegression,PolynomialRegression
Physics β Oscillation Frameworkβ
SimpleHarmonicOscillatorβ position, velocity, acceleration, phase, energy (kinetic/potential/total), period, frequencyDampedOscillatorβ underdamped/critically damped/overdamped,DampingRegimeenum, envelope functions, energy decay, Q-factorDrivenOscillatorβ forced oscillation with resonance frequency, amplitude response, phase response, steady-state, transient responseCoupledOscillatorsβ N coupled oscillators, normal modes, mode frequencies, energy per oscillator, energy transferIOscillatorinterface for common signature- 2 300+ lines of tests (328 + 677 + 556 + 742)
ML β Supervised Experiment APIβ
SupervisedExperimentβ fluent API mirroringClusteringExperimentfor supervised modelsCrossValidatorConfigβ lazy factory withKFold(),StratifiedKFold(),ShuffleSplit(),LeaveOneOut(),MonteCarlo(),Custom()SupervisedExperimentResultβRankings,Best,BestBy(cvName),BestConfusionMatrix,BestR2,CVResultsScoreDistributionSummaryβ descriptive statistics (mean, median, std, IQR, skewness, kurtosis, CI) for pipeline scores- New methods on
ClusteringExperimentResult:ScoreSummary(),ScorePercentile() - New methods on
SupervisedExperimentResult:ScoreSummary(),ScorePercentile(),RankCorrelation(),ScoreConsistency() - 818 lines of tests (721 supervised + 97 clustering)
π΅ Changedβ
- Refactored
StandardDeviationto support both sample and population variants
[2.4.0] β 2026-02-24β
75 files changed β 9,464 insertions, 1,342 deletions
π’ Addedβ
Clustering (Machine Learning)β
- Full clustering module with KMeans, DBSCAN, and Agglomerative Clustering
ClusteringPipelineandClusteringGridfor automated hyperparameter tuningClusteringExperimentfor running and comparing clustering configurations- Four cluster evaluation metrics: Silhouette Score, Calinski-Harabasz Index, Davies-Bouldin Index, Inertia
MonteCarloClusteringfor stochastic clustering analysisIClusteringModelandIClusteringEvaluatorinterfaces- Result types:
ClusteringResult,ClusteringExperimentResult,MonteCarloClusteringResult KMeansInitandLinkageTypeenums
Monte Carlo Cross-Validation (Machine Learning)β
MonteCarloCrossValidatorfor randomized train/test split validationMonteCarloValidationResultresult type
Statistical Distributionsβ
- Full distributions framework with
IDistributioninterface - Six distributions:
NormalDistribution,BernoulliDistribution,BinomialDistribution,PoissonDistribution,ExponentialDistribution,UniformDistribution
Monte Carlo Simulation (Statistics)β
MonteCarloSimulatorwithIMonteCarloModelinterfaceMonteCarloResultfor simulation output analysis
Random Number Generationβ
RandomGeneratorutility class with extended random sampling capabilities
Advanced Interpolationβ
- Five new interpolation methods:
CubicSplineInterpolation,PolynomialInterpolation(Lagrange/Newton),RationalInterpolation,TrigonometricInterpolation,MultivariateInterpolation
Inferential Statisticsβ
InferentialStatisticsExtensionsfor hypothesis testing
π΅ Changedβ
- Renamed
StatisticsExtensionsβDescriptiveStatisticsExtensionsfor clarity - Changed namespace for
DifferentialEquationExtensionstoCsharpNumerics.Numerics - Changed namespace for
TransformExtensionstoCsharpNumerics.Numerics - Changed namespace for
VectorFieldExtensionstoCsharpNumerics.Numerics - Updated
InterpolationExtensionswith support for new interpolation types - Moved
InterpolationTypeenum from Statistics namespace toCsharpNumerics.Numerics.Enums - Changed namespace for
DerivativeExtensions,IntegrationExtensions,LimitExtensions, andTrigonometryExtensionstoCsharpNumerics.Numerics
ποΈ Removedβ
- Deprecated
Statistics.csmethods class
This changelog is maintained manually. For the full commit history, see the GitHub commit log.