/// <summary> /// Initializes a new instance of the <see cref="Integral" /> class. /// </summary> /// <param name="integralInputParameters"></param> public Integral(IntegralInputParameters integralInputParameters) : this(integralInputParameters.IntegrandExpression, integralInputParameters.StartValue, integralInputParameters.EndValue, integralInputParameters.IterationsNumber, integralInputParameters.ParameterName) { }
/// <summary> /// Method is used to get an appropriate Integral instance which implements a correct calculation method. /// </summary> /// <param name="calculationType">Calculation type.</param> /// <param name="integralInputParameters">Inegral input parameters</param> /// <returns>An appropriate integral instance.</returns> public static Integral GetIntegral(CalculationType calculationType, IntegralInputParameters integralInputParameters) { switch (calculationType) { case CalculationType.AverageRectangle: return(new RectangleAverage(integralInputParameters)); case CalculationType.LeftRectangle: return(new RectangleLeft(integralInputParameters)); case CalculationType.RightRectangle: return(new RectangleRight(integralInputParameters)); case CalculationType.Simpson: return(new Simpson(integralInputParameters)); case CalculationType.Trapezium: return(new Trapezium(integralInputParameters)); default: throw new Exception("Couldn't define an appropriate calculation method."); } }
public Simpson(IntegralInputParameters integralInputParameters) : base(integralInputParameters) { }
public Trapezium(IntegralInputParameters integralInputParameters) : base(integralInputParameters) { }
public RectangleRight(IntegralInputParameters integralInputParameters) : base(integralInputParameters) { }
public RectangleAverage(IntegralInputParameters integralInputParameters) : base(integralInputParameters) { }