1 /* 2 * Copyright (C) 2023 Alberto Irurueta Carro (alberto@irurueta.com) 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.irurueta.numerical.integration; 17 18 import com.irurueta.algebra.WrongSizeException; 19 20 /** 21 * Computes function integration by using Romberg's method and exponential quadrature. 22 * Exponential quadrature allows improper integrations when upper bound is at infinity. 23 * 24 * @see ExponentialMidPointMatrixQuadrature 25 */ 26 public class RombergExponentialMidPointQuadratureMatrixIntegrator 27 extends RombergMatrixIntegrator<ExponentialMidPointMatrixQuadrature> { 28 29 /** 30 * Constructor. 31 * 32 * @param a Lower limit of integration. 33 * @param listener listener to evaluate a single dimension matrix (multivariate) function at 34 * required points. 35 * @param eps required accuracy. 36 * @throws WrongSizeException if size notified by provided listener is invalid. 37 */ 38 public RombergExponentialMidPointQuadratureMatrixIntegrator( 39 final double a, final MatrixSingleDimensionFunctionEvaluatorListener listener, 40 final double eps) throws WrongSizeException { 41 super(new ExponentialMidPointMatrixQuadrature(a, listener), eps); 42 } 43 44 /** 45 * Constructor with default accuracy. 46 * 47 * @param a Lower limit of integration. 48 * @param listener listener to evaluate a single dimension function at required points. 49 * @throws WrongSizeException if size notified by provided listener is invalid. 50 */ 51 public RombergExponentialMidPointQuadratureMatrixIntegrator( 52 final double a, final MatrixSingleDimensionFunctionEvaluatorListener listener) throws WrongSizeException { 53 this(a, listener, EPS); 54 } 55 56 /** 57 * Gets type of quadrature. 58 * 59 * @return type of quadrature. 60 */ 61 @Override 62 public QuadratureType getQuadratureType() { 63 return QuadratureType.EXPONENTIAL_MID_POINT; 64 } 65 }