Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 8097 invoked from network); 10 Sep 2008 20:20:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Sep 2008 20:20:07 -0000 Received: (qmail 21753 invoked by uid 500); 10 Sep 2008 20:20:02 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 21682 invoked by uid 500); 10 Sep 2008 20:20:02 -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 21649 invoked by uid 99); 10 Sep 2008 20:20:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 13:20:02 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 20:19:12 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5D987234C1DC for ; Wed, 10 Sep 2008 13:19:44 -0700 (PDT) Message-ID: <1397070589.1221077984382.JavaMail.jira@brutus> Date: Wed, 10 Sep 2008 13:19:44 -0700 (PDT) From: "Luc Maisonobe (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (MATH-218) UnivariateRealSolver: Allow function to be passed as argument to the "solve" method In-Reply-To: <1875272065.1217522431893.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MATH-218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Luc Maisonobe updated MATH-218: ------------------------------- Fix Version/s: 2.0 set target version to 2.0 > UnivariateRealSolver: Allow function to be passed as argument to the "solve" method > ----------------------------------------------------------------------------------- > > Key: MATH-218 > URL: https://issues.apache.org/jira/browse/MATH-218 > Project: Commons Math > Issue Type: Improvement > Reporter: Gilles > Priority: Trivial > Fix For: 2.0 > > > Hello. > I was wondering why all the root finders (e.g. NewtonSolver, BrentSolver, etc.) require the function to be passed as an argument to the contructor. > It should be possible to pass it when calling the method "solve" i.e. > double solve(UnivariateRealFunction f, double min, double max) > This would be much more flexible, e.g. allowing one to use the same solver instance for several functions. > > For example, my need would be something like the following (currently impossible) code: > public class Zero implements UnivariateRealFunction { > public value(double x) throws FunctionEvaluationException { > return ...; > } > public double get(UnivariateRealSolver s, double min, double max) { > return s.solve(this, min, max); > } > } > Best regards, > Gilles -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.