本文整理匯總了C#中Beta.SetToUniform方法的典型用法代碼示例。如果您正苦於以下問題:C# Beta.SetToUniform方法的具體用法?C# Beta.SetToUniform怎麽用?C# Beta.SetToUniform使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Beta
的用法示例。
在下文中一共展示了Beta.SetToUniform方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: BAverageLogarithm
/// <summary>
/// VMP message to 'b'
/// </summary>
/// <param name="Product">Constant value for 'product'.</param>
/// <param name="A">Constant value for 'a'.</param>
/// <returns>The outgoing VMP message to the 'b' argument</returns>
/// <remarks><para>
/// The outgoing message is the factor viewed as a function of 'b' conditioned on the given values.
/// </para></remarks>
public static Beta BAverageLogarithm(double Product, double A)
{
Beta result = new Beta();
if (A == 0) {
if (Product != 0) throw new AllZeroException();
result.SetToUniform();
} else if((Product > 0) != (A > 0)) throw new AllZeroException("Product and argument do not have the same sign");
else if(Product > A) throw new AllZeroException("Product is greater than the argument");
else result.Point = Product / A;
return result;
}