12 IEnumerable<LinearTerm> terms,
13 double constant = 0.0)
15 ArgumentNullException.ThrowIfNull(terms);
17 if (!
double.IsFinite(constant))
19 throw new ArgumentOutOfRangeException(
26 term.Coefficient != 0.0)
37 throw new ArgumentException(
38 "The objective cannot contain duplicate variable identifiers.",
46 public IReadOnlyList<LinearTerm>
Terms => _terms;
LinearObjective(IEnumerable< LinearTerm > terms, double constant=0.0)
Initializes a minimization objective.
IReadOnlyList< LinearTerm > Terms
Gets nonzero objective terms.
double Constant
Gets the objective constant.
Stores one coefficient of a portable linear expression.