1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.hipparchus.special.elliptic.legendre;
18
19 import org.hipparchus.analysis.CalculusFieldUnivariateFunction;
20 import org.hipparchus.analysis.integration.IterativeLegendreFieldGaussIntegrator;
21 import org.hipparchus.complex.FieldComplex;
22 import org.hipparchus.complex.FieldComplexUnivariateIntegrator;
23 import org.hipparchus.util.Binary64;
24 import org.hipparchus.util.Binary64Field;
25
26 public class LegendreEllipticIntegralFieldComplexTest extends LegendreEllipticIntegralAbstractComplexTest<FieldComplex<Binary64>> {
27
28 private FieldComplexUnivariateIntegrator<Binary64> integrator() {
29 return new FieldComplexUnivariateIntegrator<>(new IterativeLegendreFieldGaussIntegrator<>(Binary64Field.getInstance(),
30 24,
31 1.0e-6,
32 1.0e-6));
33 }
34
35 protected FieldComplex<Binary64> buildComplex(double realPart) {
36 return new FieldComplex<>(new Binary64(realPart));
37 }
38
39 protected FieldComplex<Binary64> buildComplex(double realPart, double imaginaryPart) {
40 return new FieldComplex<>(new Binary64(realPart), new Binary64(imaginaryPart));
41 }
42
43 protected FieldComplex<Binary64> K(FieldComplex<Binary64> m) {
44 return LegendreEllipticIntegral.bigK(m);
45 }
46
47 protected FieldComplex<Binary64> Kprime(FieldComplex<Binary64> m) {
48 return LegendreEllipticIntegral.bigKPrime(m);
49 }
50
51 protected FieldComplex<Binary64> F(FieldComplex<Binary64> phi, FieldComplex<Binary64> m) {
52 return LegendreEllipticIntegral.bigF(phi, m);
53 }
54
55 protected FieldComplex<Binary64> integratedF(FieldComplex<Binary64> phi, FieldComplex<Binary64> m) {
56 return LegendreEllipticIntegral.bigF(phi, m, integrator(), 100000);
57 }
58
59 protected FieldComplex<Binary64> E(FieldComplex<Binary64> m) {
60 return LegendreEllipticIntegral.bigE(m);
61 }
62
63 protected FieldComplex<Binary64> E(FieldComplex<Binary64> phi, FieldComplex<Binary64> m) {
64 return LegendreEllipticIntegral.bigE(phi, m);
65 }
66
67 protected FieldComplex<Binary64> integratedE(FieldComplex<Binary64> phi, FieldComplex<Binary64> m) {
68 return LegendreEllipticIntegral.bigE(phi, m, integrator(), 100000);
69 }
70
71 protected FieldComplex<Binary64> D(FieldComplex<Binary64> m) {
72 return LegendreEllipticIntegral.bigD(m);
73 }
74
75 protected FieldComplex<Binary64> D(FieldComplex<Binary64> phi, FieldComplex<Binary64> m) {
76 return LegendreEllipticIntegral.bigD(phi, m);
77 }
78
79 protected FieldComplex<Binary64> Pi(FieldComplex<Binary64> n, FieldComplex<Binary64> m) {
80 return LegendreEllipticIntegral.bigPi(n, m);
81 }
82
83 protected FieldComplex<Binary64> Pi(FieldComplex<Binary64> n, FieldComplex<Binary64> phi, FieldComplex<Binary64> m) {
84 return LegendreEllipticIntegral.bigPi(n, phi, m);
85 }
86
87 protected FieldComplex<Binary64> integratedPi(FieldComplex<Binary64> n, FieldComplex<Binary64> phi, FieldComplex<Binary64> m) {
88 return LegendreEllipticIntegral.bigPi(n, phi, m, integrator(), 100000);
89 }
90
91 protected FieldComplex<Binary64> integrate(int maxEval, CalculusFieldUnivariateFunction<FieldComplex<Binary64>> f,
92 FieldComplex<Binary64> start, FieldComplex<Binary64> end) {
93 return integrator().integrate(maxEval, f, start, end);
94 }
95
96 @SuppressWarnings("unchecked")
97 protected FieldComplex<Binary64> integrate(int maxEval, CalculusFieldUnivariateFunction<FieldComplex<Binary64>> f,
98 FieldComplex<Binary64> start, FieldComplex<Binary64> middle, FieldComplex<Binary64> end) {
99 return integrator().integrate(maxEval, f, start, middle, end);
100 }
101
102 }