本文整理汇总了C#中Complex.Concat方法的典型用法代码示例。如果您正苦于以下问题:C# Complex.Concat方法的具体用法?C# Complex.Concat怎么用?C# Complex.Concat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Complex
的用法示例。
在下文中一共展示了Complex.Concat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Scalar
/// <summary>
/// Calculate function self-scalar values
/// </summary>
/// <param name="f">Input values</param>
/// <param name="ff">Output values</param>
public static void Scalar(Complex[] f, Complex[] ff)
{
var length = ff.Length;
var complex = f.Concat(Enumerable.Repeat(Complex.Zero, length - f.Length)).ToArray();
Fourier(complex, FourierDirection.Forward);
complex = complex.Select(x => x*Complex.Conjugate(x)/length).ToArray();
Fourier(complex, FourierDirection.Backward);
Array.Copy(complex, 0, ff, 0, length);
}
示例2: Convolution
/// <summary>
/// Calculate function self-convolution values
/// </summary>
/// <param name="f">Input values</param>
/// <param name="fxf">Output values</param>
public static void Convolution(Complex[] f, Complex[] fxf)
{
int length = fxf.Length;
Complex[] complex = f.Concat(Enumerable.Repeat(Complex.Zero, length - f.Length)).ToArray();
Fourier(complex, FourierDirection.Forward);
complex = complex.Select(x => x*x/length).ToArray();
Fourier(complex, FourierDirection.Backward);
Array.Copy(complex, 0, fxf, 0, length);
}