ZiggyMath is a comprehensive mathematics library optimized for high-performance computing with: ๐ Performance Features: - 5-29x faster memory operations through SIMD acceleration - Zero GC pressure design for real-time applications - Hardware acceleration with AVX2 and ARM64 NEON support - Intelligent workload-aware memory allocation ๐งฎ Mathematical Coverage: - Linear Algebra: Gaussian elimination, LU/QR decomposition, eigenvalue solvers - Signal Processing: FFT, convolution, filtering with hardware acceleration - Statistics: Regression, probability distributions, descriptive statistics - Calculus: Numerical integration, optimization, differentiation - SIMD Operations: Vectorized mathematical functions ๐๏ธ Advanced Features: - MathComputationContext for workload optimization - Comprehensive performance monitoring and benchmarking - Matrix layout optimization for cache efficiency - Advanced memory pooling strategies Perfect for scientific computing, data analysis, machine learning, and real-time systems requiring high-performance mathematical operations.
$ dotnet add package ZiggyMathHigh-performance mathematics library with SIMD acceleration and zero GC pressure.
using ZiggyMath;
using ZiggyMath.Core;
// Create vectors
using var v1 = new Vector(1000);
using var v2 = new Vector(1000);
// Initialize and compute
for (int i = 0; i < 1000; i++)
{
v1[i] = Math.Sin(i * 0.01);
v2[i] = Math.Cos(i * 0.01);
}
double dotProduct = v1.DotProduct(v2);
// Matrix operations
using var matrix = new Matrix(100, 100);
using var result = Matrix.Multiply(matrix, matrix.Transpose());
ZiggyMath delivers significant performance improvements:
dotnet add package ZiggyMath
Or add to your .csproj:
<PackageReference Include="ZiggyMath" Version="1.0.0" />
public void ConfigureServices(IServiceCollection services)
{
// Register default allocator
services.AddSingleton<IUnmanagedMemoryAllocator>(ZiggyMath.DefaultAllocator);
// Or use custom allocator for specific workloads
services.AddSingleton<IUnmanagedMemoryAllocator>(provider =>
new HybridAllocator(new SystemMemoryAllocator()));
}
public static class MathConfiguration
{
public static IUnmanagedMemoryAllocator GetAllocatorForWorkload(MathWorkload workload)
{
return workload switch
{
MathWorkload.LinearAlgebra => new SlabAllocator(new SystemMemoryAllocator()),
MathWorkload.SignalProcessing => new LargeBlockAllocator(new SystemMemoryAllocator()),
MathWorkload.SmallComputations => new UnmanagedMemoryPool(new SystemMemoryAllocator()),
_ => ZiggyMath.DefaultAllocator
};
}
}
public enum MathWorkload
{
LinearAlgebra,
SignalProcessing,
SmallComputations,
GeneralPurpose
}
ZiggyMath is built on top of ZiggyAlloc, a high-performance memory management library that provides the foundation for ZiggyMath's zero-GC pressure design and advanced allocation strategies.
For detailed API documentation, see the docs directory.
MIT License - see LICENSE file for details.