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 83F8D172E1 for ; Sun, 5 Oct 2014 18:43:34 +0000 (UTC) Received: (qmail 45955 invoked by uid 500); 5 Oct 2014 18:43:34 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 45874 invoked by uid 500); 5 Oct 2014 18:43:34 -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 45862 invoked by uid 99); 5 Oct 2014 18:43:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Oct 2014 18:43:34 +0000 Date: Sun, 5 Oct 2014 18:43:34 +0000 (UTC) From: "Phil Steitz (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (MATH-1130) A new set of functions for copyof, remove and replace a given value on a slice of array 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-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Phil Steitz closed MATH-1130. ----------------------------- Resolution: Not a Problem Per discussion on this ticket and the mailing list, there is no immediate need for these methods. > A new set of functions for copyof, remove and replace a given value on a slice of array > --------------------------------------------------------------------------------------- > > Key: MATH-1130 > URL: https://issues.apache.org/jira/browse/MATH-1130 > Project: Commons Math > Issue Type: New Feature > Affects Versions: 3.4 > Reporter: Venkatesha Murthy TS > Attachments: equalsIncludingNaN.dat, math-1130-checknotnan.patch, math-1130-precision-equals.patch, math-1130-remove.patch, math-1130-replace.patch > > > These are utility functions mostly required as part of MathArrays. > MathArrays: > ============= > The requirement is as follows: > a) double[] copyOf(double[] values, int begin, int length) ; > Similar to most other functions that support slice defined by the array part from [begin, begin+length) ;its a requirement to copy a slice which is not available (the closest is copyOf(array, int len) which misses out the begin index) > b) double[] removeAll(double[] values, int begin, int length, double removable); > Need a function to remove a value from array slice defined by [begin,begin+length) and return the filtered version. > c) double[] replaceAll(double[] values, int begin, int length, double oldValue, double newValue); > Need a function to replace inplace an oldValue substituted with newValue in the array slice defined by [begin,begin+length) and return the original complete array with just replaced values only in the segment [begin,begin+length) > MathUtils > ========= > boolean canEqual(double d1, double d2) ; > provide a canEqual function that is slightly better than exisitng MathUtils.equals. We could also improve existing equals method however. > So the change here is that the new enhanced canEqual can do a quick check on Nans and then move to a detailed Double.compare(..) method. This avoids the Double.compare call when any one of them is NaN. -- This message was sent by Atlassian JIRA (v6.3.4#6332)