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

Vector.maxValue() returns Double.MIN_VALUE for vectors with all negative entries.

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.1, 0.2
    • 0.3
    • classic
    • None

    Description

        @Override
        public double maxValue() {
          double result = Double.MIN_VALUE;
          for (int i = 0; i < size(); i++) {
            result = Math.max(result, getQuick(i));
          }
          return result;
        }
      

      Should be:

        @Override
        public double maxValue() {
          double result = 0;
          for (int i = 0; i < size(); i++) {
            result = Math.max(result, Math.abs(getQuick(i)));
          }
          return result;
        }
      

      Right? MaxValue should be returning the max of the absolute value, not the real max, right? And the maxValue of the zero vector is 0, not MIN_VALUE, yes?

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jake.mannix Jake Mannix
            jake.mannix Jake Mannix
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment