Class MatrixTurbo

java.lang.Object
com.github.gbenroscience.parser.turbo.examples.MatrixTurbo

public class MatrixTurbo extends Object
Guide and examples for using Turbo Mode with matrices. IMPORTANT: Matrix turbo compilation is PARTIAL: - Matrix operations are delegated to interpreter - Scalar expressions within matrix expressions ARE compiled - Overall speedup: ~5-10x faster than pure interpreter Current limitations: - det(), inverse(), transpose() → interpreted - matrix_mul(), matrix_add(), matrix_sub() → interpreted - BUT: expressions like "det(M) + 5*2" → scalar part compiled Future: FlatMatrixTurboCompiler will compile matrix ops directly.
Author:
GBEMIRO
  • Constructor Details

    • MatrixTurbo

      public MatrixTurbo()
  • Method Details

    • example1_BasicMatrixOps

      public static void example1_BasicMatrixOps() throws Throwable
      EXAMPLE 1: Simple Matrix Operations Define matrices and perform basic operations. Operations are delegated to interpreter.
      Throws:
      Throwable
    • example2_MixedOperations

      public static void example2_MixedOperations() throws Throwable
      EXAMPLE 2: Mixed Scalar and Matrix Operations The scalar part of a mixed expression CAN be compiled. Use turbo for the surrounding scalar operations.
      Throws:
      Throwable
    • example3_LinearSystem

      public static void example3_LinearSystem() throws Throwable
      EXAMPLE 3: Matrix Linear System Solver Solve Ax = b using linear_sys(). The solver is optimized internally but not turbo-compiled.
      Throws:
      Throwable
    • example4_MatrixMultiplication

      public static void example4_MatrixMultiplication() throws Throwable
      EXAMPLE 4: Matrix Multiplication Chain Multiply matrices step by step. Each multiplication is interpreted.
      Throws:
      Throwable
    • example5_TurboWithMatrixResults

      public static void example5_TurboWithMatrixResults() throws Throwable
      EXAMPLE 5: Matrix with Turbo Scalar Operations RECOMMENDED: Pre-compute matrix operation, then use result in turbo-compiled scalar expression.
      Throws:
      Throwable
    • example6_Eigensystem

      public static void example6_Eigensystem() throws Throwable
      EXAMPLE 6: Eigenvalue/Eigenvector Analysis Compute eigenvalues and eigenvectors. These are high-level operations (interpreted).
      Throws:
      Throwable
    • example7_Performance

      public static void example7_Performance() throws Throwable
      EXAMPLE 7: Performance Comparison Compare interpreted vs partially turbo-compiled matrix expressions.
      Throws:
      Throwable
    • example8_RecommendedWorkflow

      public static void example8_RecommendedWorkflow() throws Throwable
      EXAMPLE 8: Recommended Workflow Best practices for combining matrices and turbo compilation.
      Throws:
      Throwable
    • example9_Limitations

      public static void example9_Limitations() throws Throwable
      LIMITATIONS OF MATRIX TURBO MODE
      Throws:
      Throwable
    • main

      public static void main(String[] args) throws Throwable
      Throws:
      Throwable