Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 69D1818DA7 for ; Thu, 20 Aug 2015 19:59:46 +0000 (UTC) Received: (qmail 23715 invoked by uid 500); 20 Aug 2015 19:59:46 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 23622 invoked by uid 500); 20 Aug 2015 19:59:46 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 23606 invoked by uid 99); 20 Aug 2015 19:59:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Aug 2015 19:59:46 +0000 Date: Thu, 20 Aug 2015 19:59:46 +0000 (UTC) From: "Gilles (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MATH-1258) compute() method in classes in org.apache.commons.math4.ml.distance package 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/MATH-1258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14705663#comment-14705663 ] Gilles commented on MATH-1258: ------------------------------ I've just added you in the "committers" list (in JIRA). Could you try again to resolve the issue? > compute() method in classes in org.apache.commons.math4.ml.distance package > --------------------------------------------------------------------------- > > Key: MATH-1258 > URL: https://issues.apache.org/jira/browse/MATH-1258 > Project: Commons Math > Issue Type: Bug > Reporter: Gunel Jahangirova > Priority: Minor > Attachments: patch.diff, pre-MATH-1258.patch > > > Hi! > There are five classes CanberraDistance, ChebyshevDistance, EarthMoversDistance, EuclideanDistance and ManhattanDistance in org.apache.commons.math4.ml.distance package, which compute different types of distances. Each of them contains method compute(double[] a, double[] b) that accepts two double arrays as variables. > However, if the lengths of array a is greater than the length of array b, the method compute() in all the five classes produces java.lang.ArrayIndexOutOfBoundsException. > For example, > private void test0() { > CanberraDistance distance = new CanberraDistance(); > > final double[] a = { 1, 2, 3, 4, 9, 4 }; > final double[] b = { -5, -6, 7, 4, 3 }; > distance.compute(a, b); > } -- This message was sent by Atlassian JIRA (v6.3.4#6332)