/// <summary>
        /// Creates a sparse Gamma list of a given size with given shape and scale Vectors.
        /// </summary>
        /// <param name="shape">shape</param>
        /// <param name="scale">scale</param>
        /// <param name="tolerance">The tolerance for the approximation</param>
        public static SparseGammaList FromShapeAndScale(
            SparseVector shape, SparseVector scale, double tolerance)
        {
            var result = new SparseGammaList(shape.Count, tolerance);

            result.SetToFunction(shape, scale, (s, sc) => Gamma.FromShapeAndScale(s, sc));
            return(result);
        }
        /// <summary>
        /// Creates a sparse Gamma list of a given size with given shape and rate Vectors.
        /// </summary>
        /// <param name="shape">shape</param>
        /// <param name="rate">rate = 1/scale</param>
        /// <param name="tolerance">The tolerance for the approximation</param>
        public static SparseGammaList FromShapeAndRate(
            Vector shape, Vector rate, double tolerance)
        {
            var result = new SparseGammaList(shape.Count, tolerance);

            result.SetToFunction(shape, rate, (s, r) => Gamma.FromShapeAndRate(s, r));
            return(result);
        }