Package org.tweetyproject.math.term
Class AbsoluteValue
java.lang.Object
org.tweetyproject.math.term.Term
org.tweetyproject.math.term.FunctionalTerm
org.tweetyproject.math.term.AbsoluteValue
This class models the absolute value of the inner term.
- Author:
- Matthias Thimm
-
Constructor Summary
ConstructorsConstructorDescriptionAbsoluteValue(Term term) Creates a new absolute value term with the given inner term. -
Method Summary
Modifier and TypeMethodDescriptionDifferentiates the term with respect to the given variable.Returns all absolute values of this term.getTerms()booleanChecks whether this term is continuous in v.replaceTerm(Term toSubstitute, Term substitution) Replaces each occurrence of "toSubstitute" by "substitution" and return the new term.simplify()Simplifies this term in an equivalent way:
- Replaces products that contain a zero by the constant zero
- Removes a term one from products
- Removes a term zero from sums
- Aggregates constants in sums, products, and minimums
- Evaluates functional terms on constants
- Simplifies fractions where possible.toString()value()Computes the actual value of this term if it contains no variables.Methods inherited from class org.tweetyproject.math.term.FunctionalTerm
collapseAssociativeOperations, expandAssociativeOperations, getMaximums, getMinimums, getProducts, getSums, getTerm, getVariables, isInteger, isLinear, toLinearForm, toQuadraticFormMethods inherited from class org.tweetyproject.math.term.Term
add, doubleValue, evaluateMatrix, evaluateVector, evaluateVector, isContinuous, isQuadratic, min, minus, mult, replaceAllTerms, replaceAllTerms
-
Constructor Details
-
AbsoluteValue
Creates a new absolute value term with the given inner term.- Parameters:
term- a term
-
-
Method Details
-
getAbsoluteValues
Description copied from class:TermReturns all absolute values of this term.- Overrides:
getAbsoluteValuesin classFunctionalTerm- Returns:
- all absolute values of this term.
-
replaceTerm
Description copied from class:TermReplaces each occurrence of "toSubstitute" by "substitution" and return the new term.- Specified by:
replaceTermin classFunctionalTerm- Parameters:
toSubstitute- the term to be substitutedsubstitution- the new term- Returns:
- this term where "toSubstitute" is replaced by "substitution"
-
derive
Description copied from class:TermDifferentiates the term with respect to the given variable.- Specified by:
derivein classTerm- Parameters:
v- a variable.- Returns:
- the derivation of this term wrt. the given variable.
- Throws:
NonDifferentiableException- if the term cannot be differentiated.
-
simplify
Description copied from class:TermSimplifies this term in an equivalent way:
- Replaces products that contain a zero by the constant zero
- Removes a term one from products
- Removes a term zero from sums
- Aggregates constants in sums, products, and minimums
- Evaluates functional terms on constants
- Simplifies fractions where possible. -
toString
- Specified by:
toStringin classFunctionalTerm
-
isContinuous
Description copied from class:TermChecks whether this term is continuous in v.- Specified by:
isContinuousin classTerm- Parameters:
v- a variable- Returns:
- "true" iff this term is continuous in v.
-
value
Description copied from class:TermComputes the actual value of this term if it contains no variables.- Specified by:
valuein classFunctionalTerm- Returns:
- the value of this term, either a float or an integer.
- Throws:
IllegalArgumentException- if this term contains at least on variable.
-
getTerms
-