96 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 (81)
System\Numerics\Complex.cs (81)
33
public static readonly Complex Zero = new
Complex
(0.0, 0.0);
34
public static readonly Complex One = new
Complex
(1.0, 0.0);
35
public static readonly Complex ImaginaryOne = new
Complex
(0.0, 1.0);
36
public static readonly Complex NaN = new
Complex
(double.NaN, double.NaN);
37
public static readonly Complex Infinity = new
Complex
(double.PositiveInfinity, double.PositiveInfinity);
69
return new
Complex
(magnitude * cos, magnitude * sin);
139
return new
Complex
(-value.m_real, -value.m_imaginary);
144
return new
Complex
(left.m_real + right.m_real, left.m_imaginary + right.m_imaginary);
149
return new
Complex
(left.m_real + right, left.m_imaginary);
154
return new
Complex
(left + right.m_real, right.m_imaginary);
159
return new
Complex
(left.m_real - right.m_real, left.m_imaginary - right.m_imaginary);
164
return new
Complex
(left.m_real - right, left.m_imaginary);
169
return new
Complex
(left - right.m_real, -right.m_imaginary);
177
return new
Complex
(result_realpart, result_imaginarypart);
186
return new
Complex
(double.NaN, double.NaN);
189
return new
Complex
(left.m_real * right, double.NaN);
194
return new
Complex
(double.NaN, left.m_imaginary * right);
197
return new
Complex
(left.m_real * right, left.m_imaginary * right);
206
return new
Complex
(double.NaN, double.NaN);
209
return new
Complex
(left * right.m_real, double.NaN);
214
return new
Complex
(double.NaN, left * right.m_imaginary);
217
return new
Complex
(left * right.m_real, left * right.m_imaginary);
232
return new
Complex
((a + b * doc) / (c + d * doc), (b - a * doc) / (c + d * doc));
237
return new
Complex
((b + a * cod) / (d + c * cod), (-a + b * cod) / (d + c * cod));
248
return new
Complex
(double.NaN, double.NaN);
255
return new
Complex
(double.NaN, double.NaN);
258
return new
Complex
(left.m_real / right, double.NaN);
263
return new
Complex
(double.NaN, left.m_imaginary / right);
267
return new
Complex
(left.m_real / right, left.m_imaginary / right);
281
return new
Complex
(a / (c + d * doc), (-a * doc) / (c + d * doc));
286
return new
Complex
(a * cod / (d + c * cod), -a / (d + c * cod));
324
return new
Complex
(value.m_real, -value.m_imaginary);
380
return new
Complex
(sin * Math.Cosh(value.m_imaginary), cos * Math.Sinh(value.m_imaginary));
390
Complex sin = Sin(new
Complex
(-value.m_imaginary, value.m_real));
391
return new
Complex
(sin.m_imaginary, -sin.m_real);
412
return new
Complex
(u, v);
418
return new
Complex
(cos * Math.Cosh(value.m_imaginary), -sin * Math.Sinh(value.m_imaginary));
424
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
Complex
(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);
837
return new
Complex
(value, 0.0);
842
return new
Complex
(value, 0.0);
847
return new
Complex
(value, 0.0);
855
return new
Complex
(value, 0.0);
861
return new
Complex
(value, 0.0);
866
return new
Complex
(value, 0.0);
872
return new
Complex
(value, 0.0);
878
return new
Complex
(value, 0.0);
884
return new
Complex
(value, 0.0);
893
return new
Complex
(value, 0.0);
901
static Complex IAdditiveIdentity<Complex, Complex>.AdditiveIdentity => new
Complex
(0.0, 0.0);
922
static Complex IMultiplicativeIdentity<Complex, Complex>.MultiplicativeIdentity => new
Complex
(1.0, 0.0);
929
static Complex INumberBase<Complex>.One => new
Complex
(1.0, 0.0);
935
static Complex INumberBase<Complex>.Zero => new
Complex
(0.0, 0.0);
1454
return new
Complex
(result_realpart, result_imaginarypart);
2144
result = new
Complex
(real, imaginary);
2193
static Complex ISignedNumber<Complex>.NegativeOne => new
Complex
(-1.0, 0.0);
272 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 (245)
System\Numerics\BigInteger.cs (11)
2121
/// <summary>Explicitly converts a <see cref="
Complex
" /> value to a big integer.</summary>
2124
public static explicit operator BigInteger(
Complex
value)
4569
else if (typeof(TOther) == typeof(
Complex
))
4571
Complex
actualResult = (
Complex
)value;
4736
else if (typeof(TOther) == typeof(
Complex
))
4738
Complex
actualResult = (
Complex
)value;
5025
else if (typeof(TOther) == typeof(
Complex
))
5027
Complex
actualResult = (
Complex
)value;
System\Numerics\Complex.cs (234)
19
: IEquatable<
Complex
>,
21
INumberBase<
Complex
>,
22
ISignedNumber<
Complex
>,
33
public static readonly
Complex
Zero = new Complex(0.0, 0.0);
34
public static readonly
Complex
One = new Complex(1.0, 0.0);
35
public static readonly
Complex
ImaginaryOne = new Complex(0.0, 1.0);
36
public static readonly
Complex
NaN = new Complex(double.NaN, double.NaN);
37
public static readonly
Complex
Infinity = new Complex(double.PositiveInfinity, double.PositiveInfinity);
66
public static
Complex
FromPolarCoordinates(double magnitude, double phase)
72
public static
Complex
Negate(
Complex
value)
77
public static
Complex
Add(
Complex
left,
Complex
right)
82
public static
Complex
Add(
Complex
left, double right)
87
public static
Complex
Add(double left,
Complex
right)
92
public static
Complex
Subtract(
Complex
left,
Complex
right)
97
public static
Complex
Subtract(
Complex
left, double right)
102
public static
Complex
Subtract(double left,
Complex
right)
107
public static
Complex
Multiply(
Complex
left,
Complex
right)
112
public static
Complex
Multiply(
Complex
left, double right)
117
public static
Complex
Multiply(double left,
Complex
right)
122
public static
Complex
Divide(
Complex
dividend,
Complex
divisor)
127
public static
Complex
Divide(
Complex
dividend, double divisor)
132
public static
Complex
Divide(double dividend,
Complex
divisor)
137
public static
Complex
operator -(
Complex
value) /* Unary negation of a complex number */
142
public static
Complex
operator +(
Complex
left,
Complex
right)
147
public static
Complex
operator +(
Complex
left, double right)
152
public static
Complex
operator +(double left,
Complex
right)
157
public static
Complex
operator -(
Complex
left,
Complex
right)
162
public static
Complex
operator -(
Complex
left, double right)
167
public static
Complex
operator -(double left,
Complex
right)
172
public static
Complex
operator *(
Complex
left,
Complex
right)
180
public static
Complex
operator *(
Complex
left, double right)
200
public static
Complex
operator *(double left,
Complex
right)
220
public static
Complex
operator /(
Complex
left,
Complex
right)
241
public static
Complex
operator /(
Complex
left, double right)
270
public static
Complex
operator /(double left,
Complex
right)
290
public static double Abs(
Complex
value)
321
public static
Complex
Conjugate(
Complex
value)
327
public static
Complex
Reciprocal(
Complex
value)
337
public static bool operator ==(
Complex
left,
Complex
right)
342
public static bool operator !=(
Complex
left,
Complex
right)
349
return obj is
Complex
other && Equals(other);
352
public bool Equals(
Complex
value)
377
public static
Complex
Sin(
Complex
value)
387
public static
Complex
Sinh(
Complex
value)
390
Complex
sin = Sin(new Complex(-value.m_imaginary, value.m_real));
394
public static
Complex
Asin(
Complex
value)
415
public static
Complex
Cos(
Complex
value)
421
public static
Complex
Cosh(
Complex
value)
427
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 Complex(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)
835
public static implicit operator
Complex
(short value)
840
public static implicit operator
Complex
(int value)
845
public static implicit operator
Complex
(long value)
853
public static implicit operator
Complex
(nint value)
859
public static implicit operator
Complex
(sbyte value)
864
public static implicit operator
Complex
(float value)
870
public static implicit operator
Complex
(ushort value)
876
public static implicit operator
Complex
(uint value)
882
public static implicit operator
Complex
(ulong value)
891
public static implicit operator
Complex
(nuint value)
901
static
Complex
IAdditiveIdentity<
Complex
,
Complex
>.AdditiveIdentity => new Complex(0.0, 0.0);
908
public static
Complex
operator --(
Complex
value) => value - One;
915
public static
Complex
operator ++(
Complex
value) => value + One;
922
static
Complex
IMultiplicativeIdentity<
Complex
,
Complex
>.MultiplicativeIdentity => new Complex(1.0, 0.0);
929
static
Complex
INumberBase<
Complex
>.One => new Complex(1.0, 0.0);
932
static int INumberBase<
Complex
>.Radix => 2;
935
static
Complex
INumberBase<
Complex
>.Zero => new Complex(0.0, 0.0);
938
static
Complex
INumberBase<
Complex
>.Abs(
Complex
value) => Abs(value);
942
public static
Complex
CreateChecked<TOther>(TOther value)
945
Complex
result;
947
if (typeof(TOther) == typeof(
Complex
))
949
result = (
Complex
)(object)value;
961
public static
Complex
CreateSaturating<TOther>(TOther value)
964
Complex
result;
966
if (typeof(TOther) == typeof(
Complex
))
968
result = (
Complex
)(object)value;
980
public static
Complex
CreateTruncating<TOther>(TOther value)
983
Complex
result;
985
if (typeof(TOther) == typeof(
Complex
))
987
result = (
Complex
)(object)value;
998
static bool INumberBase<
Complex
>.IsCanonical(
Complex
value) => true;
1001
public static bool IsComplexNumber(
Complex
value) => (value.m_real != 0.0) && (value.m_imaginary != 0.0);
1004
public static bool IsEvenInteger(
Complex
value) => (value.m_imaginary == 0) && double.IsEvenInteger(value.m_real);
1007
public static bool IsImaginaryNumber(
Complex
value) => (value.m_real == 0.0) && double.IsRealNumber(value.m_imaginary);
1010
public static bool IsInteger(
Complex
value) => (value.m_imaginary == 0) && double.IsInteger(value.m_real);
1013
public static bool IsNegative(
Complex
value)
1022
public static bool IsNegativeInfinity(
Complex
value)
1031
public static bool IsNormal(
Complex
value)
1041
public static bool IsOddInteger(
Complex
value) => (value.m_imaginary == 0) && double.IsOddInteger(value.m_real);
1044
public static bool IsPositive(
Complex
value)
1053
public static bool IsPositiveInfinity(
Complex
value)
1062
public static bool IsRealNumber(
Complex
value) => (value.m_imaginary == 0.0) && double.IsRealNumber(value.m_real);
1065
public static bool IsSubnormal(
Complex
value)
1074
static bool INumberBase<
Complex
>.IsZero(
Complex
value) => (value.m_real == 0.0) && (value.m_imaginary == 0.0);
1077
public static
Complex
MaxMagnitude(
Complex
x,
Complex
y)
1167
static
Complex
INumberBase<
Complex
>.MaxMagnitudeNumber(
Complex
x,
Complex
y)
1257
public static
Complex
MinMagnitude(
Complex
x,
Complex
y)
1349
static
Complex
INumberBase<
Complex
>.MinMagnitudeNumber(
Complex
x,
Complex
y)
1441
static
Complex
INumberBase<
Complex
>.MultiplyAddEstimate(
Complex
left,
Complex
right,
Complex
addend)
1458
public static
Complex
Parse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider)
1460
if (!TryParse(s, style, provider, out
Complex
result))
1468
public static
Complex
Parse(string s, NumberStyles style, IFormatProvider? provider)
1476
static bool INumberBase<
Complex
>.TryConvertFromChecked<TOther>(TOther value, out
Complex
result)
1483
static bool INumberBase<
Complex
>.TryConvertFromSaturating<TOther>(TOther value, out
Complex
result)
1490
static bool INumberBase<
Complex
>.TryConvertFromTruncating<TOther>(TOther value, out
Complex
result)
1495
private static bool TryConvertFrom<TOther>(TOther value, out
Complex
result)
1516
result = (
Complex
)actualValue;
1552
result = (
Complex
)actualValue;
1594
result = (
Complex
)actualValue;
1612
static bool INumberBase<
Complex
>.TryConvertToChecked<TOther>(
Complex
value, [MaybeNullWhen(false)] out TOther result)
1811
static bool INumberBase<
Complex
>.TryConvertToSaturating<TOther>(
Complex
value, [MaybeNullWhen(false)] out TOther result)
1955
static bool INumberBase<
Complex
>.TryConvertToTruncating<TOther>(
Complex
value, [MaybeNullWhen(false)] out TOther result)
2090
public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out
Complex
result)
2168
public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out
Complex
result)
2183
public static
Complex
Parse(string s, IFormatProvider? provider) => Parse(s, DefaultNumberStyle, provider);
2186
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out
Complex
result) => TryParse(s, DefaultNumberStyle, provider, out result);
2193
static
Complex
ISignedNumber<
Complex
>.NegativeOne => new Complex(-1.0, 0.0);
2254
public static
Complex
Parse(ReadOnlySpan<char> s, IFormatProvider? provider) => Parse(s, DefaultNumberStyle, provider);
2257
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out
Complex
result) => TryParse(s, DefaultNumberStyle, provider, out result);
2264
public static
Complex
operator +(
Complex
value) => value;