2using System.Xml.Serialization;
11[XmlType(TypeName =
"linearConstraint")]
55 ArgumentNullException.ThrowIfNull(
90 [XmlAttribute(
"name")]
100 [XmlElement(
"leftHandSide")]
110 [XmlAttribute(
"sense")]
120 [XmlAttribute(
"rightHandSide")]
131 [XmlElement(
"domainKey")]
142 [XmlElement(
"description")]
154 [XmlAttribute(
"isEnabled")]
172 throw new InvalidOperationException(
173 "A linear constraint identifier must be " +
174 "strictly positive.");
177 if (
string.IsNullOrWhiteSpace(
180 throw new InvalidOperationException(
181 "A linear constraint name is required.");
184 ArgumentNullException.ThrowIfNull(
192 throw new InvalidOperationException(
193 "A mathematical constraint sense is required.");
201 throw new InvalidOperationException(
202 "A linear constraint right-hand side must be a " +
void EnsureValid()
Validates the linear constraint.
string Name
Gets or sets the constraint name.
string DomainKey
Gets or sets an optional domain key used to identify the business meaning of the constraint.
double RightHandSide
Gets or sets the right-hand-side constant value.
LinearConstraint Clone()
Creates an independent copy of this constraint.
MathematicalConstraintSense Sense
Gets or sets the relational sense of the constraint.
bool IsEnabled
Gets or sets a value indicating whether the constraint is enabled.
LinearExpression LeftHandSide
Gets or sets the left-hand-side linear expression.
LinearConstraint()
Initializes an empty linear constraint.
LinearConstraint(int id, string name, LinearExpression leftHandSide, MathematicalConstraintSense sense, double rightHandSide)
Initializes a linear constraint.
string Description
Gets or sets an optional description.
int Id
Gets or sets the unique constraint identifier within the mathematical model.
Represents a linear expression composed of variable terms and a constant value.
MathematicalConstraintSense
Identifies the relational sense of a mathematical constraint.