mahout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Isabel Drost (JIRA)" <j...@apache.org>
Subject [jira] Commented: (MAHOUT-67) plus method in AbstractVector doesn't work for SparseVectors
Date Tue, 08 Jul 2008 18:24:31 GMT

    [ https://issues.apache.org/jira/browse/MAHOUT-67?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611731#action_12611731
] 

Isabel Drost commented on MAHOUT-67:
------------------------------------


Instead of using the following explicitly, you might consider using Java5 style notation,
as vector implements Iterable:


> java.util.Iterator<Vector.Element> iterator = x.iterator();
>    while (iterator.hasNext()) {
>      Vector.Element element = iterator.next();

I haven't tried it, but it should be possible to use the following expression:

for (Vector.Element element : x) {
  ...
}

I always find this style easier to read than the explicit use of iterator()

Isabel

> plus method in AbstractVector doesn't work for SparseVectors
> ------------------------------------------------------------
>
>                 Key: MAHOUT-67
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-67
>             Project: Mahout
>          Issue Type: Bug
>          Components: Matrix
>            Reporter: Pallavi Palleti
>            Priority: Minor
>         Attachments: MAHOUT-67.patch
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message