org.matheclipse.core.reflection.system
Class Eliminate
- java.lang.Object
-
- org.matheclipse.core.eval.interfaces.AbstractFunctionEvaluator
-
- org.matheclipse.core.reflection.system.Eliminate
-
- All Implemented Interfaces:
- IFunctionEvaluator, IEvaluator
public class Eliminate extends AbstractFunctionEvaluator
Try to eliminate a variable in a set of equations (i.e.Equal[...]expressions). See Wikipedia - System of linear equations - Elimination of variables.
-
-
Constructor Summary
Constructors Constructor and Description Eliminate()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description IASTeliminateOneVariable(java.util.ArrayList<org.matheclipse.core.reflection.system.Eliminate.VariableCounterVisitor> analyzerList, ISymbol variable)Analyze theEqual()terms, if we find an expression which equals the givenvariabeIExprevaluate(IAST ast)Symbolic evaluation of a function.static IExprextractVariable(IExpr exprWithVariable, IExpr exprWithoutVariable, Predicate<IExpr> predicate, ISymbol variable)Extract a value for the givenvariabe.-
Methods inherited from class org.matheclipse.core.eval.interfaces.AbstractFunctionEvaluator
createRuleFromMethod, getPeriodicParts, getPureImaginaryPart, getRuleAST, isNegativeExpression, numericEval, setUp
-
-
-
-
Method Detail
-
extractVariable
public static IExpr extractVariable(IExpr exprWithVariable, IExpr exprWithoutVariable, Predicate<IExpr> predicate, ISymbol variable)
Extract a value for the givenvariabe.- Parameters:
exprWithVariable- expression which contains the givenvariabe.exprWithoutVariable- expression which doesn't contain the givenvariabe.variable- the variable which should be eliminated.- Returns:
nullif we can't find an equation for the givenvariable.
-
eliminateOneVariable
public IAST eliminateOneVariable(java.util.ArrayList<org.matheclipse.core.reflection.system.Eliminate.VariableCounterVisitor> analyzerList, ISymbol variable)
Analyze theEqual()terms, if we find an expression which equals the givenvariabe- Parameters:
termsEqualZeroList- list ofEqual()termsvariable- the variable which should be eliminated.- Returns:
nullif we can't eliminate an equation from the list for the givenvariabe
-
evaluate
public IExpr evaluate(IAST ast)
Symbolic evaluation of a function.ast.get(0)contains the head (i.e. the function symbol) of this abstract syntax tree (AST).ast.get(1)toast.get(n)contains the first to n-th argument of the function.
If necessary use the methods from theValidateclass to check the number or types of arguments in the evaluate method.
Note: if the symbolic evaluation isn't possible or no result is found the evaluate method returns with anullvalue without throwing an exception!- Specified by:
evaluatein interfaceIFunctionEvaluator- Specified by:
evaluatein classAbstractFunctionEvaluator- Parameters:
ast- the abstract syntax tree (AST) which should be evaluated- Returns:
- the evaluated object or
null, if evaluation isn't possible - See Also:
Validate
-
-
DMelt 3.0 © DataMelt by jWork.ORG