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

SparseRealVectorTest.testMap and testMapToSelf fail because zero entries lose their sign

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.3
    • Labels:

      Description

      Mapping Inverse to an OpenMapRealVector can lead to wrong answers, because 1.0 / 0.0 should return +/-Infinity depending on the sign of the zero entry. Since the sign is lost in OpenMapRealVector, the answer must be wrong if the entry is truly -0.0.

      This is a difficult bug, because it potentially affects any function passed to OpenMapRealVector.map() or mapToSelf(). I would recommend we relax the requirements in the unit tests of this class, and make people aware of the issue in the class documentation.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              celestin S├ębastien Brisard
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: