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 enumTheLinearTerm.Comparatordetermines the comparator in theLinearTerm, i.e. -
Field Summary
FieldsModifier and TypeFieldDescriptionThe coefficients of the embedded terms.protected final LinearTerm.ComparatorThe usedLinearTerm.Comparator.protected intThe 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 aLinearTermwith a given list of coefficients, the embeddedTerms, theLinearTerm.Comparator, and the right-hand-side.LinearTerm(LinearTerm.Comparator comparator, int rhs) Constructs aLinearTermwith a givenLinearTerm.Comparator, and the right-hand-side. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds aTermand its coefficient.voidReturns the coefficients of theTerms.Returns theLinearTerm.Comparatorof theLinearTerm.intgetRHS()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 aLinearTermwith 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 aLinearTermwith a given list of coefficients, the embeddedTerms, 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 theTerms.- 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:
addin classAbstractHierarchicalTerm- Parameters:
term- the term to add
-
add
Adds aTermand its coefficient.- Parameters:
coefficient- the coefficientterm- the term
-
getComparator
Returns theLinearTerm.Comparatorof theLinearTerm.- Returns:
- the comparator of the linear term
-
toString
-