Package com.darkcollective.relix.solver
Record Class LinearProgram.Constraint
java.lang.Object
java.lang.Record
com.darkcollective.relix.solver.LinearProgram.Constraint
- Record Components:
coefficients- one coefficient per variable, positionallyrelation- how the weighted sum relates to the boundbound- the right-hand side
- Enclosing class:
LinearProgram
public static record LinearProgram.Constraint(double[] coefficients, LinearProgram.Relation relation, double bound)
extends Record
One linear constraint:
Σ coefficients[i]·x[i] related to bound.-
Constructor Summary
ConstructorsConstructorDescriptionConstraint(double[] coefficients, LinearProgram.Relation relation, double bound) Creates an instance of aConstraintrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoublebound()Returns the value of theboundrecord component.double[]Returns the value of thecoefficientsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.relation()Returns the value of therelationrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Constraint
Creates an instance of aConstraintrecord class.- Parameters:
coefficients- the value for thecoefficientsrecord componentrelation- the value for therelationrecord componentbound- the value for theboundrecord component
-
-
Method Details
-
coefficients
public double[] coefficients()Returns the value of thecoefficientsrecord component.- Returns:
- the value of the
coefficientsrecord component
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
relation
Returns the value of therelationrecord component.- Returns:
- the value of the
relationrecord component
-
bound
public double bound()Returns the value of theboundrecord component.- Returns:
- the value of the
boundrecord component
-