예제 #1
0
        /// <summary>
        /// Returns a new instance of the <see cref="BernoulliIntegerSubset"/> class of a given size
        /// from a sparse list of probability true.
        /// </summary>
        /// <param name="probTrue">The sparse list of probability of true.</param>
        /// <param name="tolerance">The tolerance for the approximation.</param>
        /// <returns>The new <see cref="BernoulliIntegerSubset"/> instance.</returns>
        public static BernoulliIntegerSubset FromProbTrue(
            ISparseList <double> probTrue, double tolerance)
        {
            BernoulliIntegerSubset result = new BernoulliIntegerSubset();

            result.SparseBernoulliList = SparseBernoulliList.FromProbTrue(probTrue, tolerance);
            return(result);
        }
예제 #2
0
        /// <summary>
        /// Returns a new instance of the <see cref="BernoulliIntegerSubset"/> class of a given size
        /// with each element having a given probability of true.
        /// </summary>
        /// <param name="size">The size of the list.</param>
        /// <param name="probTrue">The desired probability of true.</param>
        /// <param name="tolerance">The tolerance for the approximation.</param>
        /// <returns>The new <see cref="BernoulliIntegerSubset"/> instance.</returns>
        public static BernoulliIntegerSubset FromProbTrue(
            int size, double probTrue, double tolerance)
        {
            var result = new BernoulliIntegerSubset();

            result.SparseBernoulliList = SparseBernoulliList.FromProbTrue(size, probTrue, tolerance);
            return(result);
        }