Return-Path: X-Original-To: apmail-hama-dev-archive@www.apache.org Delivered-To: apmail-hama-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2F52010672 for ; Fri, 21 Jun 2013 22:06:22 +0000 (UTC) Received: (qmail 48450 invoked by uid 500); 21 Jun 2013 22:06:21 -0000 Delivered-To: apmail-hama-dev-archive@hama.apache.org Received: (qmail 48427 invoked by uid 500); 21 Jun 2013 22:06:21 -0000 Mailing-List: contact dev-help@hama.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hama.apache.org Delivered-To: mailing list dev@hama.apache.org Received: (qmail 48383 invoked by uid 99); 21 Jun 2013 22:06:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jun 2013 22:06:21 +0000 Date: Fri, 21 Jun 2013 22:06:21 +0000 (UTC) From: "Yexi Jiang (JIRA)" To: dev@hama.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HAMA-765) Add apply method to Vector/Matrix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HAMA-765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13690790#comment-13690790 ] Yexi Jiang commented on HAMA-765: --------------------------------- Hi, Edward, I didn't notice your last comment. Please rollback the commit first. Sorry for the inconvenience. > Add apply method to Vector/Matrix > --------------------------------- > > Key: HAMA-765 > URL: https://issues.apache.org/jira/browse/HAMA-765 > Project: Hama > Issue Type: Improvement > Affects Versions: 0.6.2 > Reporter: Yexi Jiang > Assignee: Yexi Jiang > Priority: Minor > Fix For: 0.6.3 > > Attachments: HAMA-765.patch, HAMA-765.patch, HAMA-765.patch, HAMA-765.patch > > > Add 'apply' method to Vector/Matrix to allow ad-hoc function apply to the elements of a Vector/Matrix. > For example, if a function f( x ) needs to apply to the elements of a vector v, then we can use > ------------ > DoubleFunction fun = new DoubleFunction() { > public double apply(double element) { > // do what ever > } > }; > v.apply(fun); > ------------ > This method borrows the style of functional programming by allowing a function to apply to all the elements of a Vector/Matrix. It can simply the coding, especially for those algorithms where Vector/Matrix operations are heavily used. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira