19 IEnumerable<CutCoefficient> coefficients,
25 throw new ArgumentOutOfRangeException(nameof(l));
28 ArgumentNullException.ThrowIfNull(s);
29 ArgumentNullException.ThrowIfNull(coefficients);
33 if (_s.Any(period => period < 0 || period > l))
35 throw new ArgumentOutOfRangeException(
37 "Every period in S must be between 0 and l.");
40 if (_s.Distinct().Count() != _s.Length)
42 throw new ArgumentException(
43 "The set S cannot contain duplicate periods.",
49 _coefficients = coefficients
50 .Where(
static coefficient => coefficient.Coefficient != 0.0)
53 if (_coefficients.Length == 0)
55 throw new ArgumentException(
56 "A cut must contain at least one nonzero coefficient.",
57 nameof(coefficients));
60 if (!
double.IsFinite(rightHandSide))
62 throw new ArgumentOutOfRangeException(
63 nameof(rightHandSide),
64 "The right-hand side must be finite.");