Return-Path: Delivered-To: apmail-incubator-hama-dev-archive@locus.apache.org Received: (qmail 62901 invoked from network); 13 Oct 2008 07:29:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Oct 2008 07:29:06 -0000 Received: (qmail 86810 invoked by uid 500); 13 Oct 2008 07:29:07 -0000 Delivered-To: apmail-incubator-hama-dev-archive@incubator.apache.org Received: (qmail 86769 invoked by uid 500); 13 Oct 2008 07:29:07 -0000 Mailing-List: contact hama-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hama-dev@incubator.apache.org Delivered-To: mailing list hama-dev@incubator.apache.org Received: (qmail 86756 invoked by uid 99); 13 Oct 2008 07:29:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Oct 2008 00:29:07 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Oct 2008 07:28:09 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 548B9234C217 for ; Mon, 13 Oct 2008 00:28:46 -0700 (PDT) Message-ID: <495617986.1223882926331.JavaMail.jira@brutus> Date: Mon, 13 Oct 2008 00:28:46 -0700 (PDT) From: "Samuel Guo (JIRA)" To: hama-dev@incubator.apache.org Subject: [jira] Commented: (HAMA-80) Add identity(int m, int n) which returns an m-by-n matrix with ones on the diagonal and zeros elsewhere. In-Reply-To: <1828453417.1223879686595.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HAMA-80?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638959#action_12638959 ] Samuel Guo commented on HAMA-80: -------------------------------- Why we need m & n both? In linear algebra, the identity matrix or unit matrix of size n is the n-by-n square matrix with ones on the main diagonal and zeros elsewhere. And I don't think it's good to store an identity matrix as DenseMatrix. It may not efficient. Maybe we can create another class, sth like: class IdentityMatrix implements Matrix { .... public double get(int i, int j) throws IOException { return (i==j)?1:0; } .... } it is not neccessary to store the matrix in hbase. > Add identity(int m, int n) which returns an m-by-n matrix with ones on the diagonal and zeros elsewhere. > -------------------------------------------------------------------------------------------------------- > > Key: HAMA-80 > URL: https://issues.apache.org/jira/browse/HAMA-80 > Project: Hama > Issue Type: New Feature > Components: implementation > Reporter: Edward J. Yoon > Assignee: Edward J. Yoon > Priority: Minor > Fix For: 0.1.0 > > Attachments: HAMA-80.patch > > > double[][] X; > for (int i = 0; i < m; i++) { > for (int j = 0; j < n; j++) { > X[i][j] = (i == j ? 1.0 : 0.0); > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.