DotNetOptimization.Abstractions
1.0.0
dotnet add package DotNetOptimization.Abstractions --version 1.0.0
NuGet\Install-Package DotNetOptimization.Abstractions -Version 1.0.0
<PackageReference Include="DotNetOptimization.Abstractions" Version="1.0.0" />
<PackageVersion Include="DotNetOptimization.Abstractions" Version="1.0.0" />
<PackageReference Include="DotNetOptimization.Abstractions" />
paket add DotNetOptimization.Abstractions --version 1.0.0
#r "nuget: DotNetOptimization.Abstractions, 1.0.0"
#:package DotNetOptimization.Abstractions@1.0.0
#addin nuget:?package=DotNetOptimization.Abstractions&version=1.0.0
#tool nuget:?package=DotNetOptimization.Abstractions&version=1.0.0
DotNetOptimization.Abstractions
Introduction
DotNetOptimization.Abstractions is a tiny, dependency-free package holding the shared
contracts for the DotNetOptimization family of .NET optimizers — for example
DotNetDifferentialEvolution and
DotNetNelderMead.
Because every optimizer in the family speaks these same contracts, a single objective implementation drives all of them with no adapters, and the result of one optimizer (e.g. a global search) can seed another (e.g. a local refinement) seamlessly.
All objectives are minimized: lower fitness values are better.
What's inside
| Type | Purpose |
|---|---|
IFitnessFunctionEvaluator |
The objective contract. Two Evaluate overloads — one plain, one with a workerIndex for multi-threaded execution. |
BaseRandomProvider |
Abstraction over a random source, so a deterministic seeded provider can be substituted in tests. |
RandomProvider |
The default BaseRandomProvider, backed by the thread-safe Random.Shared. |
ISolution |
A read-only solution snapshot: Genes (parameter vector) + FitnessFunctionValue. The shared result shape. |
Installation
To use this library, you need .NET SDK version 8.0 or higher.
dotnet add package DotNetOptimization.Abstractions
Typically you do not reference this package directly — it comes in transitively when you install one of the family's optimizers. Reference it explicitly only when you write a library that should remain optimizer-agnostic.
Usage
Implement the objective once; reuse it with any optimizer in the family:
using DotNetOptimization.Abstractions;
public sealed class RosenbrockEvaluator : IFitnessFunctionEvaluator
{
public const double A = 1.0;
public const double B = 100.0;
public double Evaluate(ReadOnlySpan<double> genes)
{
var x = genes[0];
var y = genes[1];
return Math.Pow(A - x, 2) + B * Math.Pow(y - x * x, 2);
}
public double Evaluate(int workerIndex, ReadOnlySpan<double> genes) => Evaluate(genes);
}
The same RosenbrockEvaluator can be handed to a Differential Evolution run and to a
Nelder–Mead refinement without any glue.
Compatibility
This package is a forever-stable contract. It evolves only additively (new members are added
via C# default-interface-methods so existing implementations keep compiling). Consumers reference a
floor version (>= 1.0.0); .NET's nearest-wins resolution handles diamond dependencies.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on DotNetOptimization.Abstractions:
| Package | Downloads |
|---|---|
|
DotNetDifferentialEvolution
A .NET library for Differential Evolution optimization with multi-processing and SIMD acceleration. |
|
|
DotNetNelderMead
A .NET library for Nelder–Mead simplex optimization: standard and adaptive (Gao–Han 2012) coefficients, automatic restarts, bounded-domain handling, and parallel multi-start. Part of the DotNetOptimization family. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 53 | 6/2/2026 |