Ejemplo n.º 1
0
 /// <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)
 {
 }
Ejemplo n.º 2
0
        /// <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.");
            }
        }
Ejemplo n.º 3
0
 public Simpson(IntegralInputParameters integralInputParameters)
     : base(integralInputParameters)
 {
 }
Ejemplo n.º 4
0
 public Trapezium(IntegralInputParameters integralInputParameters)
     : base(integralInputParameters)
 {
 }
Ejemplo n.º 5
0
 public RectangleRight(IntegralInputParameters integralInputParameters)
     : base(integralInputParameters)
 {
 }
Ejemplo n.º 6
0
 public RectangleAverage(IntegralInputParameters integralInputParameters)
     : base(integralInputParameters)
 {
 }