Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BDE71E9A1 for ; Thu, 27 Dec 2012 15:55:53 +0000 (UTC) Received: (qmail 80267 invoked by uid 500); 27 Dec 2012 15:55:53 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 80211 invoked by uid 500); 27 Dec 2012 15:55:53 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 80204 invoked by uid 99); 27 Dec 2012 15:55:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Dec 2012 15:55:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Dec 2012 15:55:51 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C6C9223889B3; Thu, 27 Dec 2012 15:55:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1426235 - /commons/sandbox/nabla/trunk/src/test/java/org/apache/commons/nabla/forward/ForwardModeDifferentiatorTest.java Date: Thu, 27 Dec 2012 15:55:30 -0000 To: commits@commons.apache.org From: luc@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121227155530.C6C9223889B3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: luc Date: Thu Dec 27 15:55:30 2012 New Revision: 1426235 URL: http://svn.apache.org/viewvc?rev=1426235&view=rev Log: preparing test for multiple objects handling (failing for now as support is not enabled yet) Modified: commons/sandbox/nabla/trunk/src/test/java/org/apache/commons/nabla/forward/ForwardModeDifferentiatorTest.java Modified: commons/sandbox/nabla/trunk/src/test/java/org/apache/commons/nabla/forward/ForwardModeDifferentiatorTest.java URL: http://svn.apache.org/viewvc/commons/sandbox/nabla/trunk/src/test/java/org/apache/commons/nabla/forward/ForwardModeDifferentiatorTest.java?rev=1426235&r1=1426234&r2=1426235&view=diff ============================================================================== --- commons/sandbox/nabla/trunk/src/test/java/org/apache/commons/nabla/forward/ForwardModeDifferentiatorTest.java (original) +++ commons/sandbox/nabla/trunk/src/test/java/org/apache/commons/nabla/forward/ForwardModeDifferentiatorTest.java Thu Dec 27 15:55:30 2012 @@ -21,10 +21,12 @@ import java.lang.reflect.Method; import org.apache.commons.math3.analysis.UnivariateFunction; import org.apache.commons.math3.analysis.differentiation.DerivativeStructure; import org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction; +import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import org.apache.commons.math3.util.FastMath; import org.apache.commons.nabla.AbstractMathTest; import org.junit.Assert; import org.junit.Test; +import org.junit.Ignore; public class ForwardModeDifferentiatorTest extends AbstractMathTest { @@ -342,4 +344,37 @@ public class ForwardModeDifferentiatorTe } } + // As of 2012-12-27, this test does not work yet... + @Ignore + @Test + public void testSeveralObjects() { + SeveralObjectsFunction function = + new SeveralObjectsFunction(1, 2, 3, 4, 5, 6, 7, 8, 9); + checkReference(function, 0.0, 10.0, 20, 1.0e-16); + } + + public static class SeveralObjectsFunction implements ReferenceFunction { + + private final Vector3D u1; + private final Vector3D u2; + private final Vector3D u3; + + public SeveralObjectsFunction(double x1, double y1, double z1, + double x2, double y2, double z2, + double x3, double y3, double z3) { + u1 = new Vector3D(x1, y1, z1); + u2 = new Vector3D(x2, y2, z2); + u3 = new Vector3D(x3, y3, z3); + } + + public double value(double y) { + return new Vector3D(1.0, u1, y, u2).dotProduct(u3); + } + + public double firstDerivative(double t) { + return u2.dotProduct(u3); + } + + } + }