Documentation of 'org.matheclipse.core.eval.EvalUtilities' Java class
EvalUtilities
org.matheclipse.core.eval

Class EvalUtilities

    • Constructor Summary

      Constructors 
      Constructor and Description
      EvalUtilities()
      Constructor for an object which evaluates an expression.
      EvalUtilities(boolean mathMTagPrefix, boolean relaxedSyntax)
      Constructor for an object which evaluates an expression.
      EvalUtilities(EvalEngine evalEngine, boolean mathMTagPrefix, boolean relaxedSyntax)
      Constructor for an object which evaluates an expression.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static IExpr eval(java.lang.String inputExpression, EvalEngine evalEngine)
      Evaluate the inputExpression and return the resulting expression.
      IAST evalTrace(IExpr parsedExpression, Predicate<IExpr> matcher, IAST list)
      Evaluate the parsedExpression and return the Trace[parsedExpression] (i.e.
      IAST evalTrace(java.lang.String inputExpression, Predicate<IExpr> matcher, IAST list)
      Evaluate the inputExpression and return the Trace[inputExpression] (i.e.
      IExpr evaluate(IExpr parsedExpression)
      Evaluate the parsedExpression and return the resulting expression.
      IExpr evaluate(java.lang.String inputExpression)
      Evaluate the inputExpression and return the resulting expression.
      java.lang.String toJavaForm(java.lang.String inputExpression)
      Converts the inputExpression string into a MathML expression and writes the result to the given Writer
      void toMathML(java.lang.String inputExpression, java.io.Writer out)
      Converts the inputExpression string into a MathML expression and writes the result to the given Writer
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EvalUtilities

        public EvalUtilities()
        Constructor for an object which evaluates an expression. By default the internal EvalEngine didn't create a history list for the Out[] function.
        Parameters:
        evalEngine -
        mathMTagPrefix - if set to true use "m:" as tag prefix for the MathML output.
        relaxedSyntax -
      • EvalUtilities

        public EvalUtilities(boolean mathMTagPrefix,
                             boolean relaxedSyntax)
        Constructor for an object which evaluates an expression.
        Parameters:
        mathMTagPrefix - if set to true use "m:" as tag prefix for the MathML output.
        relaxedSyntax - if set to true use "(...)" instead of "[...]" for function arguments (i.e. sin(...) instead of sin[...]).
      • EvalUtilities

        public EvalUtilities(EvalEngine evalEngine,
                             boolean mathMTagPrefix,
                             boolean relaxedSyntax)
        Constructor for an object which evaluates an expression.
        Parameters:
        evalEngine -
        mathMTagPrefix - if set to true use "m:" as tag prefix for the MathML output.
        relaxedSyntax - if set to true use "(...)" instead of "[...]" for function arguments (i.e. sin(...) instead of sin[...]).
    • Method Detail

      • evaluate

        public IExpr evaluate(java.lang.String inputExpression)
                       throws MathException
        Evaluate the inputExpression and return the resulting expression.
        Parameters:
        inputExpression - the expression which should be evaluated.
        Returns:
        null, if the inputExpression is null
        Throws:
        MathException
      • eval

        public static IExpr eval(java.lang.String inputExpression,
                                 EvalEngine evalEngine)
                          throws MathException
        Evaluate the inputExpression and return the resulting expression.
        The parser first tries (independently from the settings in the evalEngine) to parse the expression in the "relaxed mode" (i.e. "common math expression syntax" with parentheses for function arguments) and if that results in a SyntaxError exception it tries to parse in the "stronger mode" (i.e. with square brackets for function arguments).
        Note that after the second parser step this method may also throw a SyntaxError exception.
        Parameters:
        inputExpression - the expression which should be evaluated.
        evalEngine - the evaluation engine which should be used
        Returns:
        null, if the inputExpression is null
        Throws:
        MathException
      • evaluate

        public IExpr evaluate(IExpr parsedExpression)
                       throws MathException
        Evaluate the parsedExpression and return the resulting expression.
        Parameters:
        parsedExpression - the expression which should be evaluated.
        Returns:
        Throws:
        MathException
      • toJavaForm

        public java.lang.String toJavaForm(java.lang.String inputExpression)
                                    throws MathException
        Converts the inputExpression string into a MathML expression and writes the result to the given Writer
        Parameters:
        inputExpression -
        out -
        Throws:
        MathException
      • evalTrace

        public IAST evalTrace(java.lang.String inputExpression,
                              Predicate<IExpr> matcher,
                              IAST list)
                       throws MathException
        Evaluate the inputExpression and return the Trace[inputExpression] (i.e. all (sub-)expressions needed to calculate the result).
        Parameters:
        inputExpression - the expression which should be evaluated.
        matcher - a filter which determines the expressions which should be traced, If the matcher is set to null, all expressions are traced.
        list - an IAST object which will be cloned for containing the traced expressions. Typically a F.List() will be used.
        Returns:
        Throws:
        MathException
      • evalTrace

        public IAST evalTrace(IExpr parsedExpression,
                              Predicate<IExpr> matcher,
                              IAST list)
                       throws java.lang.RuntimeException
        Evaluate the parsedExpression and return the Trace[parsedExpression] (i.e. all (sub-)expressions needed to calculate the result).
        Parameters:
        parsedExpression - the expression which should be evaluated.
        matcher - a filter which determines the expressions which should be traced, If the matcher is set to null, all expressions are traced.
        list - an IAST object which will be cloned for containing the traced expressions. Typically a F.List() will be used.
        Returns:
        Throws:
        java.lang.RuntimeException
      • toMathML

        public void toMathML(java.lang.String inputExpression,
                             java.io.Writer out)
        Converts the inputExpression string into a MathML expression and writes the result to the given Writer
        Overrides:
        toMathML in class MathMLUtilities

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.