hivemall-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myui <...@git.apache.org>
Subject [GitHub] incubator-hivemall pull request #111: [WIP][HIVEMALL-17] Support SLIM
Date Wed, 30 Aug 2017 15:01:15 GMT
Github user myui commented on a diff in the pull request:

    https://github.com/apache/incubator-hivemall/pull/111#discussion_r136094514
  
    --- Diff: core/src/main/java/hivemall/math/matrix/sparse/DoKMatrix.java ---
    @@ -309,6 +309,20 @@ public void eachNonZeroInColumn(@Nonnegative final int col,
             }
         }
     
    +    public void eachNonZeroCell(@Nonnull final VectorProcedure procedure) {
    +        if (nnz == 0) {
    +            return;
    +        }
    +        final IMapIterator itor = elements.entries();
    +        while (itor.next() != -1) {
    +            long k = itor.getKey();
    +            int row = Primitives.getHigh(k);
    +            int col = Primitives.getLow(k);
    +            double value = itor.getValue();
    +            procedure.apply(row, col, value);
    --- End diff --
    
    `VectorProcedure#apply(@Nonnegative int row, @Nonnegative int col, double value)` should
also be introduced.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message