Package org.tweetyproject.math.term
Class Power
java.lang.Object
org.tweetyproject.math.term.Term
org.tweetyproject.math.term.FunctionalTerm
org.tweetyproject.math.term.Power
This class represents a term raised to some power.
- Author:
- Matthias Thimm
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDifferentiates the term with respect to the given variable.getTerms()
Getter Termsboolean
Checks whether this term is continuous in v.boolean
isLinear()
Checks whether this term is linear.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.Return a quadratic formtoString()
value()
Computes the actual value of this term if it contains no variables.Methods inherited from class org.tweetyproject.math.term.FunctionalTerm
collapseAssociativeOperations, expandAssociativeOperations, getAbsoluteValues, getMaximums, getMinimums, getProducts, getSums, getTerm, getVariables, isInteger, toLinearForm
Methods inherited from class org.tweetyproject.math.term.Term
add, doubleValue, evaluateMatrix, evaluateVector, evaluateVector, isContinuous, isQuadratic, min, minus, mult, replaceAllTerms, replaceAllTerms
-
Constructor Details
-
Power
-
-
Method Details
-
replaceTerm
Description copied from class:Term
Replaces each occurrence of "toSubstitute" by "substitution" and return the new term.- Specified by:
replaceTerm
in classFunctionalTerm
- Parameters:
toSubstitute
- the term to be substitutedsubstitution
- the new term- Returns:
- this term where "toSubstitute" is replaced by "substitution"
-
toString
- Specified by:
toString
in classFunctionalTerm
-
value
Description copied from class:Term
Computes the actual value of this term if it contains no variables.- Specified by:
value
in classFunctionalTerm
- Returns:
- the value of this term, either a float or an integer.
- Throws:
IllegalArgumentException
- if this term contains at least on variable.
-
isContinuous
Description copied from class:Term
Checks whether this term is continuous in v.- Specified by:
isContinuous
in classTerm
- Parameters:
v
- a variable- Returns:
- "true" iff this term is continuous in v.
-
simplify
Description copied from class:Term
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. -
toQuadraticForm
Description copied from class:Term
Return a quadratic form- Overrides:
toQuadraticForm
in classFunctionalTerm
- Returns:
- a quadratic form
- Throws:
IllegalArgumentException
- error
-
derive
Description copied from class:Term
Differentiates the term with respect to the given variable.- Specified by:
derive
in classTerm
- Parameters:
v
- a variable.- Returns:
- the derivation of this term wrt. the given variable.
- Throws:
NonDifferentiableException
- if the term cannot be differentiated.
-
isLinear
public boolean isLinear()Description copied from class:Term
Checks whether this term is linear.- Overrides:
isLinear
in classFunctionalTerm
- Returns:
- "true" if this term is linear.
-
getTerms
-