You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2009/08/19 13:28:14 UTC
[jira] Updated: (MAHOUT-164) "Potpourri": a collection of small
possible bugs and improvements
[ https://issues.apache.org/jira/browse/MAHOUT-164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sean Owen updated MAHOUT-164:
-----------------------------
Attachment: MAHOUT-164.patch
> "Potpourri": a collection of small possible bugs and improvements
> -----------------------------------------------------------------
>
> Key: MAHOUT-164
> URL: https://issues.apache.org/jira/browse/MAHOUT-164
> Project: Mahout
> Issue Type: Improvement
> Affects Versions: 0.2
> Reporter: Sean Owen
> Assignee: Sean Owen
> Priority: Minor
> Fix For: 0.2
>
> Attachments: MAHOUT-164.patch
>
>
> I call this issue "Potpourri". It's a number of small items batched together that didn't seem worth an issue on their own.
> 1. DenseVector.NonZeroIterator
> This doesn't seem to work, exactly, as per the Iterator contract. next() doesn't advance the iterator; hasNext() does. A normal series of calls to these might get the right effect, but this seems wrong. See proposed fix.
> 2. next() and NoSuchElementException
> Iterators need to throw this appropriately -- see changes
> 3. DistanceMeasure.distance(double[] p1, double[] p2)
> Looks like subclasses are kinda trying to treat this as a method to be overridden/implemented. I changed to make it so. Am I mistaken and this is on the way out or something? in which case, removable?
> 4. Subtraction in compareTo()
> Check out IntPairWritable. It does the sensible thing and tries to return the difference of two ints to satisfy the compareTo() contract. This works until the subtraction overflows.
> 5. Comparators and Serializable
> Super tiny point. Comparators ought to implement Serializable
> 6. Double literals
> Another super tiny point: suggest we write double literals in canonical form. "1" is an int; "1.0" is a double (though the former will be widened -- might as well write what's meant. Likewise "1.0f" is a float but "1.0" is not. Also suggest that "1.0E-5" is better than "1E-5" for doubles.
> 7. compareTo() and equals()
> equals() needs to be overridden when compareTo() is. and hashCode() needs to be there when equals() is. Looking at LDAPrintTopics.StringDoublePair
> 8. Redundant braces
> Finally like I mentioned, we should't do...
> for (...) {
> {
> ...
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.