Package org.tweetyproject.math.term
Class Root
- java.lang.Object
-
- org.tweetyproject.math.term.Term
-
- org.tweetyproject.math.term.FunctionalTerm
-
- org.tweetyproject.math.term.Root
-
public class Root extends FunctionalTerm
This class represents a the nth root function- Author:
- Matthias Thimm
-
-
Method Summary
Modifier and Type Method Description Termderive(Variable v)Differentiates the term with respect to the given variable.java.util.List<Term>getTerms()booleanisContinuous(Variable v)Checks whether this term is continuous in v.TermreplaceTerm(Term toSubstitute, Term substitution)Replaces each occurrence of "toSubstitute" by "substitution" and return the new term.Termsimplify()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.java.lang.StringtoString()Constantvalue()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, isLinear, toLinearForm, toQuadraticForm
-
Methods inherited from class org.tweetyproject.math.term.Term
add, doubleValue, evaluateMatrix, evaluateVector, evaluateVector, isContinuous, isQuadratic, min, minus, mult, replaceAllTerms, replaceAllTerms
-
-
-
-
Method Detail
-
replaceTerm
public Term replaceTerm(Term toSubstitute, Term substitution)
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"
-
toString
public java.lang.String toString()
- Specified by:
toStringin classFunctionalTerm
-
value
public Constant value() throws java.lang.IllegalArgumentException
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:
java.lang.IllegalArgumentException- if this term contains at least on variable.
-
isContinuous
public boolean isContinuous(Variable v)
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.
-
simplify
public Term 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.
-
derive
public Term derive(Variable v) throws NonDifferentiableException
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.
-
-