~ubuntu-branches/ubuntu/oneiric/commons-math/oneiric

« back to all changes in this revision

Viewing changes to src/test/java/org/apache/commons/math/analysis/QuinticFunction.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan, Torsten Werner, Damien Raude-Morvan
  • Date: 2011-03-07 21:14:46 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110307211446-4zea7og4eeyzhpai
Tags: 2.2-1
[ Torsten Werner ]
* Change maintainers into Maintainers.

[ Damien Raude-Morvan ]
* New upstream release (Closes: #617209).
* d/control: Bump Standards-Version to 3.9.1 (no changes needed).
* d/copyright: Refresh years, upgrade to DEP5 r166 and relicence my work
  under Apache-2.0.
* d/ant.properties: Set junit.jar to /usr/share/java/junit4.jar
  to ensure unit tests are launched.
* d/docs: Install upstream RELEASE-NOTES.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 */
17
17
package org.apache.commons.math.analysis;
18
18
 
19
 
import org.apache.commons.math.FunctionEvaluationException;
20
 
 
21
19
/**
22
 
 * Auxillary class for testing solvers.
 
20
 * Auxiliary class for testing solvers.
23
21
 *
24
 
 * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
 
22
 * @version $Revision: 1037327 $ $Date: 2010-11-20 21:57:37 +0100 (sam. 20 nov. 2010) $
25
23
 */
26
24
public class QuinticFunction implements DifferentiableUnivariateRealFunction {
27
25
 
28
26
    /* Evaluate quintic.
29
27
     * @see org.apache.commons.math.UnivariateRealFunction#value(double)
30
28
     */
31
 
    public double value(double x) throws FunctionEvaluationException {
 
29
    public double value(double x) {
32
30
        return (x-1)*(x-0.5)*x*(x+0.5)*(x+1);
33
31
    }
34
32
 
35
33
    public UnivariateRealFunction derivative() {
36
34
        return new UnivariateRealFunction() {
37
 
            public double value(double x) throws FunctionEvaluationException {
 
35
            public double value(double x) {
38
36
                return (5*x*x-3.75)*x*x+0.25;
39
37
            }
40
38
        };