Dew.Math.Core
Cross-platform managed math library for .NET
Dew.Math.Core is the portable, pure managed edition of the Dew.Math library. It provides the same
high-level vector and matrix programming model, expression parser, probability and optimization
toolkits, and special function support, but does not rely on any native runtime libraries. This
enables maximum compatibility across platforms and deployment environments.
Use Dew.Math.Core when building applications and shared libraries that must run on Windows, Linux,
macOS, iOS, Android, MAUI, Uno, WebAssembly, Unity* and containerized or plugin-based systems
without requiring platform-specific native dependencies.
Key Features
- Same programming model as Dew.Math: Vectors, Matrices, subranges, views and capacity-based memory design
- Pure managed implementation (no native BLAS, LAPACK or external libraries required)
- Operator overloads and method-based APIs for vectorized computation
- Complex number support throughout the vector and matrix system
- Expression parser and vectorized formula evaluation
Optimization and Curve Fitting
Includes nonlinear optimization methods:
- Simplex (Nelder-Mead)
- Marquardt (with numerical derivatives)
- BFGS
- Conjugate Gradient
- Trust Region
Probability and Special Functions
- Probability distributions and random number generators
- Monte Carlo workflows
- Polynomial tools, spline interpolation, piecewise functions and polynomial fitting
- Numerical differentiation and integration routines
- Special mathematical functions including:
Airy, Bessel, Gamma-related families, Legendre polynomials, elliptic integrals
Advanced Memory Model
The same advanced memory and concurrency design from Dew.Math is also available in Dew.Math.Core:
- Vectors and Matrices expose a Capacity property to reduce allocation count
- Subranges (views / spans) allow memory partitioning without copying
- Object pool enables parallel allocation with minimal GC pressure
- Designed for multi-threading from the start (MtxVec lineage)
- Nearly all math operations avoid internal allocations
This makes Dew.Math.Core suitable for long-running simulation engines, model servers, and streaming
computation pipelines where predictable allocation patterns matter.
Platform and Deployment Model
- No native libraries required (pure managed)
- Works on:
- Windows
- Linux
- macOS
- iOS / Android (via Xamarin / MAUI)
- Uno, Avalonia, Blazor / WebAssembly
- Unity* (subject to IL2CPP/AOT constraints)
Target Frameworks
- netstandard2.0
- net8.0
- net9.0
Drop-in Replaceable Architecture (Important)
Dew.Math.Core shares the same namespaces and class names as:
- Dew.Math (Windows hardware-accelerated)
- Dew.Math.Linux (Linux hardware-accelerated)
This allows switching editions without modifying code.
Example deployment workflow:
- Develop on Windows using Dew.Math.Core (maximum portability)
- Before final deployment:
- Replace Dew.Math.Core with Dew.Math for Windows acceleration, or
- Replace Dew.Math.Core with Dew.Math.Linux for Linux acceleration
- Rebuild your solution. No source changes required.
No #ifdef, no dual code paths, no API differences.
Hardware-Accelerated Editions (Optional)
| Dew.Math | Windows | Native AVX2 / AVX-512 acceleration |
| Dew.Math.Linux | Linux | Native AVX2 / AVX-512 acceleration |
| Dew.Math.Core | All | Managed-only, portable |
Examples
Documentation
License
Commercial license. See DewMathLicense.txt included in this package.
All Dew.* NuGet packages on nuget.org are trial versions and work only inside Visual Studio IDE.