Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6349553

Badly need operator overloading or at least dedicated vector/matrix operators

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 6
    • specification
    • x86
    • linux

      A DESCRIPTION OF THE REQUEST :
      I do alot of number crunching in java but writing even the simplest vector equations is torturous. Java badly needs either operator overloading as done in the 3D vector classes available for C++ or dedicated operators for matrices and vectors (there's still plenty of unused symbols on my keyboard!) I know game developers would kill for this. Right now my only options are C++ which is painful or fortran which is nauseating.
      We also need an exponentiation operator.
      Art.

      JUSTIFICATION :
      Anything that uses vector math and linear algebra is much much easier with operators rather than nested nested nested functions. Nested functions are hell to troubleshoot.
      You'd attract more engineering software developers and, more importantly, alot more game developers.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      double[] w = { ... }
      double[] x = { ... }
      double[] y = { ... }
      double[] z = { ... }
      double[][] A = { ... }
      double[][] B = { ... }
      double[][] C = { ... }
      double[][] D = { ... }
      double g = ...
      double h = ...
      y = A * y -g^3*(B*D+C') *z - w
      ACTUAL -
      y = vectorSubtract(vectorAdd(vectorMatrixMultiply(A,y), scalarVectorMultiply(Math.pow(g,3), vectorMultiply(matrixAdd(matrixMultiply(B,D),matrixTranspose(C))),z)),scalarVectorMultiply(h,w))

      ---------- BEGIN SOURCE ----------
      This is a request for a feature. Not a bug report.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Nesting functions as detailed above.

            abuckley Alex Buckley
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: