LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
LagrangianSubgradientUpdater.cs
Go to the documentation of this file.
2
4
5/// <summary>
6/// Performs one projected dual-ascent subgradient update for the
7/// alpha.36 minimization convention.
8/// </summary>
9public static class LagrangianSubgradientUpdater
10{
11 public static double Update(
12 double currentMultiplier,
13 double residual,
14 double stepSize,
16 {
18 sense,
19 currentMultiplier);
20
21 if (double.IsNaN(residual) ||
22 double.IsInfinity(residual))
23 {
24 throw new InvalidOperationException(
25 "A Lagrangian subgradient residual must be finite.");
26 }
27
28 if (double.IsNaN(stepSize) ||
29 double.IsInfinity(stepSize) ||
30 stepSize < 0.0)
31 {
32 throw new InvalidOperationException(
33 "A Lagrangian subgradient step size must be finite and non-negative.");
34 }
35
36 double candidate =
37 currentMultiplier +
38 stepSize *
39 residual;
40
41 if (double.IsNaN(candidate) ||
42 double.IsInfinity(candidate))
43 {
44 throw new InvalidOperationException(
45 "The Lagrangian subgradient update produced a non-finite multiplier.");
46 }
47
49 sense,
50 candidate);
51 }
52}
Encodes the multiplier-domain convention that guarantees a valid lower bound for minimization models ...
static void EnsureValid(MathematicalConstraintSense sense, double multiplier)
static double Project(MathematicalConstraintSense sense, double value)
Performs one projected dual-ascent subgradient update for the alpha.36 minimization convention.
static double Update(double currentMultiplier, double residual, double stepSize, MathematicalConstraintSense sense)
MathematicalConstraintSense
Identifies the relational sense of a mathematical constraint.