コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BernoulliIntegerSubset"/> class
        /// with the specified number of elements all of which are set to the specified <see cref="Bernoulli"/> instance.
        /// </summary>
        /// <param name="size">The size of the list.</param>
        /// <param name="commonValue">The common value.</param>
        /// <param name="tolerance">The tolerance for the approximation.</param>
        /// <returns>The new <see cref="BernoulliIntegerSubset"/> instance.</returns>
        public static BernoulliIntegerSubset FromBernoulli(int size, Bernoulli commonValue, double tolerance)
        {
            var result = new BernoulliIntegerSubset();

            result.SparseBernoulliList = SparseBernoulliList.Constant(size, commonValue, tolerance);
            return(result);
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BernoulliIntegerSubset"/> class
 /// of the given size, and assigns all elements to the specified common value.
 /// </summary>
 /// <param name="size">The size of the list.</param>
 /// <param name="commonValue">The common value.</param>
 protected BernoulliIntegerSubset(int size, Bernoulli commonValue)
 {
     SparseBernoulliList = SparseBernoulliList.Constant(size, commonValue);
 }