incubator-hama-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward J. Yoon (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HAMA-134) We don't need to fill C with zeros
Date Thu, 11 Dec 2008 09:51:44 GMT

     [ https://issues.apache.org/jira/browse/HAMA-134?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Edward J. Yoon updated HAMA-134:
--------------------------------

        Fix Version/s: 0.1.0
    Affects Version/s: 0.1.0
               Status: Patch Available  (was: Open)

Submit patch.

> We don't need to fill C with zeros
> ----------------------------------
>
>                 Key: HAMA-134
>                 URL: https://issues.apache.org/jira/browse/HAMA-134
>             Project: Hama
>          Issue Type: Sub-task
>    Affects Versions: 0.1.0
>            Reporter: Edward J. Yoon
>             Fix For: 0.1.0
>
>         Attachments: HAMA-134.patch
>
>
> Also, let's create/use/return the 'new SubMatrix' directly.
> ----
>  public SubMatrix mult(SubMatrix b) {
>    double[][] C = new double[this.getRows()][b.getColumns()];
>    for (int i = 0; i < this.getRows(); i++) {
>      Arrays.fill(C[i], 0);
>    }
>    for (int i = 0; i < this.getRows(); i++) {
>      for (int j = 0; j < b.getColumns(); j++) {
>        for (int k = 0; k < this.getColumns(); k++) {
>          C[i][j] += this.get(i, k) * b.get(k, j);
>        }
>      }
>    }
>    return new SubMatrix(C);

-- 
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