本文整理汇总了C#中ScalarValue.Conjugate方法的典型用法代码示例。如果您正苦于以下问题:C# ScalarValue.Conjugate方法的具体用法?C# ScalarValue.Conjugate怎么用?C# ScalarValue.Conjugate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScalarValue
的用法示例。
在下文中一共展示了ScalarValue.Conjugate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LogGamma_Stirling
static ScalarValue LogGamma_Stirling(ScalarValue z)
{
if (z.Im < 0.0)
{
return LogGamma_Stirling(z.Conjugate()).Conjugate();
}
var f = (z - 0.5) * z.Ln() - z + Math.Log(2.0 * Math.PI) / 2.0;
var reduce = f.Im / (2.0 * Math.PI);
reduce = f.Im - (int)(reduce) * 2.0 * Math.PI;
f = new ScalarValue(f.Re, reduce);
var zsqu = z * z;
var zp = z.Clone();
for (var i = 1; i < 10; i++)
{
var f_old = f.Clone();
f += Helpers.BernoulliNumbers[i] / (2 * i) / (2 * i - 1) / zp;
if (f == f_old)
{
return (f);
}
zp = zp * zsqu;
}
throw new YAMPNotConvergedException("gamma");
}
示例2: GetValue
protected override ScalarValue GetValue(ScalarValue value)
{
return value.Conjugate();
}
示例3: Faddeeva
/// <summary>
/// The Faddeeva function or Kramp function is a scaled complex complementary error function.
/// </summary>
/// <param name="z">The argument z.</param>
/// <returns>The evaluated value.</returns>
public static ScalarValue Faddeeva(ScalarValue z)
{
if (z.Im < 0.0)
return 2.0 * (-z * z).Exp() - Faddeeva(-z);
if (z.Re < 0.0)
return Faddeeva(-z.Conjugate()).Conjugate();
var r = z.Abs();
if (r < 2.0)
return (-z * z).Exp() * (1.0 - Erf_Series(-ScalarValue.I * z));
else if ((z.Im < 0.1) && (z.Re < 30.0))
return Taylor(new ScalarValue(z.Re), Math.Exp(-z.Re * z.Re) + 2.0 * Dawson.DawsonIntegral(z.Re) / Helpers.SqrtPI * ScalarValue.I, new ScalarValue(0.0, z.Im));
else if (r > 7.0)
return ContinuedFraction(z);
return Weideman(z);
}