Interface FastCompositeExpression

All Superinterfaces:
Savable, Serializable

public interface FastCompositeExpression extends Savable
Author:
GBEMIRO Compiled expression that returns any type of EvalResult (scalar, matrix, vector, etc.). Performance characteristics: - Scalar expressions: 5-10 ns - Small matrices: 50-200 ns - Large matrices: linear to problem size (excellent cache locality)
  • Method Details

    • getRoot

      default MathExpression getRoot()
    • apply

      MathExpression.EvalResult apply(double[] variables)
      Evaluate expression with given variable values. Returns EvalResult to support all types (scalar, matrix, vector, etc.).
      Parameters:
      variables - array of variable values indexed by registry slots
      Returns:
      EvalResult of any type (scalar, matrix, vector, string, error)
    • applyScalar

      double applyScalar(double[] variables)
      Convenience method for scalar extraction. Throws ClassCastException if result is not scalar.
      Parameters:
      variables - execution frame variables
      Returns:
      scalar value
    • applyMatrix

      default Matrix applyMatrix(double[] variables)
      Convenience method for matrix extraction. Throws ClassCastException if result is not a matrix.
      Parameters:
      variables - execution frame variables
      Returns:
      Matrix result
    • applyVector

      default double[] applyVector(double[] variables)
      Convenience method for vector extraction. Throws ClassCastException if result is not a vector.
      Parameters:
      variables - execution frame variables
      Returns:
      double[] vector
    • checkErrorLogs

      String checkErrorLogs()
    • getCompiler

      default TurboExpressionEvaluator getCompiler()
    • applyString

      default String applyString(double[] variables)
      Convenience method for string extraction. Throws ClassCastException if result is not a string.
      Parameters:
      variables - execution frame variables
      Returns:
      String result