/// <summary>
        /// Calculates value of function for given point.
        /// </summary>
        /// <param name="coordinates">Point for which we want to calculate function value.</param>
        /// <returns>Value of function.</returns>

        public override double CalculateValue(params double[] coordinates)
        {
            if (coordinates.Length == 1 && parameters != null)
            {
                SearchByCoordinateAxes.Expression expression = parameters[0];
                double x0 = expression(coordinates[0]);
                return(Math.Pow(x0 - 3, 2));
            }
            else
            {
                return(Math.Pow(coordinates[0] - 3, 2));
            }
        }
        /// <summary>
        /// Calculates value of function for given point.
        /// </summary>
        /// <param name="coordinates">Point for which we want to calculate function value.</param>
        /// <returns>Value of function.</returns>

        public override double CalculateValue(params double[] coordinates)
        {
            if (coordinates.Length == 1 && parameters != null)
            {
                SearchByCoordinateAxes.Expression expression0 = parameters[0];
                SearchByCoordinateAxes.Expression expression1 = parameters[1];
                double x0 = expression0(coordinates[0]);
                double x1 = expression1(coordinates[0]);
                return(Math.Pow(x0 - 4, 2) + 4 * Math.Pow(x1 - 2, 2));
            }
            else
            {
                return(Math.Pow(coordinates[0] - 4, 2) + 4 * Math.Pow(coordinates[1] - 2, 2));
            }
        }
        /// <summary>
        /// Calculates value of function for given point.
        /// </summary>
        /// <param name="coordinates">Point for which we want to calculate function value.</param>
        /// <returns>Value of function.</returns>

        public override double CalculateValue(params double[] coordinates)
        {
            if (coordinates.Length == 1 && parameters != null)
            {
                SearchByCoordinateAxes.Expression expression0 = parameters[0];
                SearchByCoordinateAxes.Expression expression1 = parameters[1];
                double x0 = expression0(coordinates[0]);
                double x1 = expression1(coordinates[0]);
                return(Math.Abs((x0 - x1) * (x0 + x1)) + Math.Sqrt(Math.Pow(x0, 2) + Math.Pow(x1, 2)));
            }
            else
            {
                return(Math.Abs((coordinates[0] - coordinates[1]) * (coordinates[0] + coordinates[1]))
                       + Math.Sqrt(Math.Pow(coordinates[0], 2) + Math.Pow(coordinates[1], 2)));
            }
        }
        /// <summary>
        /// Calculates value of function for given point.
        /// </summary>
        /// <param name="coordinates">Point for which we want to calculate function value.</param>
        /// <returns>Value of function.</returns>

        public override double CalculateValue(params double[] coordinates)
        {
            double sum = 0;

            if (coordinates.Length == 1 && parameters != null)
            {
                for (int i = 0; i < parameters.Length; i++)
                {
                    SearchByCoordinateAxes.Expression expression = parameters[i];
                    double xi = expression(coordinates[0]);
                    sum += Math.Pow(xi - (i + 1), 2);
                }
            }
            else
            {
                for (int i = 0; i < coordinates.Length; i++)
                {
                    sum += Math.Pow(coordinates[i] - (i + 1), 2);
                }
            }
            return(sum);
        }
        /// <summary>
        /// Sets parameters of function.
        /// </summary>
        /// <param name="index">Index of parameters field.</param>
        /// <param name="expression">Expression used as a parameter.</param>

        public void SetParameters(int index, SearchByCoordinateAxes.Expression expression)
        {
            parameters[index] = expression;
        }