You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Jake Mannix (JIRA)" <ji...@apache.org> on 2010/01/27 23:10:34 UTC
[jira] Assigned: (MAHOUT-269) Vector.maxValue() returns
Double.MIN_VALUE for vectors with all negative entries.
[ https://issues.apache.org/jira/browse/MAHOUT-269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jake Mannix reassigned MAHOUT-269:
----------------------------------
Assignee: Jake Mannix
> Vector.maxValue() returns Double.MIN_VALUE for vectors with all negative entries.
> ---------------------------------------------------------------------------------
>
> Key: MAHOUT-269
> URL: https://issues.apache.org/jira/browse/MAHOUT-269
> Project: Mahout
> Issue Type: Bug
> Components: Math
> Affects Versions: 0.1, 0.2
> Reporter: Jake Mannix
> Assignee: Jake Mannix
> Priority: Minor
> Fix For: 0.3
>
>
> {code}
> @Override
> public double maxValue() {
> double result = Double.MIN_VALUE;
> for (int i = 0; i < size(); i++) {
> result = Math.max(result, getQuick(i));
> }
> return result;
> }
> {code}
> Should be:
> {code}
> @Override
> public double maxValue() {
> double result = 0;
> for (int i = 0; i < size(); i++) {
> result = Math.max(result, Math.abs(getQuick(i)));
> }
> return result;
> }
> {code}
> 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?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.