Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-209

RealMatrixImpl#operate gets result vector dimensions wrong

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2
    • None
    • None
    • None

    Description

      org.apache.commons.math.linear.RealMatrixImpl#operate tries to create a result vector that always has the same length as the input vector. This can result in runtime exceptions if the matrix is non-square and it always yields incorrect results if the matrix is non-square. The correct behaviour would of course be to create a vector with the same length as the row dimension of the matrix.

      Thus line 640 in RealMatrixImpl.java should read
      double[] out = new double[nRows];
      instead of
      double[] out = new double[v.length];

      Attachments

        Activity

          People

            Unassigned Unassigned
            murphy Thomas Chust
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2m
                2m
                Remaining:
                Remaining Estimate - 2m
                2m
                Logged:
                Time Spent - Not Specified
                Not Specified