View Javadoc
1   /*
2    * Licensed to the Hipparchus project under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The Hipparchus project licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      https://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.hipparchus.special.elliptic.legendre;
18  
19  import org.hipparchus.analysis.CalculusFieldUnivariateFunction;
20  import org.hipparchus.analysis.integration.IterativeLegendreGaussIntegrator;
21  import org.hipparchus.complex.Complex;
22  import org.hipparchus.complex.ComplexUnivariateIntegrator;
23  
24  public class LegendreEllipticIntegralComplexTest extends LegendreEllipticIntegralAbstractComplexTest<Complex> {
25  
26      private ComplexUnivariateIntegrator integrator() {
27          return new ComplexUnivariateIntegrator(new IterativeLegendreGaussIntegrator(24,
28                                                                                      1.0e-6,
29                                                                                      1.0e-6));
30      }
31  
32      protected Complex buildComplex(double realPart) {
33          return new Complex(realPart);
34      }
35  
36      protected Complex buildComplex(double realPart, double imaginaryPart) {
37          return new Complex(realPart, imaginaryPart);
38      }
39  
40      protected Complex K(Complex m) {
41          return LegendreEllipticIntegral.bigK(m);
42      }
43  
44      protected Complex Kprime(Complex m) {
45          return LegendreEllipticIntegral.bigKPrime(m);
46      }
47  
48      protected Complex F(Complex phi, Complex m) {
49          return LegendreEllipticIntegral.bigF(phi, m);
50      }
51  
52      protected Complex integratedF(Complex phi, Complex m) {
53          return LegendreEllipticIntegral.bigF(phi, m, integrator(), 100000);
54      }
55  
56      protected Complex E(Complex m) {
57          return LegendreEllipticIntegral.bigE(m);
58      }
59  
60      protected Complex E(Complex phi, Complex m) {
61          return LegendreEllipticIntegral.bigE(phi, m);
62      }
63  
64      protected Complex integratedE(Complex phi, Complex m) {
65          return LegendreEllipticIntegral.bigE(phi, m, integrator(), 100000);
66      }
67  
68      protected Complex D(Complex m) {
69          return LegendreEllipticIntegral.bigD(m);
70      }
71  
72      protected Complex D(Complex phi, Complex m) {
73          return LegendreEllipticIntegral.bigD(phi, m);
74      }
75  
76      protected Complex Pi(Complex n, Complex m) {
77          return LegendreEllipticIntegral.bigPi(n, m);
78      }
79  
80      protected Complex Pi(Complex n, Complex phi, Complex m) {
81          return LegendreEllipticIntegral.bigPi(n, phi, m);
82      }
83  
84      protected Complex integratedPi(Complex n, Complex phi, Complex m) {
85          return LegendreEllipticIntegral.bigPi(n, phi, m, integrator(), 100000);
86      }
87  
88      protected Complex integrate(int maxEval, CalculusFieldUnivariateFunction<Complex> f, Complex start, Complex end) {
89          return integrator().integrate(maxEval, f, start, end);
90      }
91  
92      protected Complex integrate(int maxEval, CalculusFieldUnivariateFunction<Complex> f, Complex start, Complex middle, Complex end) {
93          return integrator().integrate(maxEval, f, start, middle, end);
94      }
95  
96  }