97 instantiations of Complex
Microsoft.Gen.Logging.Generated.Tests (1)
LogPropertiesTests.cs (1)
101
P11 = new
Complex
(1.2, 3.4),
Microsoft.ML.TimeSeries (14)
AdaptiveSingularSpectrumSequenceModeler.cs (6)
842
_info.RootsBeforeStabilization = new[] { new
Complex
(_alpha[0], 0) };
852
_info.RootsAfterStabilization = new[] { new
Complex
(_alpha[0], 0) };
917
roots[i] = new
Complex
(roots[i].Real, 0);
1064
roots[i] = new
Complex
(roots[i].Magnitude, 0);
1066
roots[i] = new
Complex
(-roots[i].Magnitude, 0);
1068
roots[i] = new
Complex
(-roots[i].Magnitude, 0);
PolynomialUtils.cs (6)
32
root1 = new
Complex
((-b + sqrtDelta) / 2, 0);
33
root2 = new
Complex
((-b - sqrtDelta) / 2, 0);
37
root1 = new
Complex
(-b / 2, sqrtDelta / 2);
38
root2 = new
Complex
(-b / 2, -sqrtDelta / 2);
97
roots[0] = new
Complex
(-coefficients[i], 0);
127
roots[j] = new
Complex
(realPart[j], imaginaryPart[j]);
SeasonalityDetector.cs (2)
88
var energies = fftRe.Select((m, i) => new
Complex
(m, fftIm[i])).ToArray();
105
var values = ifftRe.Select((t, i) => new
Complex
(t, ifftIm[i])).ToArray();
System.Runtime.Numerics (82)
System\Numerics\Complex.cs (82)
35
public static readonly Complex Zero =
new
(0.0, 0.0);
36
public static readonly Complex One =
new
(1.0, 0.0);
37
public static readonly Complex ImaginaryOne =
new
(0.0, 1.0);
38
public static readonly Complex NaN =
new
(double.NaN, double.NaN);
39
public static readonly Complex Infinity =
new
(double.PositiveInfinity, double.PositiveInfinity);
71
return new
Complex
(magnitude * cos, magnitude * sin);
141
return new
Complex
(-value.m_real, -value.m_imaginary);
146
return new
Complex
(left.m_real + right.m_real, left.m_imaginary + right.m_imaginary);
151
return new
Complex
(left.m_real + right, left.m_imaginary);
156
return new
Complex
(left + right.m_real, right.m_imaginary);
161
return new
Complex
(left.m_real - right.m_real, left.m_imaginary - right.m_imaginary);
166
return new
Complex
(left.m_real - right, left.m_imaginary);
171
return new
Complex
(left - right.m_real, -right.m_imaginary);
179
return new
Complex
(result_realpart, result_imaginarypart);
188
return new
Complex
(double.NaN, double.NaN);
191
return new
Complex
(left.m_real * right, double.NaN);
196
return new
Complex
(double.NaN, left.m_imaginary * right);
199
return new
Complex
(left.m_real * right, left.m_imaginary * right);
208
return new
Complex
(double.NaN, double.NaN);
211
return new
Complex
(left * right.m_real, double.NaN);
216
return new
Complex
(double.NaN, left * right.m_imaginary);
219
return new
Complex
(left * right.m_real, left * right.m_imaginary);
234
return new
Complex
((a + b * doc) / (c + d * doc), (b - a * doc) / (c + d * doc));
239
return new
Complex
((b + a * cod) / (d + c * cod), (-a + b * cod) / (d + c * cod));
250
return new
Complex
(double.NaN, double.NaN);
257
return new
Complex
(double.NaN, double.NaN);
260
return new
Complex
(left.m_real / right, double.NaN);
265
return new
Complex
(double.NaN, left.m_imaginary / right);
269
return new
Complex
(left.m_real / right, left.m_imaginary / right);
283
return new
Complex
(a / (c + d * doc), (-a * doc) / (c + d * doc));
288
return new
Complex
(a * cod / (d + c * cod), -a / (d + c * cod));
326
return new
Complex
(value.m_real, -value.m_imaginary);
382
return new
Complex
(sin * Math.Cosh(value.m_imaginary), cos * Math.Sinh(value.m_imaginary));
392
Complex sin = Sin(new
Complex
(-value.m_imaginary, value.m_real));
393
return new
Complex
(sin.m_imaginary, -sin.m_real);
413
return new
Complex
(u, v);
419
return new
Complex
(cos * Math.Cosh(value.m_imaginary), -sin * Math.Sinh(value.m_imaginary));
425
return Cos(new
Complex
(-value.m_imaginary, value.m_real));
445
return new
Complex
(u, v);
466
return new
Complex
(sin / D, Math.Sinh(y2) / D);
471
return new
Complex
(sin / cosh / D, Math.Tanh(y2) / D);
478
Complex tan = Tan(new
Complex
(-value.m_imaginary, value.m_real));
479
return new
Complex
(tan.m_imaginary, -tan.m_real);
484
Complex two =
new
(2.0, 0.0);
614
return new
Complex
(Math.Log(Abs(value)), Math.Atan2(value.m_imaginary, value.m_real));
642
return new
Complex
(double.PositiveInfinity, value.m_imaginary);
644
return new
Complex
(double.NaN, double.NaN);
650
return new
Complex
(double.NaN, double.PositiveInfinity);
654
return new
Complex
(double.PositiveInfinity, double.NaN);
656
return new
Complex
(double.NaN, double.NaN);
664
return new
Complex
(0.0, Math.Sqrt(-value.m_real));
667
return new
Complex
(Math.Sqrt(value.m_real), 0.0);
705
return (new
Complex
(double.PositiveInfinity, imaginaryCopy));
733
return new
Complex
(x, y);
764
return Pow(value, new
Complex
(power, 0));
771
return new
Complex
(realResult, imaginaryResuilt);
780
return new
Complex
((double)value, 0.0);
788
return new
Complex
((double)value, 0.0);
793
return new
Complex
((double)value, 0.0);
802
return new
Complex
((double)value, 0.0);
811
return new
Complex
(value, 0.0);
819
return new
Complex
(value, 0.0);
824
return new
Complex
(value, 0.0);
832
return new
Complex
((double)value, 0.0);
840
return new
Complex
((double)value, 0.0);
845
return new
Complex
(value, 0.0);
850
return new
Complex
(value, 0.0);
855
return new
Complex
(value, 0.0);
863
return new
Complex
(value, 0.0);
869
return new
Complex
(value, 0.0);
874
return new
Complex
(value, 0.0);
880
return new
Complex
(value, 0.0);
886
return new
Complex
(value, 0.0);
892
return new
Complex
(value, 0.0);
901
return new
Complex
(value, 0.0);
909
static Complex IAdditiveIdentity<Complex, Complex>.AdditiveIdentity =>
new
(0.0, 0.0);
930
static Complex IMultiplicativeIdentity<Complex, Complex>.MultiplicativeIdentity =>
new
(1.0, 0.0);
937
static Complex INumberBase<Complex>.One =>
new
(1.0, 0.0);
943
static Complex INumberBase<Complex>.Zero =>
new
(0.0, 0.0);
1462
return new
Complex
(result_realpart, result_imaginarypart);
2205
result = new
Complex
(real, imaginary);
2254
static Complex ISignedNumber<Complex>.NegativeOne =>
new
(-1.0, 0.0);
279 references to Complex
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\LogPropertiesSpecialTypesExtensions.cs (1)
28
public
Complex
P11 { get; set; }
Microsoft.ML.TimeSeries (24)
AdaptiveSingularSpectrumSequenceModeler.cs (10)
78
public
Complex
[] RootsAfterStabilization;
83
public
Complex
[] RootsBeforeStabilization;
861
Complex
[] roots = null;
881
_info.RootsBeforeStabilization = new
Complex
[_windowSize - 1];
971
roots[sortedComponents[j].Index] =
Complex
.FromPolarCoordinates(avgMagnitude,
1012
roots[ind1] =
Complex
.FromPolarCoordinates(1, 0);
1013
roots[ind2] =
Complex
.FromPolarCoordinates(1, 0);
1023
roots[ind] =
Complex
.FromPolarCoordinates(0.99, roots[ind].Phase);
1053
roots[i] =
Complex
.FromPolarCoordinates(smallTrendMagnitude, roots[i].Phase);
1055
roots[i] =
Complex
.FromPolarCoordinates(maxTrendMagnitude, roots[i].Phase);
PolynomialUtils.cs (10)
25
internal static void FindQuadraticRoots(Double b, Double c, out
Complex
root1, out
Complex
root2)
69
public static bool FindPolynomialRoots(Double[] coefficients, ref
Complex
[] roots,
82
roots = new
Complex
[n];
88
roots[n - i - 1] =
Complex
.Zero;
279
public static bool FindPolynomialCoefficients(
Complex
[] roots, ref Double[] coefficients)
285
var hash = new Dictionary<
Complex
, FactorMultiplicity>();
296
if (roots[i].Equals(
Complex
.Zero)) // Zero roots
305
var
conj =
Complex
.Conjugate(roots[i]);
SeasonalityDetector.cs (4)
94
var periodogram = energies.Select((t, i) => t *
Complex
.Conjugate(t)).ToArray();
130
private static int FindActualPeriod(
Complex
[] values, int bestFrequency, int secondFrequency, int timeSeriesLength, double randomnessThreshold)
212
private static void FindBestTwoFrequencies(
Complex
[] values, int timeSeriesLength, out int bestFrequency, out int secondFrequency)
304
private static int FindBestPeriod(
Complex
[] values, int frequency, int timeSeriesLength, out double energy)
netstandard (1)
netstandard.cs (1)
1332
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.
Complex
))]
System.Numerics (1)
System.Numerics.cs (1)
5
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.
Complex
))]
System.Runtime.Numerics (252)
System\Numerics\BigInteger.cs (11)
2307
/// <summary>Explicitly converts a <see cref="
Complex
" /> value to a big integer.</summary>
2310
public static explicit operator BigInteger(
Complex
value)
4302
else if (typeof(TOther) == typeof(
Complex
))
4304
Complex
actualResult = (
Complex
)value;
4475
else if (typeof(TOther) == typeof(
Complex
))
4477
Complex
actualResult = (
Complex
)value;
4783
else if (typeof(TOther) == typeof(
Complex
))
4785
Complex
actualResult = (
Complex
)value;
System\Numerics\Complex.cs (241)
21
: IEquatable<
Complex
>,
23
INumberBase<
Complex
>,
24
ISignedNumber<
Complex
>,
35
public static readonly
Complex
Zero = new(0.0, 0.0);
36
public static readonly
Complex
One = new(1.0, 0.0);
37
public static readonly
Complex
ImaginaryOne = new(0.0, 1.0);
38
public static readonly
Complex
NaN = new(double.NaN, double.NaN);
39
public static readonly
Complex
Infinity = new(double.PositiveInfinity, double.PositiveInfinity);
68
public static
Complex
FromPolarCoordinates(double magnitude, double phase)
74
public static
Complex
Negate(
Complex
value)
79
public static
Complex
Add(
Complex
left,
Complex
right)
84
public static
Complex
Add(
Complex
left, double right)
89
public static
Complex
Add(double left,
Complex
right)
94
public static
Complex
Subtract(
Complex
left,
Complex
right)
99
public static
Complex
Subtract(
Complex
left, double right)
104
public static
Complex
Subtract(double left,
Complex
right)
109
public static
Complex
Multiply(
Complex
left,
Complex
right)
114
public static
Complex
Multiply(
Complex
left, double right)
119
public static
Complex
Multiply(double left,
Complex
right)
124
public static
Complex
Divide(
Complex
dividend,
Complex
divisor)
129
public static
Complex
Divide(
Complex
dividend, double divisor)
134
public static
Complex
Divide(double dividend,
Complex
divisor)
139
public static
Complex
operator -(
Complex
value) /* Unary negation of a complex number */
144
public static
Complex
operator +(
Complex
left,
Complex
right)
149
public static
Complex
operator +(
Complex
left, double right)
154
public static
Complex
operator +(double left,
Complex
right)
159
public static
Complex
operator -(
Complex
left,
Complex
right)
164
public static
Complex
operator -(
Complex
left, double right)
169
public static
Complex
operator -(double left,
Complex
right)
174
public static
Complex
operator *(
Complex
left,
Complex
right)
182
public static
Complex
operator *(
Complex
left, double right)
202
public static
Complex
operator *(double left,
Complex
right)
222
public static
Complex
operator /(
Complex
left,
Complex
right)
243
public static
Complex
operator /(
Complex
left, double right)
272
public static
Complex
operator /(double left,
Complex
right)
292
public static double Abs(
Complex
value)
323
public static
Complex
Conjugate(
Complex
value)
329
public static
Complex
Reciprocal(
Complex
value)
339
public static bool operator ==(
Complex
left,
Complex
right)
344
public static bool operator !=(
Complex
left,
Complex
right)
351
return obj is
Complex
other && Equals(other);
354
public bool Equals(
Complex
value)
379
public static
Complex
Sin(
Complex
value)
389
public static
Complex
Sinh(
Complex
value)
392
Complex
sin = Sin(new Complex(-value.m_imaginary, value.m_real));
396
public static
Complex
Asin(
Complex
value)
416
public static
Complex
Cos(
Complex
value)
422
public static
Complex
Cosh(
Complex
value)
428
public static
Complex
Acos(
Complex
value)
448
public static
Complex
Tan(
Complex
value)
475
public static
Complex
Tanh(
Complex
value)
478
Complex
tan = Tan(new Complex(-value.m_imaginary, value.m_real));
482
public static
Complex
Atan(
Complex
value)
484
Complex
two = new(2.0, 0.0);
606
public static bool IsFinite(
Complex
value) => double.IsFinite(value.m_real) && double.IsFinite(value.m_imaginary);
608
public static bool IsInfinity(
Complex
value) => double.IsInfinity(value.m_real) || double.IsInfinity(value.m_imaginary);
610
public static bool IsNaN(
Complex
value) => !IsInfinity(value) && !IsFinite(value);
612
public static
Complex
Log(
Complex
value)
617
public static
Complex
Log(
Complex
value, double baseValue)
622
public static
Complex
Log10(
Complex
value)
624
Complex
tempLog = Log(value);
628
public static
Complex
Exp(
Complex
value)
634
public static
Complex
Sqrt(
Complex
value)
736
public static
Complex
Pow(
Complex
value,
Complex
power)
762
public static
Complex
Pow(
Complex
value, double power)
767
private static
Complex
Scale(
Complex
value, double factor)
778
public static explicit operator
Complex
(decimal value)
786
public static explicit operator
Complex
(Int128 value)
791
public static explicit operator
Complex
(BigInteger value)
800
public static explicit operator
Complex
(UInt128 value)
809
public static implicit operator
Complex
(byte value)
817
public static implicit operator
Complex
(char value)
822
public static implicit operator
Complex
(double value)
830
public static implicit operator
Complex
(Half value)
838
public static implicit operator
Complex
(BFloat16 value)
843
public static implicit operator
Complex
(short value)
848
public static implicit operator
Complex
(int value)
853
public static implicit operator
Complex
(long value)
861
public static implicit operator
Complex
(nint value)
867
public static implicit operator
Complex
(sbyte value)
872
public static implicit operator
Complex
(float value)
878
public static implicit operator
Complex
(ushort value)
884
public static implicit operator
Complex
(uint value)
890
public static implicit operator
Complex
(ulong value)
899
public static implicit operator
Complex
(nuint value)
909
static
Complex
IAdditiveIdentity<
Complex
,
Complex
>.AdditiveIdentity => new(0.0, 0.0);
916
public static
Complex
operator --(
Complex
value) => value - One;
923
public static
Complex
operator ++(
Complex
value) => value + One;
930
static
Complex
IMultiplicativeIdentity<
Complex
,
Complex
>.MultiplicativeIdentity => new(1.0, 0.0);
937
static
Complex
INumberBase<
Complex
>.One => new(1.0, 0.0);
940
static int INumberBase<
Complex
>.Radix => 2;
943
static
Complex
INumberBase<
Complex
>.Zero => new(0.0, 0.0);
946
static
Complex
INumberBase<
Complex
>.Abs(
Complex
value) => Abs(value);
950
public static
Complex
CreateChecked<TOther>(TOther value)
953
Complex
result;
955
if (typeof(TOther) == typeof(
Complex
))
957
result = (
Complex
)(object)value;
969
public static
Complex
CreateSaturating<TOther>(TOther value)
972
Complex
result;
974
if (typeof(TOther) == typeof(
Complex
))
976
result = (
Complex
)(object)value;
988
public static
Complex
CreateTruncating<TOther>(TOther value)
991
Complex
result;
993
if (typeof(TOther) == typeof(
Complex
))
995
result = (
Complex
)(object)value;
1006
static bool INumberBase<
Complex
>.IsCanonical(
Complex
value) => true;
1009
public static bool IsComplexNumber(
Complex
value) => (value.m_real != 0.0) && (value.m_imaginary != 0.0);
1012
public static bool IsEvenInteger(
Complex
value) => (value.m_imaginary == 0) && double.IsEvenInteger(value.m_real);
1015
public static bool IsImaginaryNumber(
Complex
value) => (value.m_real == 0.0) && double.IsRealNumber(value.m_imaginary);
1018
public static bool IsInteger(
Complex
value) => (value.m_imaginary == 0) && double.IsInteger(value.m_real);
1021
public static bool IsNegative(
Complex
value)
1030
public static bool IsNegativeInfinity(
Complex
value)
1039
public static bool IsNormal(
Complex
value)
1049
public static bool IsOddInteger(
Complex
value) => (value.m_imaginary == 0) && double.IsOddInteger(value.m_real);
1052
public static bool IsPositive(
Complex
value)
1061
public static bool IsPositiveInfinity(
Complex
value)
1070
public static bool IsRealNumber(
Complex
value) => (value.m_imaginary == 0.0) && double.IsRealNumber(value.m_real);
1073
public static bool IsSubnormal(
Complex
value)
1082
static bool INumberBase<
Complex
>.IsZero(
Complex
value) => (value.m_real == 0.0) && (value.m_imaginary == 0.0);
1085
public static
Complex
MaxMagnitude(
Complex
x,
Complex
y)
1175
static
Complex
INumberBase<
Complex
>.MaxMagnitudeNumber(
Complex
x,
Complex
y)
1265
public static
Complex
MinMagnitude(
Complex
x,
Complex
y)
1357
static
Complex
INumberBase<
Complex
>.MinMagnitudeNumber(
Complex
x,
Complex
y)
1449
static
Complex
INumberBase<
Complex
>.MultiplyAddEstimate(
Complex
left,
Complex
right,
Complex
addend)
1466
public static
Complex
Parse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider)
1468
if (!TryParse(s, style, provider, out
Complex
result))
1476
public static
Complex
Parse(ReadOnlySpan<byte> utf8Text, NumberStyles style, IFormatProvider? provider)
1478
if (!TryParse(utf8Text, style, provider, out
Complex
result))
1486
public static
Complex
Parse(string s, NumberStyles style, IFormatProvider? provider)
1494
static bool INumberBase<
Complex
>.TryConvertFromChecked<TOther>(TOther value, out
Complex
result)
1501
static bool INumberBase<
Complex
>.TryConvertFromSaturating<TOther>(TOther value, out
Complex
result)
1508
static bool INumberBase<
Complex
>.TryConvertFromTruncating<TOther>(TOther value, out
Complex
result)
1513
private static bool TryConvertFrom<TOther>(TOther value, out
Complex
result)
1534
result = (
Complex
)actualValue;
1576
result = (
Complex
)actualValue;
1618
result = (
Complex
)actualValue;
1636
static bool INumberBase<
Complex
>.TryConvertToChecked<TOther>(
Complex
value, [MaybeNullWhen(false)] out TOther result)
1841
static bool INumberBase<
Complex
>.TryConvertToSaturating<TOther>(
Complex
value, [MaybeNullWhen(false)] out TOther result)
1991
static bool INumberBase<
Complex
>.TryConvertToTruncating<TOther>(
Complex
value, [MaybeNullWhen(false)] out TOther result)
2132
public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out
Complex
result)
2136
public static bool TryParse(ReadOnlySpan<byte> utf8Text, NumberStyles style, IFormatProvider? provider, out
Complex
result)
2139
private static bool TryParse<TChar>(ReadOnlySpan<TChar> text, NumberStyles style, IFormatProvider? provider, out
Complex
result)
2229
public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out
Complex
result)
2244
public static
Complex
Parse(string s, IFormatProvider? provider) => Parse(s, DefaultNumberStyle, provider);
2247
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out
Complex
result) => TryParse(s, DefaultNumberStyle, provider, out result);
2254
static
Complex
ISignedNumber<
Complex
>.NegativeOne => new(-1.0, 0.0);
2314
public static
Complex
Parse(ReadOnlySpan<char> s, IFormatProvider? provider) => Parse(s, DefaultNumberStyle, provider);
2317
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out
Complex
result) => TryParse(s, DefaultNumberStyle, provider, out result);
2324
public static
Complex
operator +(
Complex
value) => value;
2331
public static
Complex
Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider) => Parse(utf8Text, DefaultNumberStyle, provider);
2334
public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out
Complex
result) => TryParse(utf8Text, DefaultNumberStyle, provider, out result);