Uploaded image for project: 'Mahout'
  1. Mahout
  2. MAHOUT-268

Vector.getDistanceSquared() is incorrect for both SparseVector varieties

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.2
    • Fix Version/s: 0.3
    • Component/s: None
    • Labels:
      None
    • Environment:

      all

      Description

      I'm pretty sure that getDistanceSquared() should just return as if an optimized implementation of:

        public double getDistanceSquared(Vector v) { return this.minus(v).getLengthSquared(); }
      

      In which case if some vector elements are negative, both SequentialAccessSparseVector (my fault!) and RandomAccessSparseVector return the wrong thing. Very easy to write a failing unit test for this one.

        Attachments

          Activity

            People

            • Assignee:
              jake.mannix Jake Mannix
              Reporter:
              jakemannix jakes old (non-committer) account
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: