commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1184941 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Minus.java
Date Sun, 16 Oct 2011 21:49:03 GMT
Author: erans
Date: Sun Oct 16 21:49:02 2011
New Revision: 1184941

URL: http://svn.apache.org/viewvc?rev=1184941&view=rev
Log:
Added "derivative".

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Minus.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Minus.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Minus.java?rev=1184941&r1=1184940&r2=1184941&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Minus.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/function/Minus.java
Sun Oct 16 21:49:02 2011
@@ -17,7 +17,7 @@
 
 package org.apache.commons.math.analysis.function;
 
-import org.apache.commons.math.analysis.UnivariateRealFunction;
+import org.apache.commons.math.analysis.DifferentiableUnivariateRealFunction;
 
 /**
  * Minus function.
@@ -25,9 +25,14 @@ import org.apache.commons.math.analysis.
  * @version $Id$
  * @since 3.0
  */
-public class Minus implements UnivariateRealFunction {
+public class Minus implements DifferentiableUnivariateRealFunction {
     /** {@inheritDoc} */
     public double value(double x) {
         return -x;
     }
+
+    /** {@inheritDoc} */
+    public DifferentiableUnivariateRealFunction derivative() {
+        return new Constant(-1);
+    }
 }



Mime
View raw message