Class LinearTerm
java.lang.Object
org.jreliability.booleanfunction.AbstractHierarchicalTerm
org.jreliability.booleanfunction.common.LinearTerm
- All Implemented Interfaces:
Term
The
LinearTerm
represents a linear constraint of the form: left-hand-side comparator right-hand-side
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
TheLinearTerm.Comparator
determines the comparator in theLinearTerm
, i.e. -
Field Summary
FieldsModifier and TypeFieldDescriptionThe coefficients of the embedded terms.protected final LinearTerm.Comparator
The usedLinearTerm.Comparator
.protected int
The right-hand-side of theLinearTerm
.Fields inherited from class org.jreliability.booleanfunction.AbstractHierarchicalTerm
terms
-
Constructor Summary
ConstructorsConstructorDescriptionLinearTerm
(List<Integer> coefficients, List<Term> terms, LinearTerm.Comparator comparator, int rhs) Constructs aLinearTerm
with a given list of coefficients, the embeddedTerm
s, theLinearTerm.Comparator
, and the right-hand-side.LinearTerm
(LinearTerm.Comparator comparator, int rhs) Constructs aLinearTerm
with a givenLinearTerm.Comparator
, and the right-hand-side. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds aTerm
and its coefficient.void
Returns the coefficients of theTerm
s.Returns theLinearTerm.Comparator
of theLinearTerm
.int
getRHS()
Returns the right-hand-side.toString()
Methods inherited from class org.jreliability.booleanfunction.AbstractHierarchicalTerm
add, getTerms, size
-
Field Details
-
coefficients
The coefficients of the embedded terms. -
comparator
The usedLinearTerm.Comparator
. -
rhs
protected int rhsThe right-hand-side of theLinearTerm
.
-
-
Constructor Details
-
LinearTerm
Constructs aLinearTerm
with a givenLinearTerm.Comparator
, and the right-hand-side.- Parameters:
comparator
- the used comparatorrhs
- the right-hand-side
-
LinearTerm
public LinearTerm(List<Integer> coefficients, List<Term> terms, LinearTerm.Comparator comparator, int rhs) Constructs aLinearTerm
with a given list of coefficients, the embeddedTerm
s, theLinearTerm.Comparator
, and the right-hand-side.- Parameters:
coefficients
- the coefficients of the termsterms
- the termscomparator
- the used comparatorrhs
- the right-hand-side
-
-
Method Details
-
getCoefficients
Returns the coefficients of theTerm
s.- Returns:
- the coefficients of the terms
-
getRHS
public int getRHS()Returns the right-hand-side.- Returns:
- the right-hand-side
-
add
Description copied from class:AbstractHierarchicalTerm
- Overrides:
add
in classAbstractHierarchicalTerm
- Parameters:
term
- the term to add
-
add
Adds aTerm
and its coefficient.- Parameters:
coefficient
- the coefficientterm
- the term
-
getComparator
Returns theLinearTerm.Comparator
of theLinearTerm
.- Returns:
- the comparator of the linear term
-
toString
-