97 instantiations of Complex
Microsoft.Gen.Logging.Generated.Tests (1)
LogPropertiesTests.cs (1)
101P11 = 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) }; 917roots[i] = new Complex(roots[i].Real, 0); 1064roots[i] = new Complex(roots[i].Magnitude, 0); 1066roots[i] = new Complex(-roots[i].Magnitude, 0); 1068roots[i] = new Complex(-roots[i].Magnitude, 0);
PolynomialUtils.cs (6)
32root1 = new Complex((-b + sqrtDelta) / 2, 0); 33root2 = new Complex((-b - sqrtDelta) / 2, 0); 37root1 = new Complex(-b / 2, sqrtDelta / 2); 38root2 = new Complex(-b / 2, -sqrtDelta / 2); 97roots[0] = new Complex(-coefficients[i], 0); 127roots[j] = new Complex(realPart[j], imaginaryPart[j]);
SeasonalityDetector.cs (2)
88var energies = fftRe.Select((m, i) => new Complex(m, fftIm[i])).ToArray(); 105var values = ifftRe.Select((t, i) => new Complex(t, ifftIm[i])).ToArray();
System.Runtime.Numerics (82)
System\Numerics\Complex.cs (82)
35public static readonly Complex Zero = new Complex(0.0, 0.0); 36public static readonly Complex One = new Complex(1.0, 0.0); 37public static readonly Complex ImaginaryOne = new Complex(0.0, 1.0); 38public static readonly Complex NaN = new Complex(double.NaN, double.NaN); 39public static readonly Complex Infinity = new Complex(double.PositiveInfinity, double.PositiveInfinity); 71return new Complex(magnitude * cos, magnitude * sin); 141return new Complex(-value.m_real, -value.m_imaginary); 146return new Complex(left.m_real + right.m_real, left.m_imaginary + right.m_imaginary); 151return new Complex(left.m_real + right, left.m_imaginary); 156return new Complex(left + right.m_real, right.m_imaginary); 161return new Complex(left.m_real - right.m_real, left.m_imaginary - right.m_imaginary); 166return new Complex(left.m_real - right, left.m_imaginary); 171return new Complex(left - right.m_real, -right.m_imaginary); 179return new Complex(result_realpart, result_imaginarypart); 188return new Complex(double.NaN, double.NaN); 191return new Complex(left.m_real * right, double.NaN); 196return new Complex(double.NaN, left.m_imaginary * right); 199return new Complex(left.m_real * right, left.m_imaginary * right); 208return new Complex(double.NaN, double.NaN); 211return new Complex(left * right.m_real, double.NaN); 216return new Complex(double.NaN, left * right.m_imaginary); 219return new Complex(left * right.m_real, left * right.m_imaginary); 234return new Complex((a + b * doc) / (c + d * doc), (b - a * doc) / (c + d * doc)); 239return new Complex((b + a * cod) / (d + c * cod), (-a + b * cod) / (d + c * cod)); 250return new Complex(double.NaN, double.NaN); 257return new Complex(double.NaN, double.NaN); 260return new Complex(left.m_real / right, double.NaN); 265return new Complex(double.NaN, left.m_imaginary / right); 269return new Complex(left.m_real / right, left.m_imaginary / right); 283return new Complex(a / (c + d * doc), (-a * doc) / (c + d * doc)); 288return new Complex(a * cod / (d + c * cod), -a / (d + c * cod)); 326return new Complex(value.m_real, -value.m_imaginary); 382return new Complex(sin * Math.Cosh(value.m_imaginary), cos * Math.Sinh(value.m_imaginary)); 392Complex sin = Sin(new Complex(-value.m_imaginary, value.m_real)); 393return new Complex(sin.m_imaginary, -sin.m_real); 414return new Complex(u, v); 420return new Complex(cos * Math.Cosh(value.m_imaginary), -sin * Math.Sinh(value.m_imaginary)); 426return Cos(new Complex(-value.m_imaginary, value.m_real)); 447return new Complex(u, v); 468return new Complex(sin / D, Math.Sinh(y2) / D); 473return new Complex(sin / cosh / D, Math.Tanh(y2) / D); 480Complex tan = Tan(new Complex(-value.m_imaginary, value.m_real)); 481return new Complex(tan.m_imaginary, -tan.m_real); 486Complex two = new Complex(2.0, 0.0); 616return new Complex(Math.Log(Abs(value)), Math.Atan2(value.m_imaginary, value.m_real)); 644return new Complex(double.PositiveInfinity, value.m_imaginary); 646return new Complex(double.NaN, double.NaN); 652return new Complex(double.NaN, double.PositiveInfinity); 656return new Complex(double.PositiveInfinity, double.NaN); 658return new Complex(double.NaN, double.NaN); 666return new Complex(0.0, Math.Sqrt(-value.m_real)); 669return new Complex(Math.Sqrt(value.m_real), 0.0); 707return (new Complex(double.PositiveInfinity, imaginaryCopy)); 735return new Complex(x, y); 766return Pow(value, new Complex(power, 0)); 773return new Complex(realResult, imaginaryResuilt); 782return new Complex((double)value, 0.0); 790return new Complex((double)value, 0.0); 795return new Complex((double)value, 0.0); 804return new Complex((double)value, 0.0); 813return new Complex(value, 0.0); 821return new Complex(value, 0.0); 826return new Complex(value, 0.0); 834return new Complex((double)value, 0.0); 842return new Complex((double)value, 0.0); 847return new Complex(value, 0.0); 852return new Complex(value, 0.0); 857return new Complex(value, 0.0); 865return new Complex(value, 0.0); 871return new Complex(value, 0.0); 876return new Complex(value, 0.0); 882return new Complex(value, 0.0); 888return new Complex(value, 0.0); 894return new Complex(value, 0.0); 903return new Complex(value, 0.0); 911static Complex IAdditiveIdentity<Complex, Complex>.AdditiveIdentity => new Complex(0.0, 0.0); 932static Complex IMultiplicativeIdentity<Complex, Complex>.MultiplicativeIdentity => new Complex(1.0, 0.0); 939static Complex INumberBase<Complex>.One => new Complex(1.0, 0.0); 945static Complex INumberBase<Complex>.Zero => new Complex(0.0, 0.0); 1464return new Complex(result_realpart, result_imaginarypart); 2207result = new Complex(real, imaginary); 2256static 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)
28public Complex P11 { get; set; }
Microsoft.ML.TimeSeries (24)
AdaptiveSingularSpectrumSequenceModeler.cs (10)
78public Complex[] RootsAfterStabilization; 83public Complex[] RootsBeforeStabilization; 861Complex[] roots = null; 881_info.RootsBeforeStabilization = new Complex[_windowSize - 1]; 971roots[sortedComponents[j].Index] = Complex.FromPolarCoordinates(avgMagnitude, 1012roots[ind1] = Complex.FromPolarCoordinates(1, 0); 1013roots[ind2] = Complex.FromPolarCoordinates(1, 0); 1023roots[ind] = Complex.FromPolarCoordinates(0.99, roots[ind].Phase); 1053roots[i] = Complex.FromPolarCoordinates(smallTrendMagnitude, roots[i].Phase); 1055roots[i] = Complex.FromPolarCoordinates(maxTrendMagnitude, roots[i].Phase);
PolynomialUtils.cs (10)
25internal static void FindQuadraticRoots(Double b, Double c, out Complex root1, out Complex root2) 69public static bool FindPolynomialRoots(Double[] coefficients, ref Complex[] roots, 82roots = new Complex[n]; 88roots[n - i - 1] = Complex.Zero; 279public static bool FindPolynomialCoefficients(Complex[] roots, ref Double[] coefficients) 285var hash = new Dictionary<Complex, FactorMultiplicity>(); 296if (roots[i].Equals(Complex.Zero)) // Zero roots 305var conj = Complex.Conjugate(roots[i]);
SeasonalityDetector.cs (4)
94var periodogram = energies.Select((t, i) => t * Complex.Conjugate(t)).ToArray(); 130private static int FindActualPeriod(Complex[] values, int bestFrequency, int secondFrequency, int timeSeriesLength, double randomnessThreshold) 212private static void FindBestTwoFrequencies(Complex[] values, int timeSeriesLength, out int bestFrequency, out int secondFrequency) 304private 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> 2192public static explicit operator BigInteger(Complex value) 4434else if (typeof(TOther) == typeof(Complex)) 4436Complex actualResult = (Complex)value; 4607else if (typeof(TOther) == typeof(Complex)) 4609Complex actualResult = (Complex)value; 4902else if (typeof(TOther) == typeof(Complex)) 4904Complex actualResult = (Complex)value;
System\Numerics\Complex.cs (241)
21: IEquatable<Complex>, 23INumberBase<Complex>, 24ISignedNumber<Complex>, 35public static readonly Complex Zero = new Complex(0.0, 0.0); 36public static readonly Complex One = new Complex(1.0, 0.0); 37public static readonly Complex ImaginaryOne = new Complex(0.0, 1.0); 38public static readonly Complex NaN = new Complex(double.NaN, double.NaN); 39public static readonly Complex Infinity = new Complex(double.PositiveInfinity, double.PositiveInfinity); 68public static Complex FromPolarCoordinates(double magnitude, double phase) 74public static Complex Negate(Complex value) 79public static Complex Add(Complex left, Complex right) 84public static Complex Add(Complex left, double right) 89public static Complex Add(double left, Complex right) 94public static Complex Subtract(Complex left, Complex right) 99public static Complex Subtract(Complex left, double right) 104public static Complex Subtract(double left, Complex right) 109public static Complex Multiply(Complex left, Complex right) 114public static Complex Multiply(Complex left, double right) 119public static Complex Multiply(double left, Complex right) 124public static Complex Divide(Complex dividend, Complex divisor) 129public static Complex Divide(Complex dividend, double divisor) 134public static Complex Divide(double dividend, Complex divisor) 139public static Complex operator -(Complex value) /* Unary negation of a complex number */ 144public static Complex operator +(Complex left, Complex right) 149public static Complex operator +(Complex left, double right) 154public static Complex operator +(double left, Complex right) 159public static Complex operator -(Complex left, Complex right) 164public static Complex operator -(Complex left, double right) 169public static Complex operator -(double left, Complex right) 174public static Complex operator *(Complex left, Complex right) 182public static Complex operator *(Complex left, double right) 202public static Complex operator *(double left, Complex right) 222public static Complex operator /(Complex left, Complex right) 243public static Complex operator /(Complex left, double right) 272public static Complex operator /(double left, Complex right) 292public static double Abs(Complex value) 323public static Complex Conjugate(Complex value) 329public static Complex Reciprocal(Complex value) 339public static bool operator ==(Complex left, Complex right) 344public static bool operator !=(Complex left, Complex right) 351return obj is Complex other && Equals(other); 354public bool Equals(Complex value) 379public static Complex Sin(Complex value) 389public static Complex Sinh(Complex value) 392Complex sin = Sin(new Complex(-value.m_imaginary, value.m_real)); 396public static Complex Asin(Complex value) 417public static Complex Cos(Complex value) 423public static Complex Cosh(Complex value) 429public static Complex Acos(Complex value) 450public static Complex Tan(Complex value) 477public static Complex Tanh(Complex value) 480Complex tan = Tan(new Complex(-value.m_imaginary, value.m_real)); 484public static Complex Atan(Complex value) 486Complex two = new Complex(2.0, 0.0); 608public static bool IsFinite(Complex value) => double.IsFinite(value.m_real) && double.IsFinite(value.m_imaginary); 610public static bool IsInfinity(Complex value) => double.IsInfinity(value.m_real) || double.IsInfinity(value.m_imaginary); 612public static bool IsNaN(Complex value) => !IsInfinity(value) && !IsFinite(value); 614public static Complex Log(Complex value) 619public static Complex Log(Complex value, double baseValue) 624public static Complex Log10(Complex value) 626Complex tempLog = Log(value); 630public static Complex Exp(Complex value) 636public static Complex Sqrt(Complex value) 738public static Complex Pow(Complex value, Complex power) 764public static Complex Pow(Complex value, double power) 769private static Complex Scale(Complex value, double factor) 780public static explicit operator Complex(decimal value) 788public static explicit operator Complex(Int128 value) 793public static explicit operator Complex(BigInteger value) 802public static explicit operator Complex(UInt128 value) 811public static implicit operator Complex(byte value) 819public static implicit operator Complex(char value) 824public static implicit operator Complex(double value) 832public static implicit operator Complex(Half value) 840public static implicit operator Complex(BFloat16 value) 845public static implicit operator Complex(short value) 850public static implicit operator Complex(int value) 855public static implicit operator Complex(long value) 863public static implicit operator Complex(nint value) 869public static implicit operator Complex(sbyte value) 874public static implicit operator Complex(float value) 880public static implicit operator Complex(ushort value) 886public static implicit operator Complex(uint value) 892public static implicit operator Complex(ulong value) 901public static implicit operator Complex(nuint value) 911static Complex IAdditiveIdentity<Complex, Complex>.AdditiveIdentity => new Complex(0.0, 0.0); 918public static Complex operator --(Complex value) => value - One; 925public static Complex operator ++(Complex value) => value + One; 932static Complex IMultiplicativeIdentity<Complex, Complex>.MultiplicativeIdentity => new Complex(1.0, 0.0); 939static Complex INumberBase<Complex>.One => new Complex(1.0, 0.0); 942static int INumberBase<Complex>.Radix => 2; 945static Complex INumberBase<Complex>.Zero => new Complex(0.0, 0.0); 948static Complex INumberBase<Complex>.Abs(Complex value) => Abs(value); 952public static Complex CreateChecked<TOther>(TOther value) 955Complex result; 957if (typeof(TOther) == typeof(Complex)) 959result = (Complex)(object)value; 971public static Complex CreateSaturating<TOther>(TOther value) 974Complex result; 976if (typeof(TOther) == typeof(Complex)) 978result = (Complex)(object)value; 990public static Complex CreateTruncating<TOther>(TOther value) 993Complex result; 995if (typeof(TOther) == typeof(Complex)) 997result = (Complex)(object)value; 1008static bool INumberBase<Complex>.IsCanonical(Complex value) => true; 1011public static bool IsComplexNumber(Complex value) => (value.m_real != 0.0) && (value.m_imaginary != 0.0); 1014public static bool IsEvenInteger(Complex value) => (value.m_imaginary == 0) && double.IsEvenInteger(value.m_real); 1017public static bool IsImaginaryNumber(Complex value) => (value.m_real == 0.0) && double.IsRealNumber(value.m_imaginary); 1020public static bool IsInteger(Complex value) => (value.m_imaginary == 0) && double.IsInteger(value.m_real); 1023public static bool IsNegative(Complex value) 1032public static bool IsNegativeInfinity(Complex value) 1041public static bool IsNormal(Complex value) 1051public static bool IsOddInteger(Complex value) => (value.m_imaginary == 0) && double.IsOddInteger(value.m_real); 1054public static bool IsPositive(Complex value) 1063public static bool IsPositiveInfinity(Complex value) 1072public static bool IsRealNumber(Complex value) => (value.m_imaginary == 0.0) && double.IsRealNumber(value.m_real); 1075public static bool IsSubnormal(Complex value) 1084static bool INumberBase<Complex>.IsZero(Complex value) => (value.m_real == 0.0) && (value.m_imaginary == 0.0); 1087public static Complex MaxMagnitude(Complex x, Complex y) 1177static Complex INumberBase<Complex>.MaxMagnitudeNumber(Complex x, Complex y) 1267public static Complex MinMagnitude(Complex x, Complex y) 1359static Complex INumberBase<Complex>.MinMagnitudeNumber(Complex x, Complex y) 1451static Complex INumberBase<Complex>.MultiplyAddEstimate(Complex left, Complex right, Complex addend) 1468public static Complex Parse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider) 1470if (!TryParse(s, style, provider, out Complex result)) 1478public static Complex Parse(ReadOnlySpan<byte> utf8Text, NumberStyles style, IFormatProvider? provider) 1480if (!TryParse(utf8Text, style, provider, out Complex result)) 1488public static Complex Parse(string s, NumberStyles style, IFormatProvider? provider) 1496static bool INumberBase<Complex>.TryConvertFromChecked<TOther>(TOther value, out Complex result) 1503static bool INumberBase<Complex>.TryConvertFromSaturating<TOther>(TOther value, out Complex result) 1510static bool INumberBase<Complex>.TryConvertFromTruncating<TOther>(TOther value, out Complex result) 1515private static bool TryConvertFrom<TOther>(TOther value, out Complex result) 1536result = (Complex)actualValue; 1578result = (Complex)actualValue; 1620result = (Complex)actualValue; 1638static bool INumberBase<Complex>.TryConvertToChecked<TOther>(Complex value, [MaybeNullWhen(false)] out TOther result) 1843static bool INumberBase<Complex>.TryConvertToSaturating<TOther>(Complex value, [MaybeNullWhen(false)] out TOther result) 1993static bool INumberBase<Complex>.TryConvertToTruncating<TOther>(Complex value, [MaybeNullWhen(false)] out TOther result) 2134public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out Complex result) 2138public static bool TryParse(ReadOnlySpan<byte> utf8Text, NumberStyles style, IFormatProvider? provider, out Complex result) 2141private static bool TryParse<TChar>(ReadOnlySpan<TChar> text, NumberStyles style, IFormatProvider? provider, out Complex result) 2231public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out Complex result) 2246public static Complex Parse(string s, IFormatProvider? provider) => Parse(s, DefaultNumberStyle, provider); 2249public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out Complex result) => TryParse(s, DefaultNumberStyle, provider, out result); 2256static Complex ISignedNumber<Complex>.NegativeOne => new Complex(-1.0, 0.0); 2316public static Complex Parse(ReadOnlySpan<char> s, IFormatProvider? provider) => Parse(s, DefaultNumberStyle, provider); 2319public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out Complex result) => TryParse(s, DefaultNumberStyle, provider, out result); 2326public static Complex operator +(Complex value) => value; 2333public static Complex Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider) => Parse(utf8Text, DefaultNumberStyle, provider); 2336public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out Complex result) => TryParse(utf8Text, DefaultNumberStyle, provider, out result);