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 1BC5018A7B for ; Wed, 29 Apr 2015 20:15:08 +0000 (UTC) Received: (qmail 17242 invoked by uid 500); 29 Apr 2015 20:15:07 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 17157 invoked by uid 500); 29 Apr 2015 20:15:07 -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 17084 invoked by uid 99); 29 Apr 2015 20:15:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2015 20:15:07 +0000 Date: Wed, 29 Apr 2015 20:15:07 +0000 (UTC) From: "Thomas Neidhart (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MATH-1143) Helper methods to FiniteDifferencesDifferentiator 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-1143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14520131#comment-14520131 ] Thomas Neidhart commented on MATH-1143: --------------------------------------- Examples: evaluation {code} public static double derivative(UnivariateDifferentiableFunction f, double x, int order) { DerivativeStructure ds = f.value(new DerivativeStructure(1, order, 0, x)); return ds.getPartialDerivative(order); } {code} derivative function {code} public static UnivariateFunction derivative(final UnivariateDifferentiableFunction f, final int order) { return new UnivariateFunction() { @Override public double value(double x) { DerivativeStructure ds = f.value(new DerivativeStructure(1, order, 0, x)); return ds.getPartialDerivative(order); } }; } {code} > Helper methods to FiniteDifferencesDifferentiator > ------------------------------------------------- > > Key: MATH-1143 > URL: https://issues.apache.org/jira/browse/MATH-1143 > Project: Commons Math > Issue Type: Improvement > Reporter: Alexander Nozik > Priority: Trivial > > A DerivativeStructure and UnivariateDifferentiableFunction are great tools if one needs to investigate the whole function but are not convenient if one just needs derivative in a given point. > Perhaps you could add some helper methods to FiniteDifferencesDifferentiator or to utility class like FunctionUtils. Also it would be good to have helper methods to get the derivatives of UnivariateDifferentiableFunction or MultivariateDifferentiableFunction as simple Univariate or Multivariate functions (or vector-functions). -- This message was sent by Atlassian JIRA (v6.3.4#6332)