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