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
Complex
(0.0, 0.0);
36
public static readonly Complex One = new
Complex
(1.0, 0.0);
37
public static readonly Complex ImaginaryOne = new
Complex
(0.0, 1.0);
38
public static readonly Complex NaN = new
Complex
(double.NaN, double.NaN);
39
public static readonly Complex Infinity = new
Complex
(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);
414
return new
Complex
(u, v);
420
return new
Complex
(cos * Math.Cosh(value.m_imaginary), -sin * Math.Sinh(value.m_imaginary));
426
return Cos(new
Complex
(-value.m_imaginary, value.m_real));
447
return new
Complex
(u, v);
468
return new
Complex
(sin / D, Math.Sinh(y2) / D);
473
return new
Complex
(sin / cosh / D, Math.Tanh(y2) / D);
480
Complex tan = Tan(new
Complex
(-value.m_imaginary, value.m_real));
481
return new
Complex
(tan.m_imaginary, -tan.m_real);
486
Complex two = new
Complex
(2.0, 0.0);
616
return new
Complex
(Math.Log(Abs(value)), Math.Atan2(value.m_imaginary, value.m_real));
644
return new
Complex
(double.PositiveInfinity, value.m_imaginary);
646
return new
Complex
(double.NaN, double.NaN);
652
return new
Complex
(double.NaN, double.PositiveInfinity);
656
return new
Complex
(double.PositiveInfinity, double.NaN);
658
return new
Complex
(double.NaN, double.NaN);
666
return new
Complex
(0.0, Math.Sqrt(-value.m_real));
669
return new
Complex
(Math.Sqrt(value.m_real), 0.0);
707
return (new
Complex
(double.PositiveInfinity, imaginaryCopy));
735
return new
Complex
(x, y);
766
return Pow(value, new
Complex
(power, 0));
773
return new
Complex
(realResult, imaginaryResuilt);
782
return new
Complex
((double)value, 0.0);
790
return new
Complex
((double)value, 0.0);
795
return new
Complex
((double)value, 0.0);
804
return new
Complex
((double)value, 0.0);
813
return new
Complex
(value, 0.0);
821
return new
Complex
(value, 0.0);
826
return new
Complex
(value, 0.0);
834
return new
Complex
((double)value, 0.0);
842
return new
Complex
((double)value, 0.0);
847
return new
Complex
(value, 0.0);
852
return new
Complex
(value, 0.0);
857
return new
Complex
(value, 0.0);
865
return new
Complex
(value, 0.0);
871
return new
Complex
(value, 0.0);
876
return new
Complex
(value, 0.0);
882
return new
Complex
(value, 0.0);
888
return new
Complex
(value, 0.0);
894
return new
Complex
(value, 0.0);
903
return new
Complex
(value, 0.0);
911
static Complex IAdditiveIdentity<Complex, Complex>.AdditiveIdentity => new
Complex
(0.0, 0.0);
932
static Complex IMultiplicativeIdentity<Complex, Complex>.MultiplicativeIdentity => new
Complex
(1.0, 0.0);
939
static Complex INumberBase<Complex>.One => new
Complex
(1.0, 0.0);
945
static Complex INumberBase<Complex>.Zero => new
Complex
(0.0, 0.0);
1464
return new
Complex
(result_realpart, result_imaginarypart);
2207
result = new
Complex
(real, imaginary);
2256
static Complex ISignedNumber<Complex>.NegativeOne => new
Complex
(-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)
2189
/// <summary>Explicitly converts a <see cref="
Complex
" /> value to a big integer.</summary>
2192
public static explicit operator BigInteger(
Complex
value)
4434
else if (typeof(TOther) == typeof(
Complex
))
4436
Complex
actualResult = (
Complex
)value;
4607
else if (typeof(TOther) == typeof(
Complex
))
4609
Complex
actualResult = (
Complex
)value;
4902
else if (typeof(TOther) == typeof(
Complex
))
4904
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 Complex(0.0, 0.0);
36
public static readonly
Complex
One = new Complex(1.0, 0.0);
37
public static readonly
Complex
ImaginaryOne = new Complex(0.0, 1.0);
38
public static readonly
Complex
NaN = new Complex(double.NaN, double.NaN);
39
public static readonly
Complex
Infinity = new Complex(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)
417
public static
Complex
Cos(
Complex
value)
423
public static
Complex
Cosh(
Complex
value)
429
public static
Complex
Acos(
Complex
value)
450
public static
Complex
Tan(
Complex
value)
477
public static
Complex
Tanh(
Complex
value)
480
Complex
tan = Tan(new Complex(-value.m_imaginary, value.m_real));
484
public static
Complex
Atan(
Complex
value)
486
Complex
two = new Complex(2.0, 0.0);
608
public static bool IsFinite(
Complex
value) => double.IsFinite(value.m_real) && double.IsFinite(value.m_imaginary);
610
public static bool IsInfinity(
Complex
value) => double.IsInfinity(value.m_real) || double.IsInfinity(value.m_imaginary);
612
public static bool IsNaN(
Complex
value) => !IsInfinity(value) && !IsFinite(value);
614
public static
Complex
Log(
Complex
value)
619
public static
Complex
Log(
Complex
value, double baseValue)
624
public static
Complex
Log10(
Complex
value)
626
Complex
tempLog = Log(value);
630
public static
Complex
Exp(
Complex
value)
636
public static
Complex
Sqrt(
Complex
value)
738
public static
Complex
Pow(
Complex
value,
Complex
power)
764
public static
Complex
Pow(
Complex
value, double power)
769
private static
Complex
Scale(
Complex
value, double factor)
780
public static explicit operator
Complex
(decimal value)
788
public static explicit operator
Complex
(Int128 value)
793
public static explicit operator
Complex
(BigInteger value)
802
public static explicit operator
Complex
(UInt128 value)
811
public static implicit operator
Complex
(byte value)
819
public static implicit operator
Complex
(char value)
824
public static implicit operator
Complex
(double value)
832
public static implicit operator
Complex
(Half value)
840
public static implicit operator
Complex
(BFloat16 value)
845
public static implicit operator
Complex
(short value)
850
public static implicit operator
Complex
(int value)
855
public static implicit operator
Complex
(long value)
863
public static implicit operator
Complex
(nint value)
869
public static implicit operator
Complex
(sbyte value)
874
public static implicit operator
Complex
(float value)
880
public static implicit operator
Complex
(ushort value)
886
public static implicit operator
Complex
(uint value)
892
public static implicit operator
Complex
(ulong value)
901
public static implicit operator
Complex
(nuint value)
911
static
Complex
IAdditiveIdentity<
Complex
,
Complex
>.AdditiveIdentity => new Complex(0.0, 0.0);
918
public static
Complex
operator --(
Complex
value) => value - One;
925
public static
Complex
operator ++(
Complex
value) => value + One;
932
static
Complex
IMultiplicativeIdentity<
Complex
,
Complex
>.MultiplicativeIdentity => new Complex(1.0, 0.0);
939
static
Complex
INumberBase<
Complex
>.One => new Complex(1.0, 0.0);
942
static int INumberBase<
Complex
>.Radix => 2;
945
static
Complex
INumberBase<
Complex
>.Zero => new Complex(0.0, 0.0);
948
static
Complex
INumberBase<
Complex
>.Abs(
Complex
value) => Abs(value);
952
public static
Complex
CreateChecked<TOther>(TOther value)
955
Complex
result;
957
if (typeof(TOther) == typeof(
Complex
))
959
result = (
Complex
)(object)value;
971
public static
Complex
CreateSaturating<TOther>(TOther value)
974
Complex
result;
976
if (typeof(TOther) == typeof(
Complex
))
978
result = (
Complex
)(object)value;
990
public static
Complex
CreateTruncating<TOther>(TOther value)
993
Complex
result;
995
if (typeof(TOther) == typeof(
Complex
))
997
result = (
Complex
)(object)value;
1008
static bool INumberBase<
Complex
>.IsCanonical(
Complex
value) => true;
1011
public static bool IsComplexNumber(
Complex
value) => (value.m_real != 0.0) && (value.m_imaginary != 0.0);
1014
public static bool IsEvenInteger(
Complex
value) => (value.m_imaginary == 0) && double.IsEvenInteger(value.m_real);
1017
public static bool IsImaginaryNumber(
Complex
value) => (value.m_real == 0.0) && double.IsRealNumber(value.m_imaginary);
1020
public static bool IsInteger(
Complex
value) => (value.m_imaginary == 0) && double.IsInteger(value.m_real);
1023
public static bool IsNegative(
Complex
value)
1032
public static bool IsNegativeInfinity(
Complex
value)
1041
public static bool IsNormal(
Complex
value)
1051
public static bool IsOddInteger(
Complex
value) => (value.m_imaginary == 0) && double.IsOddInteger(value.m_real);
1054
public static bool IsPositive(
Complex
value)
1063
public static bool IsPositiveInfinity(
Complex
value)
1072
public static bool IsRealNumber(
Complex
value) => (value.m_imaginary == 0.0) && double.IsRealNumber(value.m_real);
1075
public static bool IsSubnormal(
Complex
value)
1084
static bool INumberBase<
Complex
>.IsZero(
Complex
value) => (value.m_real == 0.0) && (value.m_imaginary == 0.0);
1087
public static
Complex
MaxMagnitude(
Complex
x,
Complex
y)
1177
static
Complex
INumberBase<
Complex
>.MaxMagnitudeNumber(
Complex
x,
Complex
y)
1267
public static
Complex
MinMagnitude(
Complex
x,
Complex
y)
1359
static
Complex
INumberBase<
Complex
>.MinMagnitudeNumber(
Complex
x,
Complex
y)
1451
static
Complex
INumberBase<
Complex
>.MultiplyAddEstimate(
Complex
left,
Complex
right,
Complex
addend)
1468
public static
Complex
Parse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider)
1470
if (!TryParse(s, style, provider, out
Complex
result))
1478
public static
Complex
Parse(ReadOnlySpan<byte> utf8Text, NumberStyles style, IFormatProvider? provider)
1480
if (!TryParse(utf8Text, style, provider, out
Complex
result))
1488
public static
Complex
Parse(string s, NumberStyles style, IFormatProvider? provider)
1496
static bool INumberBase<
Complex
>.TryConvertFromChecked<TOther>(TOther value, out
Complex
result)
1503
static bool INumberBase<
Complex
>.TryConvertFromSaturating<TOther>(TOther value, out
Complex
result)
1510
static bool INumberBase<
Complex
>.TryConvertFromTruncating<TOther>(TOther value, out
Complex
result)
1515
private static bool TryConvertFrom<TOther>(TOther value, out
Complex
result)
1536
result = (
Complex
)actualValue;
1578
result = (
Complex
)actualValue;
1620
result = (
Complex
)actualValue;
1638
static bool INumberBase<
Complex
>.TryConvertToChecked<TOther>(
Complex
value, [MaybeNullWhen(false)] out TOther result)
1843
static bool INumberBase<
Complex
>.TryConvertToSaturating<TOther>(
Complex
value, [MaybeNullWhen(false)] out TOther result)
1993
static bool INumberBase<
Complex
>.TryConvertToTruncating<TOther>(
Complex
value, [MaybeNullWhen(false)] out TOther result)
2134
public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out
Complex
result)
2138
public static bool TryParse(ReadOnlySpan<byte> utf8Text, NumberStyles style, IFormatProvider? provider, out
Complex
result)
2141
private static bool TryParse<TChar>(ReadOnlySpan<TChar> text, NumberStyles style, IFormatProvider? provider, out
Complex
result)
2231
public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out
Complex
result)
2246
public static
Complex
Parse(string s, IFormatProvider? provider) => Parse(s, DefaultNumberStyle, provider);
2249
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out
Complex
result) => TryParse(s, DefaultNumberStyle, provider, out result);
2256
static
Complex
ISignedNumber<
Complex
>.NegativeOne => new Complex(-1.0, 0.0);
2316
public static
Complex
Parse(ReadOnlySpan<char> s, IFormatProvider? provider) => Parse(s, DefaultNumberStyle, provider);
2319
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out
Complex
result) => TryParse(s, DefaultNumberStyle, provider, out result);
2326
public static
Complex
operator +(
Complex
value) => value;
2333
public static
Complex
Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider) => Parse(utf8Text, DefaultNumberStyle, provider);
2336
public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out
Complex
result) => TryParse(utf8Text, DefaultNumberStyle, provider, out result);