37 if (
string.IsNullOrWhiteSpace(
40 throw new ArgumentException(
41 "A solver name is required.",
45 if (
string.IsNullOrWhiteSpace(
48 throw new ArgumentException(
49 "A diagnostic message is required.",
79 params
string?[] candidatePaths)
81 ArgumentNullException.ThrowIfNull(
88 if (
string.IsNullOrWhiteSpace(
95 Environment.ExpandEnvironmentVariables(
111 NotSupportedException or
112 PathTooLongException)
141 if (
string.IsNullOrWhiteSpace(
144 throw new ArgumentException(
145 "An environment-variable name is required.",
150 Environment.GetEnvironmentVariable(
151 name.Trim())?.Trim() ??
Provides small reusable helpers for native solver plugins.
static string FindFirstExistingPath(params string?[] candidatePaths)
Returns the first existing full path among candidate paths.
static SolverAvailabilityInfo CreateAvailability(SolverKind solverKind, string solverName, SolverAvailabilityStatus status, string diagnostic)
Creates an unavailable solver description with one diagnostic message.
static string ReadEnvironmentVariable(string name)
Reads and trims an environment variable.
Describes the availability and detected installation details of a mathematical optimization solver.
void AddDiagnostic(string message)
Adds a diagnostic message.
SolverKind
Identifies a supported mathematical optimization solver.
SolverAvailabilityStatus
Describes the availability state of a solver adapter on the current computer.