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

Vector.getDistanceSquared() is incorrect for both SparseVector varieties

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.2
    • 0.3
    • None
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: