feat: add solver-neutral QP contracts

This commit is contained in:
梁薄云
2026-08-03 23:13:56 +08:00
parent 333e047bc4
commit 104081e4a9
9 changed files with 597 additions and 2 deletions
@@ -0,0 +1,48 @@
using System;
using MultiWheelC.TrajectoryPlanning.Utils;
namespace MultiWheelC.TrajectoryPlanning.EMPlanner;
public sealed class QpSolverSettings
{
public QpSolverSettings(
int maximumIterations,
double absoluteTolerance,
double relativeTolerance,
TimeSpan timeLimit,
bool enableWarmStart,
bool enablePolishing,
bool enableNativeVerboseOutput)
{
if (maximumIterations <= 0)
throw new ArgumentOutOfRangeException(nameof(maximumIterations));
if (!NumericGuard.IsPositiveFinite(absoluteTolerance))
throw new ArgumentOutOfRangeException(nameof(absoluteTolerance));
if (!NumericGuard.IsPositiveFinite(relativeTolerance))
throw new ArgumentOutOfRangeException(nameof(relativeTolerance));
if (timeLimit <= TimeSpan.Zero)
throw new ArgumentOutOfRangeException(nameof(timeLimit));
MaximumIterations = maximumIterations;
AbsoluteTolerance = absoluteTolerance;
RelativeTolerance = relativeTolerance;
TimeLimit = timeLimit;
EnableWarmStart = enableWarmStart;
EnablePolishing = enablePolishing;
EnableNativeVerboseOutput = enableNativeVerboseOutput;
}
public int MaximumIterations { get; }
public double AbsoluteTolerance { get; }
public double RelativeTolerance { get; }
public TimeSpan TimeLimit { get; }
public bool EnableWarmStart { get; }
public bool EnablePolishing { get; }
public bool EnableNativeVerboseOutput { get; }
}