/// <summary>Initializes a new instance of the <see cref="ClosedNewtonCotesFormula"/> class. /// </summary> /// <param name="rule">The Newton-Cotes type, i.e. the degree of the Newton-Cotes method.</param> /// <param name="exitCondition">The exit condition.</param> public ClosedNewtonCotesFormula(Rule rule, ExitCondition exitCondition) : base(BoundDescriptor.Closed, BoundDescriptor.Closed) { ExitCondition = exitCondition ?? throw new ArgumentNullException(nameof(exitCondition)); NewtonCotesType = rule; m_Name = new IdentifierString(String.Format("Newton-Cotes {0} Integrator", rule)); }
/// <summary>Initializes a new instance of the <see cref="GaussHermiteIntegrator"/> class. /// </summary> /// <param name="initialOrder">The initial order of the Gauss-Hermite approach, i.e. the order in the first iteration step.</param> /// <param name="orderStepSize">The step size of the order, i.e. in each iteration step the order will be increased by the specified number.</param> /// <param name="exitCondition">The exit condition.</param> public GaussHermiteIntegrator(int initialOrder, int orderStepSize, ExitCondition exitCondition) : base(BoundDescriptor.Create(BoundEvaluationType.Unbounded, Double.NegativeInfinity), BoundDescriptor.Create(BoundEvaluationType.Unbounded, Double.PositiveInfinity)) { ExitCondition = exitCondition ?? throw new ArgumentNullException(nameof(exitCondition)); m_Name = new IdentifierString("Gauss-Hermite Integrator"); InitialOrder = initialOrder; OrderStepSize = orderStepSize; }
/// <summary>Initializes a new instance of the <see cref="GaussLegendreIntegrator"/> class. /// </summary> /// <param name="initialOrder">The initial order of the Gauss-Legendre approach, i.e. the order in the first iteration step.</param> /// <param name="orderStepSize">The step size of the order, i.e. in each iteration step the order will be increased by the specified number.</param> /// <param name="exitCondition">The exit condition.</param> public GaussLegendreIntegrator(int initialOrder, int orderStepSize, ExitCondition exitCondition) : base(BoundDescriptor.Closed, BoundDescriptor.Closed) { ExitCondition = exitCondition ?? throw new ArgumentNullException(nameof(exitCondition)); m_Name = new IdentifierString("Gauss-Legendre Integrator"); InitialOrder = initialOrder; OrderStepSize = orderStepSize; }
/// <summary>Gets informations of the current object as a specific <see cref="T:Dodoni.BasicComponents.Containers.InfoOutput"/> instance. /// </summary> /// <param name="infoOutput">The <see cref="T:Dodoni.BasicComponents.Containers.InfoOutput"/> object which is to be filled with informations concering the current instance.</param> /// <param name="categoryName">The name of the category, i.e. all informations will be added to these category.</param> public override void FillInfoOutput(InfoOutput infoOutput, string categoryName = "General") { var infoOutputPackage = infoOutput.AcquirePackage(categoryName); infoOutputPackage.Add("Dimension", 1); infoOutputPackage.Add("Weight function is 1.0", true); LowerBoundDescriptor.FillInfoOutput(infoOutput, categoryName + ".LowerBoundDescriptor"); UpperBoundDescriptor.FillInfoOutput(infoOutput, categoryName + ".UpperBoundDescriptor"); ExitCondition.FillInfoOutput(infoOutput, categoryName + ".ExitCondition"); }
/// <summary>Gets informations of the current object as a specific <see cref="T:Dodoni.BasicComponents.Containers.InfoOutput"/> instance. /// </summary> /// <param name="infoOutput">The <see cref="T:Dodoni.BasicComponents.Containers.InfoOutput"/> object which is to be filled with informations concering the current instance.</param> /// <param name="categoryName">The name of the category, i.e. all informations will be added to these category.</param> public override void FillInfoOutput(InfoOutput infoOutput, string categoryName = "General") { var infoOutputPackage = infoOutput.AcquirePackage(categoryName); infoOutputPackage.Add("Dimension", 1); infoOutputPackage.Add("Weight function is 1.0", false); infoOutputPackage.Add("Initial order", InitialOrder); infoOutputPackage.Add("Order step size", OrderStepSize); LowerBoundDescriptor.FillInfoOutput(infoOutput, categoryName + ".LowerBoundDescriptor"); UpperBoundDescriptor.FillInfoOutput(infoOutput, categoryName + ".UpperBoundDescriptor"); ExitCondition.FillInfoOutput(infoOutput, categoryName + ".ExitCondition"); }
/// <summary>Initializes a new instance of the <see cref="GaussTschebyscheffIntegrator"/> class. /// </summary> /// <param name="initialOrder">The initial order of the Gauss-Tschebyscheff approach, i.e. the order in the first iteration step.</param> /// <param name="orderStepSize">The step size of the order, i.e. in each iteration step the order will be increased by the specified number.</param> /// <param name="exitCondition">The exit condition.</param> public GaussTschebyscheffIntegrator(int initialOrder, int orderStepSize, ExitCondition exitCondition) : base(BoundDescriptor.Open, BoundDescriptor.Open) { ExitCondition = exitCondition ?? throw new ArgumentNullException(nameof(exitCondition)); if (initialOrder < 2) { throw new ArgumentOutOfRangeException(String.Format(ExceptionMessages.ArgumentOutOfRangeGreaterEqual, "Initial order", 2)); } InitialOrder = initialOrder; if (orderStepSize < 1) { throw new ArgumentOutOfRangeException(String.Format(ExceptionMessages.ArgumentOutOfRangeGreaterEqual, "Order step size", 1)); } OrderStepSize = orderStepSize; m_Name = new IdentifierString("Gauss-Tschebyscheff Integrator"); }
/// <summary>Initializes a new instance of the <see cref="GaussKronrodPatterson255ConstAbscissaIntegrator"/> class. /// </summary> /// <param name="exitCondition">The exit condition.</param> public GaussKronrodPatterson255ConstAbscissaIntegrator(ExitCondition exitCondition) : base(OneDimNumericalIntegrator.BoundDescriptor.Closed, OneDimNumericalIntegrator.BoundDescriptor.Closed) { ExitCondition = exitCondition ?? throw new ArgumentNullException(nameof(exitCondition)); m_Name = new IdentifierString("Gauss-Kronrod-Patterson 255 const abscissa Integrator"); }
/// <summary>Initializes a new instance of the <see cref="RombergIntegrator"/> class. /// </summary> /// <param name="exitCondition">The exit condition.</param> public RombergIntegrator(ExitCondition exitCondition) : base(BoundDescriptor.Closed, BoundDescriptor.Closed) { ExitCondition = exitCondition ?? throw new ArgumentNullException(nameof(exitCondition)); m_Name = new IdentifierString("Romberg Integrator"); }
/// <summary>Initializes a new instance of the <see cref="GaussKronrodPatterson255Integrator"/> class. /// </summary> /// <param name="exitCondition">The exit condition.</param> public GaussKronrodPatterson255Integrator(ExitCondition exitCondition) : base(BoundDescriptor.Closed, BoundDescriptor.Closed) { ExitCondition = exitCondition ?? throw new ArgumentNullException(nameof(exitCondition)); m_Name = new IdentifierString("Gauss-Kronrod-Patterson 255 Integrator"); }
/// <summary>Initializes a new instance of the <see cref="GaussLaguerreIntegrator"/> class. /// </summary> /// <param name="alpha">The parameter \alpha of the Guass-Laguerre integrator.</param> /// <param name="initialOrder">The initial order of the Gauss-Laguerre approach, i.e. the order in the first iteration step.</param> /// <param name="orderStepSize">The step size of the order, i.e. in each iteration step the order will be increased by the specified number.</param> /// <param name="exitCondition">The exit condition.</param> public GaussLaguerreIntegrator(double alpha, int initialOrder, int orderStepSize, ExitCondition exitCondition) : this(alpha, initialOrder, orderStepSize, exitCondition, alphaIsZero : false) { m_Weights = new Dictionary <int, double[]>(); m_Abscissas = new Dictionary <int, double[]>(); }
/// <summary>Initializes a new instance of the <see cref="GaussLaguerreIntegrator"/> class. /// </summary> /// <param name="alpha">The parameter \alpha of the Guass-Laguerre integrator.</param> /// <param name="initialOrder">The initial order of the Gauss-Laguerre approach, i.e. the order in the first iteration step.</param> /// <param name="orderStepSize">The step size of the order, i.e. in each iteration step the order will be increased by the specified number.</param> /// <param name="exitCondition">The exit condition.</param> /// <param name="alphaIsZero">A value indicating whether the parameter <paramref name="alpha"/> is 0.0.</param> private GaussLaguerreIntegrator(double alpha, int initialOrder, int orderStepSize, ExitCondition exitCondition, bool alphaIsZero) : base(OneDimNumericalIntegrator.BoundDescriptor.Create(OneDimNumericalIntegrator.BoundEvaluationType.Closed, 0.0), OneDimNumericalIntegrator.BoundDescriptor.Create(OneDimNumericalIntegrator.BoundEvaluationType.Unbounded, Double.PositiveInfinity)) { ExitCondition = exitCondition ?? throw new ArgumentNullException(nameof(exitCondition)); if (Double.IsNaN(alpha) == true) { throw new ArgumentOutOfRangeException("alpha"); } Alpha = alpha; m_Name = new IdentifierString(String.Format("Gauss-Laguerre Integrator; alpha: {0}", alpha)); InitialOrder = initialOrder; OrderStepSize = orderStepSize; m_AlphaIsZero = alphaIsZero; }
/// <summary>Initializes a new instance of the <see cref="GaussLaguerreIntegrator"/> class with \alpha = 0.0. /// </summary> /// <param name="initialOrder">The initial order of the Gauss-Laguerre approach, i.e. the order in the first iteration step.</param> /// <param name="orderStepSize">The step size of the order, i.e. in each iteration step the order will be increased by the specified number.</param> /// <param name="exitCondition">The exit condition.</param> public GaussLaguerreIntegrator(int initialOrder, int orderStepSize, ExitCondition exitCondition) : this(0.0, initialOrder, orderStepSize, exitCondition, alphaIsZero : true) { }