本文整理匯總了C#中System.Complex.AlmostEqualListWithError方法的典型用法代碼示例。如果您正苦於以下問題:C# Complex.AlmostEqualListWithError方法的具體用法?C# Complex.AlmostEqualListWithError怎麽用?C# Complex.AlmostEqualListWithError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Complex
的用法示例。
在下文中一共展示了Complex.AlmostEqualListWithError方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: FourierDefaultTransformIsReversible
public void FourierDefaultTransformIsReversible()
{
var samples = Sample.Random((u, v) => new Complex(u, v), _uniform, 0x7FFF);
var work = new Complex[samples.Length];
samples.CopyTo(work, 0);
Transform.FourierForward(work);
Assert.IsFalse(work.AlmostEqualListWithError(samples, 1e-12));
Transform.FourierInverse(work);
AssertHelpers.AlmostEqualList(samples, work, 1e-12);
Transform.FourierInverse(work, FourierOptions.Default);
Assert.IsFalse(work.AlmostEqualListWithError(samples, 1e-12));
Transform.FourierForward(work, FourierOptions.Default);
AssertHelpers.AlmostEqualList(samples, work, 1e-12);
}
示例2: VerifyIsReversibleComplex
private void VerifyIsReversibleComplex(
int count,
double maximumError,
Func<Complex[], Complex[]> forward,
Func<Complex[], Complex[]> inverse)
{
var samples = Sample.Random((u, v) => new Complex(u, v), _uniform, count);
var work = new Complex[samples.Length];
samples.CopyTo(work, 0);
work = forward(work);
Assert.IsFalse(work.AlmostEqualListWithError(samples, maximumError));
work = inverse(work);
AssertHelpers.AlmostEqualList(samples, work, maximumError);
}