LotSizingDataModel.Solver 2.0.1
Solver-independent modeling, execution, monitoring and adapter infrastructure.
Loading...
Searching...
No Matches
LagrangianMultiplier.cs
Go to the documentation of this file.
2
3/// <summary>
4/// Associates one relaxed mathematical constraint with its
5/// Lagrangian multiplier.
6/// </summary>
7public sealed class LagrangianMultiplier
8{
10 int constraintId,
11 double value)
12 {
14 constraintId;
15
16 Value =
17 value;
18
20 }
21
22 public int ConstraintId
23 {
24 get;
25 }
26
27 public double Value
28 {
29 get;
30 }
31
32 public void EnsureValid()
33 {
34 if (ConstraintId <= 0)
35 {
36 throw new InvalidOperationException(
37 "A Lagrangian multiplier must reference a strictly positive constraint identifier.");
38 }
39
40 if (double.IsNaN(Value) ||
41 double.IsInfinity(Value))
42 {
43 throw new InvalidOperationException(
44 "A Lagrangian multiplier must be finite.");
45 }
46 }
47}