Class MathExpression

java.lang.Object
mgui.interfaces.math.MathExpression

public class MathExpression
extends java.lang.Object
Class represents a mathematical expression, and methods to evaluate it. This is based upon the Jep Java - Math Expression Parser v 4.2.1, issued under the GNU Public License. JEP has since switched to a commercial license.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Constructor Summary

    Constructors
    Constructor Description
    MathExpression()  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.Object evaluate​(MathExpressionOptions options)
    Evaluates a mathematical expression, returning an array of doubles, if n < 3, otherwise returns a set of embedded ArrayList<Double>s.
    static java.lang.Object evaluate​(MathExpressionOptions options, ProgressUpdater updater)
    Evaluates a mathematical expression, returning an array of doubles, if n < 3, otherwise returns a set of embedded ArrayList<Double>s.
    static java.lang.Object evaluate​(org.cheffo.jeplite.JEP jep, VariableObject variable)  
    static java.lang.Object evaluate_conditional​(MathExpressionOptions options)
    Evaluates a conditional expression, returning an array of booleans.
    static java.lang.Object evaluate_conditional​(MathExpressionOptions options, ProgressUpdater updater)
    Evaluates a conditional expression, returning an array of booleans.
    static boolean[] evaluate1b​(org.cheffo.jeplite.JEP jep, VariableObject variable, int n)  
    static boolean[] evaluate1b​(org.cheffo.jeplite.JEP jep, VariableObject variable, int n, java.util.ArrayList<java.lang.String> used_variables, ProgressUpdater updater)  
    static double[] evaluate1d​(org.cheffo.jeplite.JEP jep, VariableObject variable, int n)  
    static double[] evaluate1d​(org.cheffo.jeplite.JEP jep, VariableObject variable, int n, java.util.ArrayList<java.lang.String> used_variables, ProgressUpdater updater)  
    static boolean[][] evaluate2b​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n)  
    static boolean[][] evaluate2b​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n, java.util.ArrayList<java.lang.String> used_variables, ProgressUpdater updater)  
    static double[][] evaluate2d​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n)  
    static double[][] evaluate2d​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n, java.util.ArrayList<java.lang.String> used_variables, ProgressUpdater updater)  
    static boolean[][][] evaluate3b​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n, int o)  
    static boolean[][][] evaluate3b​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n, int o, java.util.ArrayList<java.lang.String> used_variables, ProgressUpdater updater)  
    static double[][][] evaluate3d​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n, int o)  
    static double[][][] evaluate3d​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n, int o, java.util.ArrayList<java.lang.String> used_variables, ProgressUpdater updater)  
    static java.lang.Object evaluateNd​(org.cheffo.jeplite.JEP jep, VariableObject variable, int[] dims)  
    static java.lang.Object evaluateNd​(org.cheffo.jeplite.JEP jep, VariableObject variable, int[] dims, java.util.ArrayList<java.lang.String> used_variables)
    Evaluates an N-dimensional variable.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MathExpression

      public MathExpression()
  • Method Details

    • evaluate

      public static java.lang.Object evaluate​(MathExpressionOptions options)
      Evaluates a mathematical expression, returning an array of doubles, if n < 3, otherwise returns a set of embedded ArrayList<Double>s.
      Parameters:
      options -
      Returns:
    • evaluate

      public static java.lang.Object evaluate​(MathExpressionOptions options, ProgressUpdater updater)
      Evaluates a mathematical expression, returning an array of doubles, if n < 3, otherwise returns a set of embedded ArrayList<Double>s.
      Parameters:
      options -
      Returns:
    • evaluate_conditional

      public static java.lang.Object evaluate_conditional​(MathExpressionOptions options)
      Evaluates a conditional expression, returning an array of booleans.
      Parameters:
      options -
      Returns:
    • evaluate_conditional

      public static java.lang.Object evaluate_conditional​(MathExpressionOptions options, ProgressUpdater updater)
      Evaluates a conditional expression, returning an array of booleans.
      Parameters:
      options -
      Returns:
    • evaluate

      public static java.lang.Object evaluate​(org.cheffo.jeplite.JEP jep, VariableObject variable)
    • evaluate1d

      public static double[] evaluate1d​(org.cheffo.jeplite.JEP jep, VariableObject variable, int n)
    • evaluate1d

      public static double[] evaluate1d​(org.cheffo.jeplite.JEP jep, VariableObject variable, int n, java.util.ArrayList<java.lang.String> used_variables, ProgressUpdater updater)
    • evaluate2d

      public static double[][] evaluate2d​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n)
    • evaluate2d

      public static double[][] evaluate2d​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n, java.util.ArrayList<java.lang.String> used_variables, ProgressUpdater updater)
    • evaluate3d

      public static double[][][] evaluate3d​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n, int o)
    • evaluate3d

      public static double[][][] evaluate3d​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n, int o, java.util.ArrayList<java.lang.String> used_variables, ProgressUpdater updater)
    • evaluateNd

      public static java.lang.Object evaluateNd​(org.cheffo.jeplite.JEP jep, VariableObject variable, int[] dims)
    • evaluateNd

      public static java.lang.Object evaluateNd​(org.cheffo.jeplite.JEP jep, VariableObject variable, int[] dims, java.util.ArrayList<java.lang.String> used_variables)
      Evaluates an N-dimensional variable. Returns a set of embedded ArrayList<Double>s.
      Parameters:
      jep -
      variable -
      dims -
      Returns:
    • evaluate1b

      public static boolean[] evaluate1b​(org.cheffo.jeplite.JEP jep, VariableObject variable, int n)
    • evaluate1b

      public static boolean[] evaluate1b​(org.cheffo.jeplite.JEP jep, VariableObject variable, int n, java.util.ArrayList<java.lang.String> used_variables, ProgressUpdater updater)
    • evaluate2b

      public static boolean[][] evaluate2b​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n)
    • evaluate2b

      public static boolean[][] evaluate2b​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n, java.util.ArrayList<java.lang.String> used_variables, ProgressUpdater updater)
    • evaluate3b

      public static boolean[][][] evaluate3b​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n, int o)
    • evaluate3b

      public static boolean[][][] evaluate3b​(org.cheffo.jeplite.JEP jep, VariableObject variable, int m, int n, int o, java.util.ArrayList<java.lang.String> used_variables, ProgressUpdater updater)