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 9CBA110ACB for ; Fri, 4 Dec 2015 10:35:43 +0000 (UTC) Received: (qmail 87344 invoked by uid 500); 4 Dec 2015 10:35:42 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 87124 invoked by uid 500); 4 Dec 2015 10:35:42 -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 86756 invoked by uid 99); 4 Dec 2015 10:35:42 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Dec 2015 10:35:42 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4CC84E17F6; Fri, 4 Dec 2015 10:35:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: luc@apache.org To: commits@commons.apache.org Date: Fri, 04 Dec 2015 10:35:47 -0000 Message-Id: <0dfe90e6735e48abaccba00b3b813915@git.apache.org> In-Reply-To: <2ea09d85db48411b9d5ea98ced4000f5@git.apache.org> References: <2ea09d85db48411b9d5ea98ced4000f5@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [6/7] [math] Added test for classical midpoint step interpolator. Added test for classical midpoint step interpolator. Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/2c905d72 Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/2c905d72 Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/2c905d72 Branch: refs/heads/field-ode Commit: 2c905d720995541be2bcaa6ef4b33230d3dede36 Parents: 631ce31 Author: Luc Maisonobe Authored: Fri Dec 4 11:33:33 2015 +0100 Committer: Luc Maisonobe Committed: Fri Dec 4 11:33:33 2015 +0100 ---------------------------------------------------------------------- .../MidpointFieldStepInterpolatorTest.java | 44 ++++++++++++++++++++ 1 file changed, 44 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-math/blob/2c905d72/src/test/java/org/apache/commons/math3/ode/nonstiff/MidpointFieldStepInterpolatorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/MidpointFieldStepInterpolatorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/MidpointFieldStepInterpolatorTest.java new file mode 100644 index 0000000..d962856 --- /dev/null +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/MidpointFieldStepInterpolatorTest.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.math3.ode.nonstiff; + + +import org.apache.commons.math3.Field; +import org.apache.commons.math3.RealFieldElement; +import org.apache.commons.math3.ode.FieldEquationsMapper; +import org.apache.commons.math3.util.Decimal64Field; +import org.junit.Test; + +public class MidpointFieldStepInterpolatorTest extends AbstractRungeKuttaFieldStepInterpolatorTest { + + protected > RungeKuttaFieldStepInterpolator + createInterpolator(Field field, boolean forward, FieldEquationsMapper mapper) { + return new MidpointFieldStepInterpolator(field, forward, mapper); + } + + @Test + public void interpolationAtBounds() { + doInterpolationAtBounds(Decimal64Field.getInstance(), 1.0e-15); + } + + @Test + public void interpolationInside() { + doInterpolationInside(Decimal64Field.getInstance(), 3.3e-4, 1.1e-5); + } + +}