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 3E913CF9E for ; Thu, 18 Jul 2013 19:42:49 +0000 (UTC) Received: (qmail 95302 invoked by uid 500); 18 Jul 2013 19:42:48 -0000 Delivered-To: apmail-hama-dev-archive@hama.apache.org Received: (qmail 95267 invoked by uid 500); 18 Jul 2013 19:42:48 -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 95208 invoked by uid 99); 18 Jul 2013 19:42:48 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jul 2013 19:42:48 +0000 Date: Thu, 18 Jul 2013 19:42:48 +0000 (UTC) From: "Yexi Jiang (JIRA)" To: dev@hama.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HAMA-782) The arguments of DoubleVector.slice(int, int) method will mislead the user 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-782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yexi Jiang updated HAMA-782: ---------------------------- Attachment: HAMA-782.patch 1. Change the name of argument and comments to make it more clear. 2. Add pre-condition check. 3. Add test cases. > The arguments of DoubleVector.slice(int, int) method will mislead the user > -------------------------------------------------------------------------- > > Key: HAMA-782 > URL: https://issues.apache.org/jira/browse/HAMA-782 > Project: Hama > Issue Type: Improvement > Components: machine learning, math > Reporter: Yexi Jiang > Assignee: Yexi Jiang > Fix For: 0.6.3 > > Attachments: HAMA-782.patch > > > The current implementation of DoubleVector.slice(int, int) is ambiguous. > Current description of this method is as follows: > -------------------------------------------------------- > Slices this vector from index offset with the given length. So you end at the upper bound of (offset+length). > -------------------------------------------------------- > If the given vector is vec = [0, 1, 2, 3, 4, 5, 6], and user uses vec.slice(2, 3) and hope to get [2, 3, 4]. However, it actually returns [2,3]. > This is because the actual implementation extract the elements start from 'offset' and end at 'length' (exclusive). The argument name will mislead the user. -- 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