DotNetOptimization.Abstractions 1.0.0

dotnet add package DotNetOptimization.Abstractions --version 1.0.0
                    
NuGet\Install-Package DotNetOptimization.Abstractions -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DotNetOptimization.Abstractions" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotNetOptimization.Abstractions" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="DotNetOptimization.Abstractions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DotNetOptimization.Abstractions --version 1.0.0
                    
#r "nuget: DotNetOptimization.Abstractions, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DotNetOptimization.Abstractions@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DotNetOptimization.Abstractions&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=DotNetOptimization.Abstractions&version=1.0.0
                    
Install as a Cake Tool

DotNetOptimization.Abstractions

NuGet Downloads CI .NET License: MIT

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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