Ejemplo n.º 1
0
        /// <summary>
        /// Creates an integrator from the given {@code points} and {@code weights}.
        /// The integration interval is defined by the first and last value of
        /// {@code points} which must be sorted in increasing order.
        /// </summary>
        /// <param name="points"> Integration points. </param>
        /// <param name="weights"> Weights of the corresponding integration nodes. </param>
        /// <exception cref="NonMonotonicSequenceException"> if the {@code points} are not
        /// sorted in increasing order. </exception>
        /// <exception cref="DimensionMismatchException"> if points and weights don't have the same length </exception>
        public GaussIntegrator(double[] points, double[] weights)
        {
            if (points.Length != weights.Length)
            {
                throw new DimensionMismatchException(points.Length, weights.Length);
            }

            MathArrays.CheckOrder(points, MathArrays.OrderDirection.INCREASING, true, true);

            this.points  = (double[])points.Clone();
            this.weights = (double[])weights.Clone();
        }