1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.hipparchus.ode.nonstiff;
19
20 import org.hipparchus.exception.MathIllegalArgumentException;
21 import org.hipparchus.exception.MathIllegalStateException;
22 import org.junit.jupiter.api.Test;
23
24 import static org.junit.jupiter.api.Assertions.assertThrows;
25
26 class AdamsBashforthIntegratorTest extends AdamsIntegratorAbstractTest {
27
28 protected AdamsIntegrator
29 createIntegrator(final int nSteps, final double minStep, final double maxStep,
30 final double scalAbsoluteTolerance, final double scalRelativeTolerance) {
31 return new AdamsBashforthIntegrator(nSteps, minStep, maxStep,
32 scalAbsoluteTolerance, scalRelativeTolerance);
33 }
34
35 protected AdamsIntegrator
36 createIntegrator(final int nSteps, final double minStep, final double maxStep,
37 final double[] vecAbsoluteTolerance, final double[] vecRelativeTolerance) {
38 return new AdamsBashforthIntegrator(nSteps, minStep, maxStep,
39 vecAbsoluteTolerance, vecRelativeTolerance);
40 }
41
42 @Test
43 void testNbPoints() {
44 doNbPointsTest();
45 }
46
47 @Test
48 public void testMinStep() {
49 assertThrows(MathIllegalArgumentException.class, () -> {
50 doDimensionCheck();
51 });
52 }
53
54 @Test
55 public void testIncreasingTolerance() {
56
57
58
59 doTestIncreasingTolerance(2.6, 122);
60 }
61
62 @Test
63 public void exceedMaxEvaluations() {
64 assertThrows(MathIllegalStateException.class, () -> {
65 doExceedMaxEvaluations(650);
66 });
67 }
68
69 @Test
70 public void backward() {
71 doBackward(4.3e-8, 4.3e-8, 1.0e-16, "Adams-Bashforth");
72 }
73
74 @Test
75 public void polynomial() {
76 doPolynomial(5, 9.0e-4, 9.3e-10);
77 }
78
79 @Test
80 public void testStartFailure() {
81 assertThrows(MathIllegalStateException.class, () -> {
82 doTestStartFailure();
83 });
84 }
85
86 @Test
87 public void testSecondaryEquations() {
88 doTestSecondaryEquations(4.3e-10, 6.7e-16);
89 }
90
91
92 }