5 instantiations of Double
PresentationCore (4)
System\Windows\Media\Animation\Generated\DoubleAnimation.cs (4)
222Double from = new Double(); 223Double to = new Double(); 224Double accumulated = new Double(); 225Double foundation = new Double();
PresentationFramework (1)
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
4050DefaultConstructor = delegate () { return new System.Double(); },
3744 references to Double
AnalyzerRunner (2)
DiagnosticAnalyzerRunner.cs (2)
126var sumOfDocumentAverages = documentPerformance.Where(x => x.Key.ProjectId == projectId).Sum(x => x.Value.EditsPerSecond); 148if (!projectPerformance.TryGetValue(projectId, out var averageEditsInProject))
Aspire.Dashboard (9)
Components\Controls\Chart\ChartBase.cs (5)
360var targetCount = (percentile / 100.0) * totalCount; 396if (TryCalculatePoint(dimensions, start, end, exemplars, out var tickPointValue)) 409if (tickUpdate && TryCalculatePoint(dimensions, firstPointEndTime!.Value, inProgressDataTime, exemplars, out var inProgressPointValue)) 445var dimensionValue = 0d; 451var value = metric switch
Components\Dialogs\TextVisualizerDialog.razor.cs (1)
236else if (reader.TryGetDouble(out var doubleValue))
Model\Otlp\SpanWaterfallViewModel.cs (1)
137var rootDuration = span.Trace.Duration.TotalMilliseconds;
Otlp\Model\DurationFormatter.cs (1)
32var ticks = (double)duration.Ticks;
Otlp\Model\MetricValues\DimensionScope.cs (1)
132var exemplarValue = exemplar.HasAsDouble ? exemplar.AsDouble : exemplar.AsInt;
Aspire.Dashboard.Tests (1)
DurationFormatterTests.cs (1)
77var input = (double)TimeSpan.TicksPerMicrosecond / 10;
CodeGenerator (3)
HttpUtilities\HttpUtilitiesGeneratorHelpers.cs (3)
191var maskSizeInBIts = Math.Log(mask, 2); 192var hexMaskSize = Math.Ceiling(maskSizeInBIts / 4.0); 210var maskSizeInBIts = Math.Log(mask, 2);
dotnet-svcutil-lib (40)
FrameworkFork\Microsoft.CodeDom\Compiler\CodeGenerator.cs (3)
1782else if (e.Value is Double) 1784GenerateDoubleValue((Double)e.Value); 1818protected virtual void GenerateDoubleValue(Double d)
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (2)
1384else if (e.Value is Double) 1386GenerateDoubleValue((Double)e.Value);
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\XmlBinaryReader.cs (5)
1254public override Double ReadContentAsDouble() 1257Double value; 3295map[(int)BinXmlToken.SQL_FLOAT] = typeof(Double); 4303Double v = GetDouble(_tokDataPos); 4462private Double GetDouble(int offset)
FrameworkFork\Microsoft.Xml\Xml\schema\GenerateConverter.cs (2)
22public static Type[] InterfaceTypes = { typeof(Boolean), typeof(DateTime), typeof(Decimal), typeof(Double), typeof(Int32), typeof(Int64), typeof(Single), typeof(String), typeof(Object) }; 860if (type == typeof(Double)) return "double";
FrameworkFork\Microsoft.Xml\Xml\Serialization\PrimitiveXmlSerializers.cs (2)
86WriteElementStringRaw(@"double", @"", Microsoft.Xml.XmlConvert.ToString((System.Double)((System.Double)o)));
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (1)
3549Writer.Write(((Double)value).ToString("R", NumberFormatInfo.InvariantInfo));
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (16)
805public static string ToString(Double value) 807if (Double.IsNegativeInfinity(value)) return "-INF"; 808if (Double.IsPositiveInfinity(value)) return "INF"; 1173public static Double ToDouble(string s) 1176if (s == "-INF") return Double.NegativeInfinity; 1177if (s == "INF") return Double.PositiveInfinity; 1178double dVal = Double.Parse(s, NumberStyles.AllowLeadingSign | NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite, NumberFormatInfo.InvariantInfo); 1191result = Double.NegativeInfinity; 1196result = Double.PositiveInfinity; 1199else if (!Double.TryParse(s, NumberStyles.AllowLeadingSign | NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent, NumberFormatInfo.InvariantInfo, out result)) 1210internal static Double ToXPathDouble(Object o) 1219if (Double.TryParse(str, NumberStyles.AllowLeadingSign | NumberStyles.AllowDecimalPoint | NumberStyles.AllowTrailingWhite, NumberFormatInfo.InvariantInfo, out d)) 1224return Double.NaN; 1245return Double.NaN; 1269internal static Double XPathRound(Double value)
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\StringFunctions.cs (3)
170if (Double.IsNaN(num) || str1.Length <= num) 177if (Double.IsNaN(num1)) 205private Double StringLength(XPathNodeIterator nodeIterator)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\TypeCode.cs (1)
59else if (type == typeof(Double))
FrameworkFork\System.Runtime.Serialization\System\Xml\ValueHandle.cs (1)
347public Double ToDouble()
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseReader.cs (1)
1547public override Double ReadContentAsDouble()
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryReader.cs (1)
1578public override Double ReadContentAsDouble()
FrameworkFork\System.ServiceModel\Extensions\ReflectionExtensions.cs (1)
152if (type == typeof(Double))
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\PrimitiveOperationFormatter.cs (1)
763value = Array.Empty<Double>();
HeaderPropagationSample (1)
Startup.cs (1)
108var threshold = 0.80; // 20% chance for each feature in beta.
InMemory.FunctionalTests (1)
RequestTests.cs (1)
2337var mask = Math.Pow(2, lines.Length) - 1;
Microsoft.Analyzers.Local (2)
ApiLifecycle\Json\JsonValue.cs (2)
211var current = AsNumber; 235JsonValueType.String => double.TryParse((string?)_reference, NumberStyles.Float, CultureInfo.InvariantCulture, out var number)
Microsoft.AspNetCore.Components (4)
BindConverter.cs (4)
1025/// Attempts to convert a value to a <see cref="System.Double"/>. 1037/// Attempts to convert a value to a nullable <see cref="System.Double"/>. 1060if (!double.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted)) 1085if (!double.TryParse(text, NumberStyles.Number, culture ?? CultureInfo.CurrentCulture, out var converted))
Microsoft.AspNetCore.Components.Server (2)
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReaderExtensions.cs (2)
270/// Reads a <see cref="Double"/> as big endian. 272/// <returns>False if there wasn't enough data for a <see cref="Double"/>.</returns>
Microsoft.AspNetCore.Components.Tests (2)
EventCallbackFactoryBinderExtensionsTest.cs (2)
273var value = (double)17; 279var expectedValue = (double)42;
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
ContentEncodingNegotiator.cs (2)
54var selectedEncodingQuality = .0; 59var quality = encoding.Quality.GetValueOrDefault(1);
Microsoft.AspNetCore.ConcurrencyLimiter (1)
ConcurrencyLimiterEventSource.cs (1)
81var duration = _timer.Value.GetElapsedTime().TotalMilliseconds;
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (1)
src\Shared\EventSource.Testing\TestCounterListener.cs (1)
61var value = (double)(increment ?? mean);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (4)
Latency\ChecpointAcceptanceTests.cs (4)
37var exitPipelineValue = 0d; 38var responseProcessedValue = 0d; 72var exitPipelineValue = 0d; 73var responseProcessedValue = 0d;
Microsoft.AspNetCore.Hosting.Tests (1)
src\Shared\EventSource.Testing\TestCounterListener.cs (1)
61var value = (double)(increment ?? mean);
Microsoft.AspNetCore.HttpLogging.Tests (7)
W3CLoggerTests.cs (2)
43var delta = startDate.Subtract(now).TotalSeconds; 88var delta = startDate.Subtract(now).TotalSeconds;
W3CLoggingMiddlewareTests.cs (5)
97var delta = startDate.Subtract(now).TotalSeconds; 142var delta = startDate.Subtract(now).TotalSeconds; 262var delta = startDate.Subtract(now).TotalSeconds; 300var delta = startDate.Subtract(now).TotalSeconds; 305Assert.True(Double.TryParse(lines[3], NumberStyles.Number, CultureInfo.InvariantCulture, out num));
Microsoft.AspNetCore.Identity.FunctionalTests (3)
MapIdentityApiTests.cs (3)
118var expiresIn = loginContent.GetProperty("expiresIn").GetDouble(); 150var expiresIn = loginContent.GetProperty("expires_in").GetDouble(); 184var expiresIn = loginContent.GetProperty("expiresIn").GetDouble();
Microsoft.AspNetCore.Mvc.Core (1)
Formatters\MediaType.cs (1)
272var quality = 1.0d;
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (2)
BsonTempDataSerializerTest.cs (2)
180var value = 10d; 192var roundTripValue = (double)values[key];
Microsoft.AspNetCore.Mvc.TagHelpers (1)
InputTagHelper.cs (1)
47{ nameof(Double), InputType.Text.ToString().ToLowerInvariant() },
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
ViewExecutorTest.cs (1)
345var expectedWriteCallCount = Math.Ceiling((double)writeLength / TestHttpResponseStreamWriterFactory.DefaultBufferSize);
Microsoft.AspNetCore.OpenApi (1)
Schemas\OpenApiJsonSchema.Helpers.cs (1)
126if (reader.TryGetDouble(out var doubleValue))
Microsoft.AspNetCore.ResponseCompression (1)
ResponseCompressionProvider.cs (1)
99var quality = encoding.Quality.GetValueOrDefault(1);
Microsoft.AspNetCore.Routing (9)
Matching\NegotiationMatcherPolicy.cs (9)
96var bestQualitySoFar = 0.0; 97var bestEndpointQualitySoFar = 0.0; 155var quality = value.Quality ?? 1.0; 180var endpointQuality = GetMetadataQuality(candidates[currentIndex].Endpoint) ?? 1.0; 366var result = endpointsQuality[0]; 409var currentQuality = 0.0d; 418var valueQuality = value.Quality ?? 1.0; 445var currentServerQuality = GetQuality(currentSelectedValue); 446var newServerQuality = GetQuality(valueToken);
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Internal\Infrastructure\TimeoutControl.cs (2)
120var elapsedSeconds = (double)_readTimingElapsedTicks / _timeProvider.TimestampFrequency; 121var rate = _readTimingBytesRead / elapsedSeconds;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
HeartbeatTests.cs (1)
87var roundedActualMs = Math.Round(actualMs / 50.0) * 50.0;
Microsoft.AspNetCore.SignalR.Tests (1)
NativeAotTests.cs (1)
347await foreach (var item in source.ReadAllAsync())
Microsoft.Build (6)
BackEnd\Components\Scheduler\Scheduler.cs (1)
902if (!Double.TryParse(multiplier, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture.NumberFormat, out convertedMultiplier) || convertedMultiplier < 1)
ConversionUtilities.cs (2)
132return Double.Parse(number, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture.NumberFormat); 205return Double.TryParse(number, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture.NumberFormat, out value) && !double.IsInfinity(value);
Evaluation\Profiler\EvaluationLocationPrettyPrinterBase.cs (1)
42var percentage = (time.TotalMilliseconds / total.TotalMilliseconds) * 100;
Resources\Constants.cs (1)
346availableStaticMethods.TryAdd("System.Double", new Tuple<string, Type>(null, typeof(Double)));
Tracing.cs (1)
62if (!String.IsNullOrEmpty(val) && System.Double.TryParse(val, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture.NumberFormat, out seconds))
Microsoft.Build.Engine.UnitTests (1)
TickingStopwatch.cs (1)
25var elapsed = _elapsedSeconds;
Microsoft.Build.Tasks.Core (3)
ConversionUtilities.cs (2)
132return Double.Parse(number, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture.NumberFormat); 205return Double.TryParse(number, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture.NumberFormat, out value) && !double.IsInfinity(value);
Tracing.cs (1)
62if (!String.IsNullOrEmpty(val) && System.Double.TryParse(val, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture.NumberFormat, out seconds))
Microsoft.Build.Utilities.Core (1)
Tracing.cs (1)
62if (!String.IsNullOrEmpty(val) && System.Double.TryParse(val, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture.NumberFormat, out seconds))
Microsoft.Build.Utilities.UnitTests (2)
ConversionUtilities.cs (2)
132return Double.Parse(number, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture.NumberFormat); 205return Double.TryParse(number, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture.NumberFormat, out value) && !double.IsInfinity(value);
Microsoft.CodeAnalysis (5)
CommandLine\CommonCompiler.cs (1)
1417var descriptorsWithInfo = analyzerDriver.GetAllDiagnosticDescriptorsWithInfo(cancellationToken, out var totalAnalyzerExecutionTime);
CommandLine\ReportAnalyzerUtil.cs (4)
73var totalAnalyzerExecutionTime = analyzerDriver.AnalyzerExecutionTimes.Sum(kvp => kvp.Value.TotalSeconds); 86var executionTime = analyzerGroup.Sum(kvp => kvp.Value.TotalSeconds); 119var totalTime = driverTimingInfo.ElapsedTime.TotalSeconds; 133var executionTime = generatorGroup.Sum(x => x.ElapsedTime.TotalSeconds);
Microsoft.CodeAnalysis.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalyzerConfigOptionsExtensions.cs (1)
70&& double.TryParse(value, out var version)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
160var penalty = 1.0 - (1.0 / (lengthDifference + 1));
Microsoft.CodeAnalysis.CSharp (1)
Utilities\ValueSetFactory.FloatingValueSet.cs (1)
17/// A value set implementation for <see cref="System.Single"/> and <see cref="System.Double"/>.
Microsoft.CodeAnalysis.CSharp.Features (1)
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.cs (1)
35nameof(Double),
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (4)
EditAndContinue\SyntaxComparerTests.cs (4)
111var distance = SyntaxComparer.ComputeDistance(SyntaxFactory.Literal("abc", "abc"), SyntaxFactory.Literal("acb", "acb")); 118var distance = SyntaxComparer.ComputeDistance(MakeLiteral(101), MakeLiteral(150)); 125var distance = SyntaxComparer.ComputeDistance( 157var distance = SyntaxComparer.ComputeDistance(
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (13)
LexicalAndXml\LexicalTests.cs (13)
1752var value = 123.456; 1768var value = 123.45632434234234234234234234324234234234; 1784var value = 12332434234234234234234234324234234234.456; 1800var value = 12332434234234234234234234324234234234.45623423423423423423423423423423423423; 1987var value = .456; 2003var value = .456e10; 2083var value = 123d; 2099var value = 123D; 2115var value = 123.456d; 2131var value = 123.456e10d; 3397var value = .3; 3413var value = 3e1; 3429var value = 3e-1;
Microsoft.CodeAnalysis.EditorFeatures (15)
InlineDiagnostics\InlineDiagnosticsTag.cs (1)
83var lineHeight = Math.Floor(format.Typeface.FontFamily.LineSpacing * block.FontSize);
InlineHints\InlineHintsTag.cs (1)
174var dockPanelHeight = format.Typeface.FontFamily.Baseline * format.FontRenderingEmSize;
InlineRename\UI\Adornment\RenameFlyout.xaml.cs (6)
133var height = DesiredSize.Height; 134var width = DesiredSize.Width; 136var desiredTop = charBounds.TextBottom + 5; 137var desiredLeft = charBounds.Left; 139var top = (desiredTop + height) > _textView.ViewportBottom 143var left = (desiredLeft + width) > _textView.ViewportRight
IWpfTextViewExtensions.cs (2)
22var newHeight = view.LineHeight * view.TextBuffer.CurrentSnapshot.LineCount; 28var newWidth = view.MaxTextRightCoordinate;
StringIndentation\StringIndentationAdornmentManager.VisibleBlock.cs (5)
61var x = Math.Floor(bounds.Right - (anchorPointLine.VirtualSpaceWidth / 2)); 93var yTop = guideLineTopLine == null ? firstLine.Top : guideLineTopLine.Bottom; 94var yBottom = guideLineBottomLine == null ? lastLine.Bottom : guideLineBottomLine.Top; 126var currentSegmentTop = yTop; 127var currentSegmentBottom = 0.0;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (13)
Utilities\BloomFilterTests.cs (13)
51for (var d = 0.1; d >= 0.0001; d /= 10) 55var correctCount = 0.0; 56var incorrectCount = 0.0; 78var falsePositivePercentage = incorrectCount / (correctCount + incorrectCount); 86for (var d = 0.1; d >= 0.0001; d /= 10) 171for (var d = 0.1; d >= 0.0001; d /= 10) 175var correctCount = 0.0; 176var incorrectCount = 0.0; 198var falsePositivePercentage = incorrectCount / (correctCount + incorrectCount); 228for (var d = 0.1; d >= 0.0001; d /= 10) 267var correctCount = counts[0]; 268var incorrectCount = counts[1]; 269var falsePositivePercentage = incorrectCount / (correctCount + incorrectCount);
Microsoft.CodeAnalysis.Remote.ServiceHub (4)
Services\DiagnosticAnalyzer\PerformanceQueue.cs (4)
118var average = data.Average(); 119var stddev = Math.Sqrt(data.Select(ms => Math.Pow(ms - average, 2)).Average()); 120var squareLength = Math.Sqrt(data.Count); 154if (!_performanceMap.TryGetValue(assignedAnalyzerNumber, out var value))
Microsoft.CodeAnalysis.UnitTests (1)
CorLibTypesTests.cs (1)
109Assert.Throws<InvalidOperationException>(() => { var c = cvNull.DoubleValue; });
Microsoft.CodeAnalysis.Workspaces (9)
Differencing\Match.cs (2)
184var bestDistance = MaxDistance * 2; 239var distance = Comparer.GetDistance(node1, node2);
Log\StatisticResult.cs (1)
34var mean = (double)total / values.Count;
Shared\Utilities\BloomFilter.cs (4)
79var p = falsePositiveProbability; 82var numerator = n * Math.Log(p); 83var denominator = Math.Log(1.0 / Math.Pow(2.0, Math.Log(2.0))); 93var temp = Math.Log(2.0) * m / n;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalyzerConfigOptionsExtensions.cs (1)
70&& double.TryParse(value, out var version)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
160var penalty = 1.0 - (1.0 / (lengthDifference + 1));
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
ObjectSerializationTests.cs (6)
289TestRoundTripValue(Double.MaxValue); 424writer.WriteDouble(Double.MaxValue); 448Assert.Equal(Double.MaxValue, reader.ReadDouble()); 478writer.WriteScalarValue(Double.MaxValue); 516Assert.Equal(Double.MaxValue, (Double)reader.ReadScalarValue());
Microsoft.Data.Analysis (104)
DataFrameColumnCollection.cs (1)
342throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(Double)));
PrimitiveDataFrameColumn.BinaryOperationAPIs.ExplodedColumns.cs (90)
4041var convertedValue = (double)value; 4046var convertedValue = (double)value; 4051var convertedValue = (double)value; 4056var convertedValue = (double)value; 4061var convertedValue = (double)value; 4066var convertedValue = (double)value; 4071var convertedValue = (double)value; 4076var convertedValue = (double)value; 4081var convertedValue = (double)value; 4086var convertedValue = (double)value; 4131var convertedValue = (double)value; 4136var convertedValue = (double)value; 4141var convertedValue = (double)value; 4146var convertedValue = (double)value; 4151var convertedValue = (double)value; 4156var convertedValue = (double)value; 4161var convertedValue = (double)value; 4166var convertedValue = (double)value; 4171var convertedValue = (double)value; 4176var convertedValue = (double)value; 4181var convertedValue = (double)value; 4186var convertedValue = (double)value; 4191var convertedValue = (double)value; 4196var convertedValue = (double)value; 4201var convertedValue = (double)value; 4206var convertedValue = (double)value; 4211var convertedValue = (double)value; 4216var convertedValue = (double)value; 4221var convertedValue = (double)value; 4226var convertedValue = (double)value; 4231var convertedValue = (double)value; 4236var convertedValue = (double)value; 4241var convertedValue = (double)value; 4246var convertedValue = (double)value; 4251var convertedValue = (double)value; 4256var convertedValue = (double)value; 4261var convertedValue = (double)value; 4266var convertedValue = (double)value; 4271var convertedValue = (double)value; 4276var convertedValue = (double)value; 4281var convertedValue = (double)value; 4286var convertedValue = (double)value; 4291var convertedValue = (double)value; 4296var convertedValue = (double)value; 4301var convertedValue = (double)value; 4306var convertedValue = (double)value; 4311var convertedValue = (double)value; 4316var convertedValue = (double)value; 4321var convertedValue = (double)value; 4326var convertedValue = (double)value; 4331var convertedValue = (double)value; 4336var convertedValue = (double)value; 4341var convertedValue = (double)value; 4346var convertedValue = (double)value; 4351var convertedValue = (double)value; 4356var convertedValue = (double)value; 4361var convertedValue = (double)value; 4366var convertedValue = (double)value; 4371var convertedValue = (double)value; 4376var convertedValue = (double)value; 4381var convertedValue = (double)value; 4386var convertedValue = (double)value; 4391var convertedValue = (double)value; 4396var convertedValue = (double)value; 4401var convertedValue = (double)value; 4406var convertedValue = (double)value; 4411var convertedValue = (double)value; 4416var convertedValue = (double)value; 4421var convertedValue = (double)value; 4426var convertedValue = (double)value; 4431var convertedValue = (double)value; 4436var convertedValue = (double)value; 4441var convertedValue = (double)value; 4446var convertedValue = (double)value; 4451var convertedValue = (double)value; 4456var convertedValue = (double)value; 4461var convertedValue = (double)value; 4466var convertedValue = (double)value; 4471var convertedValue = (double)value; 4476var convertedValue = (double)value; 4481var convertedValue = (double)value; 4486var convertedValue = (double)value; 4491var convertedValue = (double)value; 4496var convertedValue = (double)value; 4501var convertedValue = (double)value; 4506var convertedValue = (double)value; 4511var convertedValue = (double)value; 4516var convertedValue = (double)value; 4521var convertedValue = (double)value; 4526var convertedValue = (double)value;
PrimitiveDataFrameColumnComputations.cs (13)
1734var ret = column.Buffers[0].ReadOnlySpan[0]; 1757var ret = double.MinValue; 1798var ret = column.Buffers[0].ReadOnlySpan[0]; 1821var ret = double.MaxValue; 1862var ret = (double)1; 1885var ret = default(double); 1926var ret = (double)0; 1949var ret = default(double); 1990var value = double.MinValue; 2013var value = double.MinValue; 2038var value = double.MaxValue; 2061var value = double.MaxValue; 2130var value = (double)0;
Microsoft.DotNet.Helix.Sdk (1)
AzureDevOpsTask.cs (1)
176var factor = RetryBackOffFactor;
Microsoft.Extensions.Caching.Hybrid.Tests (1)
TestEventListener.cs (1)
154var actual = AssertCounter(name, displayName);
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
Windows\WindowsContainerSnapshotProvider.cs (2)
96var cpuRequest = _cpuLimit; 235var timeTickDelta = (now.Ticks - _oldCpuTimeTicks) * _cpuLimit;
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (25)
Linux\AcceptanceTest.cs (23)
212var cpuFromGauge = 0.0d; 213var cpuLimitFromGauge = 0.0d; 214var cpuRequestFromGauge = 0.0d; 215var memoryFromGauge = 0.0d; 216var memoryLimitFromGauge = 0.0d; 295var cpuFromGauge = 0.0d; 296var cpuLimitFromGauge = 0.0d; 297var cpuRequestFromGauge = 0.0d; 298var memoryFromGauge = 0.0d; 299var memoryLimitFromGauge = 0.0d; 349var roundedCpuUsedPercentage = Math.Round(utilization.CpuUsedPercentage, 1); 383var cpuFromGauge = 0.0d; 384var cpuLimitFromGauge = 0.0d; 385var cpuRequestFromGauge = 0.0d; 386var memoryFromGauge = 0.0d; 387var memoryLimitFromGauge = 0.0d; 430var roundedCpuUsedPercentage = Math.Round(utilization.CpuUsedPercentage, 1); 459var cpuFromGauge = 0.0d; 460var cpuLimitFromGauge = 0.0d; 461var cpuRequestFromGauge = 0.0d; 462var memoryFromGauge = 0.0d; 463var memoryLimitFromGauge = 0.0d; 510var roundedCpuUsedPercentage = Math.Round(utilization.CpuUsedPercentage, 1);
Linux\LinuxUtilizationParserCgroupV2Tests.cs (2)
315var r = Math.Round(p.GetCgroupRequestCpuV2()); 534var r = Math.Round(p.GetCgroupRequestCpu());
Microsoft.Extensions.Diagnostics.Testing.Tests (1)
Metrics\MeasurementExtensionsTests.cs (1)
221var total = fullSnap.EvaluateAsCounter();
Microsoft.Extensions.Http.Diagnostics (1)
Latency\Internal\HttpClientLatencyLogEnricher.cs (1)
79var ms = ((double)latencyData.Checkpoints[i].Elapsed / latencyData.Checkpoints[i].Frequency) * 1000;
Microsoft.Extensions.Http.Resilience (4)
Routing\Internal\RoutingHelper.cs (4)
14var accumulatedProbability = 0d; 15var weightSum = 0d; 22var randomPercentageValue = randomizer.NextDouble(weightSum); 26var weight = weightProvider(endpoint);
Microsoft.Extensions.TimeProvider.Testing.Tests (1)
FakeTimeProviderTests.cs (1)
533var taskDelay = 0.5;
Microsoft.Maui (54)
Animations\Animation.cs (3)
194 var secondsSinceLastUpdate = millisecondsSinceLastUpdate / 1000.0; 212 var start = CurrentTime - StartDelay; 217 var percent = Math.Min(start / Duration, 1);
Animations\AnimationManager.cs (1)
84 var milliseconds = TimeSpan.FromMilliseconds(now - _lastUpdate).TotalMilliseconds;
Animations\Lerp.cs (2)
51 var start = Convert.ToDouble(s); 52 var end = Convert.ToDouble(e);
Layouts\AbsoluteLayoutManager.cs (9)
21 var availableWidth = widthConstraint - padding.HorizontalThickness; 22 var availableHeight = heightConstraint - padding.VerticalThickness; 41 var measureWidth = ResolveChildMeasureConstraint(bounds.Width, isWidthProportional, widthConstraint); 42 var measureHeight = ResolveChildMeasureConstraint(bounds.Height, isHeightProportional, heightConstraint); 46 var width = ResolveDimension(isWidthProportional, bounds.Width, availableWidth, measure.Width); 47 var height = ResolveDimension(isHeightProportional, bounds.Height, availableHeight, measure.Height); 53 var finalHeight = ResolveConstraints(heightConstraint, AbsoluteLayout.Height, measuredHeight, AbsoluteLayout.MinimumHeight, AbsoluteLayout.MaximumHeight); 54 var finalWidth = ResolveConstraints(widthConstraint, AbsoluteLayout.Width, measuredWidth, AbsoluteLayout.MinimumWidth, AbsoluteLayout.MaximumWidth); 114 var value = fromBounds;
Layouts\Flex.cs (2)
433 if (Double.IsNaN(Width) || Double.IsNaN(Height))
Layouts\FlexLayoutManager.cs (4)
47 var availableWidth = widthConstraint - padding.HorizontalThickness; 48 var availableHeight = heightConstraint - padding.VerticalThickness; 67 var finalHeight = LayoutManager.ResolveConstraints(heightConstraint, FlexLayout.Height, measuredHeight + padding.VerticalThickness, 70 var finalWidth = LayoutManager.ResolveConstraints(widthConstraint, FlexLayout.Width, measuredWidth + padding.HorizontalThickness,
Layouts\GridLayoutManager.cs (18)
26 var measuredWidth = _gridStructure.MeasuredGridWidth(); 27 var measuredHeight = _gridStructure.MeasuredGridHeight(); 305 var height = Dimension.IsExplicitSet(_explicitGridHeight) ? _explicitGridHeight : GridMinimumHeight(); 322 var width = Dimension.IsExplicitSet(_explicitGridWidth) ? _explicitGridWidth : GridMinimumWidth(); 665 var availableSpace = widthConstraint - GridWidth(); 687 var availableSpace = heightConstraint - GridHeight(); 726 var cellRequiredHeight = Math.Min(_gridHeightConstraint, _childrenToLayOut[cell.ViewIndex].DesiredSize.Height); 750 var cellRequiredWidth = Math.Min(_gridWidthConstraint, _childrenToLayOut[cell.ViewIndex].DesiredSize.Width); 785 var toAdd = (spaceNeeded - spaceAvailable) / starsInSpan; 847 var starSize = ComputeStarSizeForTarget(targetSize, definitions, spacing, starCount); 871 var maxSize = starSize * def.GridLength.Value; 879 var sum = SumDefinitions(defs, spacing, true); 897 var availableSpace = targetSize - currentSize; 905 var maxCurrentSize = 0.0; 906 var maxCurrentStarSize = 0.0; 969 var scale = (fullTargetSize - definition.MinimumSize) / totaldiff; 970 var portion = scale * availableSpace; 1095 var starCount = 0.0;
Layouts\HorizontalStackLayoutManager.cs (3)
39 var finalHeight = ResolveConstraints(heightConstraint, Stack.Height, measuredHeight, Stack.MinimumHeight, Stack.MaximumHeight); 40 var finalWidth = ResolveConstraints(widthConstraint, Stack.Width, measuredWidth, Stack.MinimumWidth, Stack.MaximumWidth); 53 var height = bounds.Height - padding.VerticalThickness;
Layouts\LayoutExtensions.cs (8)
39 var consumedWidth = view.DesiredSize.Width; 50 var frameWidth = Math.Max(0, consumedWidth - margin.HorizontalThickness); 53 var consumedHeight = view.DesiredSize.Height; 64 var frameHeight = Math.Max(0, consumedHeight - margin.VerticalThickness); 66 var frameX = AlignHorizontal(view, bounds, margin); 67 var frameY = AlignVertical(view, bounds, margin); 75 var desiredWidth = view.DesiredSize.Width; 112 var desiredHeight = view.DesiredSize.Height;
Layouts\LayoutManager.cs (1)
21 var length = IsExplicitSet(explicitLength) ? explicitLength : measuredLength;
Layouts\VerticalStackLayoutManager.cs (2)
40 var finalHeight = ResolveConstraints(heightConstraint, Stack.Height, measuredHeight, Stack.MinimumHeight, Stack.MaximumHeight); 41 var finalWidth = ResolveConstraints(widthConstraint, Stack.Width, measuredWidth, Stack.MinimumWidth, Stack.MaximumWidth);
Primitives\SwipeDirection.cs (1)
25 var angle = GetAngleFromPoints(initialPoint.X, initialPoint.Y, endPoint.X, endPoint.Y);
Microsoft.Maui.Controls (59)
AdaptiveTrigger.cs (4)
94 var w = _window?.Width ?? -1; 95 var h = _window?.Height ?? -1; 100 var mw = MinWindowWidth; 101 var mh = MinWindowHeight;
AnimationExtensions.cs (1)
330 var tweenerValue = tweener.Value;
Brush\Brush.cs (2)
42 var radius = radialGradientPaint.Radius; 84 var radius = radialGradientBrush.Radius;
Brush\BrushTypeConverter.cs (1)
188 var hasAngle = TryParseAngle(direction, out var angle);
FontExtensions.cs (1)
31 var size = element.FontSize;
GridLengthTypeConverter.cs (1)
30 if (strValue.EndsWith("*", StringComparison.Ordinal) && double.TryParse(strValue.Substring(0, strValue.Length - 1), NumberStyles.Number, CultureInfo.InvariantCulture, out var length))
IndicatorView\IndicatorStackLayout.cs (1)
136 var indicatorSize = _indicatorView.IndicatorSize > 0 ? _indicatorView.IndicatorSize : 10;
Items\ItemsView.cs (2)
202 var maxWidth = Math.Min(scaled.Width, widthConstraint); 203 var maxHeight = Math.Min(scaled.Height, heightConstraint);
Layout\FlexExtensions.cs (2)
16 var widthConstraint = -1d; 17 var heightConstraint = -1d;
Layout\FlexLayout.cs (2)
448 var width = GetWidth(view); 450 var height = GetHeight(view);
LegacyLayouts\AbsoluteLayout.cs (2)
163 var width = 0.0; 164 var height = 0.0;
LegacyLayouts\ConstraintTypeConverter.cs (1)
22 if (strValue != null && double.TryParse(strValue, NumberStyles.Number, CultureInfo.InvariantCulture, out var size))
LegacyLayouts\FlexLayout.cs (2)
336 var width = (double)view.GetValue(WidthRequestProperty); 338 var height = (double)view.GetValue(HeightRequestProperty);
LegacyLayouts\GridCalc.cs (14)
114 var columnSpacing = grid.ColumnSpacing; 115 var rowSpacing = grid.RowSpacing; 292 var columnWidthSum = ComputeColumnWidthSum(); 293 var rowHeightSum = ComputeRowHeightSum(); 413 var delta = contractionFactor >= 1 475 var delta = contractionFactor >= 1 568 var unassignedHeight = GetUnassignedHeight(height, grid.RowSpacing); 571 var acw = GetAssignedColumnWidth(child); 673 var hConstraint = assignedHeight > 0 ? assignedHeight : heightConstraint; 676 var columnSpacing = (GetColumnSpan(child) - 1) * grid.ColumnSpacing; 734 var wConstraint = assignedWidth > 0 ? assignedWidth : widthConstraint; 737 var rowSpacing = (GetRowSpan(child) - 1) * grid.RowSpacing; 826 var actual = 0d; 837 var actual = 0d;
Region.cs (1)
41 var lineHeightTotal = startY;
Shapes\Ellipse.cs (2)
32 var width = WidthForPathComputation; 33 var height = HeightForPathComputation;
Shapes\Rectangle.cs (2)
51 var width = WidthForPathComputation; 52 var height = HeightForPathComputation;
Shapes\RoundRectangle.cs (2)
31 var width = Width; 41 var height = Height;
Shapes\Shape.cs (2)
450 var width = Width; 462 var height = Height;
SwipeView\SwipeView.cs (2)
349 var horizontalDelta = e.ScrollX - _previousScrollX; 350 var verticalDelta = e.ScrollY - _previousScrollY;
VisualElement\VisualElement.cs (8)
1822 var previousWidth = Width; 1823 var previousHeight = Height; 2085 var value = WidthRequest; 2108 var value = HeightRequest; 2131 var value = MinimumWidthRequest; 2148 var value = MinimumHeightRequest; 2160 var value = MaximumWidthRequest; 2172 var value = MaximumHeightRequest;
Window\Window.cs (2)
194 var coord = (double)GetValue(property); 204 var coord = (double)GetValue(property);
Xaml\TypeConversionExtensions.cs (2)
192 if (toType == typeof(Double)) 193 return Double.Parse(str, CultureInfo.InvariantCulture);
Microsoft.Maui.Controls.Build.Tasks (4)
CompiledConverters\CornerRadiusTypeConverter.cs (1)
41 foreach (var d in args)
CompiledConverters\GridLengthTypeConverter.cs (1)
32 if (value.EndsWith("*", StringComparison.OrdinalIgnoreCase) && double.TryParse(value.Substring(0, value.Length - 1), NumberStyles.Number, CultureInfo.InvariantCulture, out var length))
CompiledConverters\ThicknessTypeConverter.cs (1)
46 foreach (var d in args)
NodeILExtensions.cs (1)
255 yield return Instruction.Create(OpCodes.Ldc_R8, TryFormat(s => Double.Parse(str, CultureInfo.InvariantCulture), node, str));
Microsoft.Maui.Controls.DesignTools (2)
FontSizeDesignTypeConverter.cs (1)
20 if (double.TryParse(value?.ToString(), out var d))
GridLengthDesignTypeConverter.cs (1)
29 if (value.EndsWith("*", StringComparison.Ordinal) && double.TryParse(value.Substring(0, value.Length - 1), NumberStyles.Number, CultureInfo.InvariantCulture, out var len))
Microsoft.Maui.Controls.Foldable (12)
TwoPaneViewLayoutGuide.cs (12)
218 var pane2X = Hinge.X + Hinge.Width; 219 var containerRightX = locationOnScreen.X + locationOnScreen.Width; 220 var pane2Width = containerRightX - pane2X; 227 var pane2Y = Hinge.Y + Hinge.Height; 228 var containerBottomY = locationOnScreen.Y + locationOnScreen.Height; 229 var pane2Height = containerBottomY - pane2Y; 241 var containerRightX = locationOnScreen.X + locationOnScreen.Width; 242 var hingeRightX = Hinge.X + Hinge.Width; 252 var amountObscured = hingeRightX - locationOnScreen.X; 263 var containerBottomY = locationOnScreen.Y + locationOnScreen.Height; 264 var hingeBottomY = Hinge.Y + Hinge.Height; 274 var amountObscured = hingeBottomY - locationOnScreen.Y;
Microsoft.Maui.Controls.Xaml (2)
CreateValuesVisitor.cs (2)
367 if (nodeType == typeof(Double) && double.TryParse(valuestring, NumberStyles.Number, CultureInfo.InvariantCulture, out var doubleval))
Microsoft.Maui.Essentials (10)
Accelerometer\Accelerometer.shared.cs (4)
282 var x = acceleration.X * gravity; 283 var y = acceleration.Y * gravity; 284 var z = acceleration.Z * gravity; 286 var g = x * x + y * y + z * z;
UnitConverters\UnitConverters.shared.cs (6)
252 var dLat = DegreesToRadians(lat2 - lat1); 253 var dLon = DegreesToRadians(lon2 - lon1); 258 var dLat2 = Math.Sin(dLat / 2) * Math.Sin(dLat / 2); 259 var dLon2 = Math.Sin(dLon / 2) * Math.Sin(dLon / 2); 261 var a = dLat2 + dLon2 * Math.Cos(lat1) * Math.Cos(lat2); 262 var c = 2 * Math.Asin(Math.Sqrt(a));
Microsoft.Maui.Graphics (13)
ArcFlattener.cs (2)
67 var x2 = x + (Math.Cos(radians) * distance); 68 var y2 = y + (Math.Sin(radians) * distance);
CanvasExtensions.cs (6)
191 var x = center.X - radius; 192 var y = center.Y - radius; 193 var size = radius * 2; 218 var x = center.X - radius; 219 var y = center.Y - radius; 220 var size = radius * 2;
Color.cs (3)
267 var f = h * 6 - Math.Floor(h * 6); 269 var q = v * (1 - f * s); 270 var t = v * (1 - (1 - f) * s);
Point.cs (2)
136 if (xy.Length == 2 && double.TryParse(xy[0], NumberStyles.Number, CultureInfo.InvariantCulture, out var x) 137 && double.TryParse(xy[1], NumberStyles.Number, CultureInfo.InvariantCulture, out var y))
Microsoft.Maui.Graphics.Skia (1)
SkiaTextLayout.cs (1)
111 var maxLines = Math.Floor(height / _lineHeight);
Microsoft.Maui.Maps (6)
Primitives\Distance.cs (6)
57 var latitude1 = position1.Latitude.ToRadians(); 58 var longitude1 = position1.Longitude.ToRadians(); 60 var latitude2 = position2.Latitude.ToRadians(); 61 var longitude2 = position2.Longitude.ToRadians(); 63 var distance = Math.Sin((latitude2 - latitude1) / 2.0); 66 var intermediate = Math.Sin((longitude2 - longitude1) / 2.0);
Microsoft.Maui.Resizetizer (6)
SkiaSharpTools.cs (6)
251 var sourceActualWidth = (double)originalSize.Width; 252 var sourceActualHeight = (double)originalSize.Height; 255 var nominalRatio = Math.Min( 260 var adjustRatio = nominalRatio * (double)resizeRatio; 263 var scaledWidth = sourceActualWidth * adjustRatio; 264 var scaledHeight = sourceActualHeight * adjustRatio;
Microsoft.ML.AutoML (84)
API\BinaryClassificationExperiment.cs (4)
400var metric = GetMetric(metricManager.Metric, res.Metrics); 402var loss = metricManager.IsMaximize ? -metric : metric; 426var metric = GetMetric(metricManager.Metric, metrics); 427var loss = metricManager.IsMaximize ? -metric : metric;
API\MulticlassClassificationExperiment.cs (4)
378var metric = GetMetric(metricManager.Metric, res.Metrics); 379var loss = metricManager.IsMaximize ? -metric : metric; 404var metric = GetMetric(metricManager.Metric, metrics); 405var loss = metricManager.IsMaximize ? -metric : metric;
API\RegressionExperiment.cs (4)
405var metric = GetMetric(metricManager.Metric, res.Metrics); 406var loss = metricManager.IsMaximize ? -metric : metric; 431var metric = GetMetric(metricManager.Metric, metrics); 432var loss = metricManager.IsMaximize ? -metric : metric;
AutoMLExperiment\AutoMLExperiment.cs (1)
287var loss = trialResult.Loss;
AutoMLExperiment\IDatasetManager.cs (1)
78var subSampleRatio = parameter.ContainsKey(_subSamplingKey) ? parameter[_subSamplingKey].AsType<double>() : 1;
AutoMLExperiment\IPerformanceMonitor.cs (3)
124var cpuUsedMs = elapseCpuProcessorTime.TotalMilliseconds; 125var cpuUsageInTotal = cpuUsedMs / (Environment.ProcessorCount * _checkIntervalInMilliseconds); 130var memoryUsage = process.WorkingSet64 * 1.0 / (1024 * 1024);
AutoMLExperiment\Runner\SweepablePipelineRunner.cs (4)
60var metric = metrics.Average(); 61var loss = _metricManager.IsMaximize ? -metric : metric; 77var metric = _metricManager.Evaluate(_mLContext, eval); 79var loss = _metricManager.IsMaximize ? -metric : metric;
ColumnInference\ColumnTypeInference.cs (1)
192col.HasHeader = !double.TryParse(headerStr, out var doubleVal);
ColumnInference\PurposeInference.cs (3)
148Double avgLength = 1.0 * sumLength / data.Count; 149Double cardinalityRatio = 1.0 * seen.Count / data.Count; 150Double avgSpaces = 1.0 * sumSpaces / data.Count;
ColumnInference\TextFileContents.cs (1)
40private const Double UniformColumnCountThreshold = 0.98;
ColumnInference\TextFileSample.cs (2)
26private const Double OversamplingRate = 1.1; 125Double averageLineLength = 2.0 * (firstChunk.Length - firstNewline) / (lineCount * 2 - 1);
Experiment\Runners\CrossValRunner.cs (1)
61var avgScore = CalcAverageScore(trainResults.Select(r => r.Score));
Experiment\Runners\CrossValSummaryRunner.cs (4)
83var avgScore = GetAverageOfNonNaNScores(trainResults.Select(x => x.score)); 212var smallestDistFromAvg = double.PositiveInfinity; 215var value = values.ElementAt(i); 218var distFromAvg = Math.Abs(value - average);
Experiment\Runners\RunnerUtil.cs (1)
33var score = metricsAgent.GetScore(metrics);
Sweepers\ISweeper.cs (5)
35IParameterValue CreateFromNormalized(Double normalizedValue); 176internal sealed class RunResult : IRunResult<Double> 179private readonly Double? _metricValue; 193public RunResult(ParameterSet parameterSet, Double metricValue, bool isMetricMaximizing) 200public Double MetricValue
Sweepers\Parameters.cs (24)
24public Double? StepSize; 222public IParameterValue CreateFromNormalized(Double normalizedValue) 228var logBase = !_args.StepSize.HasValue 231var logMax = Math.Log(_args.Max, logBase); 232var logMin = Math.Log(_args.Min, logBase); 258var logBase = _args.StepSize ?? Math.Pow(1.0 * _args.Max / _args.Min, 1.0 / (_args.NumSteps - 1)); 261var maxPlusEpsilon = _args.Max * Math.Sqrt(logBase); 262for (Double value = _args.Min; value <= maxPlusEpsilon; value *= logBase) 272var stepSize = _args.StepSize ?? (Double)(_args.Max - _args.Min) / (_args.NumSteps - 1); 274var maxPlusEpsilon = _args.Max + stepSize / 2; 275for (Double value = _args.Min; value <= maxPlusEpsilon; value += stepSize) 348public IParameterValue CreateFromNormalized(Double normalizedValue) 354var logBase = !_args.StepSize.HasValue 357var logMax = Math.Log(_args.Max, logBase); 358var logMin = Math.Log(_args.Min, logBase); 376var logBase = _args.StepSize ?? Math.Pow(1.0 * _args.Max / _args.Min, 1.0 / (_args.NumSteps - 1)); 379var maxPlusEpsilon = _args.Max * Math.Sqrt(logBase); 380for (Double value = _args.Min; value <= maxPlusEpsilon; value *= logBase) 390var stepSize = _args.StepSize ?? (Double)(_args.Max - _args.Min) / (_args.NumSteps - 1); 392var maxPlusEpsilon = _args.Max + stepSize / 2; 393for (Double value = _args.Min; value <= maxPlusEpsilon; value += stepSize) 461public IParameterValue CreateFromNormalized(Double normalizedValue)
Tuner\CostFrugalTuner.cs (2)
78var loss = result.Loss; 86var cost = result.DurationInMilliseconds;
Tuner\PipelineProposer.cs (6)
114var randdouble = _rand.NextDouble(); 115var sum = 0.0; 136var loss = result.Loss; 137var duration = result.DurationInMilliseconds / 1000; 181var eci1 = Math.Max(_k1[schema], _k2[schema]); 182var estimatorCostForBreakThrough = (2 * (loss - _globalBestError) + double.Epsilon) / ((_e2[schema] - _e1[schema]) / (_k2[schema] + _k1[schema]) + double.Epsilon);
Tuner\SmacTuner.cs (6)
269var nextStep = features[d] + (1.0 / step); 283var mu = features[d]; 284var sigma = 0.2; 289var u1 = _rnd.NextDouble(); 290var u2 = _rnd.NextDouble(); 291var newFeatured = mu + sigma * Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2);
Utils\ArrayMath.cs (5)
122var sum = array.Sum(); 135var mean = sqaure.Average(); 136var rmse = Math.Sqrt(mean); 150var mape = ape.Average(); 163var mae = diff.Average();
Utils\BestResultUtil.cs (2)
125var minScore = double.PositiveInfinity; 140var maxScore = double.NegativeInfinity;
Microsoft.ML.AutoML.Samples (1)
Sweepable\ParameterExample.cs (1)
23var d = doubleParam.AsType<double>(); // d == 20
Microsoft.ML.AutoML.SourceGenerator (2)
SearchSpaceGenerator.cs (2)
97var minValue = searchSpaceNode["min"].GetValue<double>(); 98var maxValue = searchSpaceNode["max"].GetValue<double>();
Microsoft.ML.AutoML.Tests (25)
AutoMLExperimentTests.cs (1)
452var metric = 1.000 + 0.01 * settings.TrialId;
GetNextPipelineTests.cs (1)
42var score = context.BinaryClassification.EvaluateNonCalibrated(scoredData).Accuracy;
MetricsAgentsTests.cs (1)
213var score = metricsAgent.GetScore(metrics);
TunerTests.cs (22)
121var x = lseParam.X; 122var y = lseParam.Y; 123var z = lseParam.Z; 124var loss = -LSE3D(x, y, z); 140var lossFromNewCfo = -LSE3D(lseParameterFromNewCfo.X, lseParameterFromNewCfo.Y, lseParameterFromNewCfo.Z); 156var x = param.X; 157var y = param.Y; 158var z = param.Z; 179foreach (var loss in invalidLosses) 214foreach (var loss in zeroLosses.Concat(randomLosses)) 265var x = lseParam.X; 266var y = lseParam.Y; 267var z = lseParam.Z; 268var metric = LSE3D(x, y, z); 320var x = lseParam.X; 321var y = lseParam.Y; 322var z = lseParam.Z; 323var loss = LSE3D(x, y, z); 366var x = lseParam.X; 367var y = lseParam.Y; 368var z = lseParam.Z; 369var metric = F1(x, y, z);
Microsoft.ML.CodeGenerator.Tests (2)
UtilTest.cs (2)
36public Double DOUBLE { get; set; } 81public Double DOUBLE_col_5 { get; set; }
Microsoft.ML.Core (183)
Data\DataKind.cs (3)
57/// <summary>8-byte floating-point number, type of <see cref="System.Double"/>.</summary> 272return typeof(Double); 316else if (type == typeof(Double))
Data\IProgressChannel.cs (5)
68void Checkpoint(params Double?[] values); 130void SetProgress(int index, Double value); 136void SetProgress(int index, Double value, Double lim); 141void SetMetric(int index, Double value);
Data\ProgressReporter.cs (14)
89if (Double.IsNaN(lim.GetValueOrDefault())) 275public void Checkpoint(params Double?[] values) 505public readonly Double?[] Progress; 511public readonly Double?[] ProgressLim; 517public readonly Double?[] Metrics; 523public void SetProgress(int index, Double value) 534public void SetProgress(int index, Double value, Double lim) 539ProgressLim[index] = Double.IsNaN(lim) ? (Double?)null : lim; 545public void SetMetric(int index, Double value) 559Progress = new Double?[header.UnitNames.Count]; 560ProgressLim = new Double?[header.UnitNames.Count]; 561Metrics = new Double?[header.MetricNames.Count];
EntryPoints\ModuleArgs.cs (2)
128public Double SortOrder { get; set; } 619if (type == typeof(Single) || type == typeof(Double))
Utilities\BinFinder.cs (43)
15private Double[] _valuesDbl; // distinct values 106public Double[] FindBins(int cbin, IList<Double> values, int numZeroes = 0) 112return new[] { Double.PositiveInfinity }; 123_valuesDbl = new Double[numValues]; 155Double[] bounds; 159bounds = new Double[CountValues]; 168bounds = new Double[CountBins]; 173bounds[bounds.Length - 1] = Double.PositiveInfinity; 243public static Double GetSplitValue(Double a, Double b) 247if (Double.IsNegativeInfinity(a)) 249if (b == Double.MinValue) 250return Double.MinValue; 251a = Double.MinValue; 253if (Double.IsPositiveInfinity(b)) 255if (a == Double.MaxValue) 256return Double.PositiveInfinity; 257b = Double.MaxValue; 260var ave = a / 2 + b / 2; 530using EnergyType = System.Double; 559private EnergyType[] _energies; 560private EnergyType[] _energiesBest; 588_energiesBest = new EnergyType[sizeEnergy]; 589_energies = new EnergyType[sizeEnergy]; 601EnergyType bestWorst = EnergyType.MaxValue; 605EnergyType worst; 611Contracts.Assert(bestWorst < EnergyType.MaxValue); 623EnergyType eBest; 632eBest = EnergyType.MaxValue; 639var e = _energies[colPrev]; 655EnergyType worst; 665Contracts.Assert(bestWorst < EnergyType.MaxValue); 679eBest = EnergyType.MaxValue; 684var e = _energies[colPrev] + Square(total - _accum[height + colPrev]); 691Contracts.Assert(eBest < EnergyType.MaxValue); 714private static EnergyType Square(int d) 717return (EnergyType)d * d; 728private void GetEnergyBounds(int row, int col, EnergyType cur, out EnergyType best, out EnergyType worst)
Utilities\DoubleParser.cs (36)
101public static bool TryParse(ReadOnlySpan<char> span, out Double value, OptionFlags flags = OptionFlags.Default) 104Contracts.Assert(res != Result.Empty || ((flags & OptionFlags.EmptyAsNaN) == 0 && value == 0) || Double.IsNaN(value)); 160public static Result Parse(ReadOnlySpan<char> span, out Double value, OptionFlags flags = OptionFlags.Default) 170value = Double.NaN; 189value = Double.NaN; 197value = default(Double); 230Double res; 256Double tmp; 258tmp = (Double)(long)num; 261tmp = (Double)(long)((num >> 1) | (num & 1)); 301public static bool TryParse(ReadOnlySpan<char> span, out Double value, out int ichEnd, OptionFlags flags = OptionFlags.Default) 327value = (Double)(long)num; 330value = (Double)(long)((num >> 1) | (num & 1)); 340Contracts.Assert((long)(Double)(long)num == (long)num); 341value = (Double)(long)num * _mpe10Dbl[exp - 1]; 346value = Double.PositiveInfinity; 360Contracts.Assert((long)(Double)(long)num == (long)num); 361value = (Double)(long)num / _mpe10Dbl[-exp - 1]; 419value = (Double)(long)num; 425value = (Double)(long)(num >> 1); 434value = Double.PositiveInfinity; 442unsafe { value *= *(Double*)&mul; } 450unsafe { value *= *(Double*)&mul; } 484private static bool TryParseSpecial(ReadOnlySpan<char> span, ref int ich, out Double value) 925private static readonly Double[] _mpe10Dbl; 929private static readonly Double[] _mpne10Dbl; 938_mpe10Dbl = new Double[39]; 950Double dbl = (Double)(ulong)man; 954unsafe { dbl *= *(Double*)&mul; } 962_mpne10Dbl = new Double[65]; 966Double dbl = _mpne10Man[i]; 970unsafe { dbl *= *(Double*)&mul; } 974Double two64 = (Double)(1UL << 32) * (Double)(1UL << 32);
Utilities\FloatUtils.cs (1)
449var v = values[i];
Utilities\MathUtils.cs (44)
17public static float ToFloat(this Double dbl) 377public static Double TStatisticToPValue(Double t, Double df) 387Double result = IncompleteBeta(df / (df + t * t), df / 2, 0.5); 393private delegate Double Sequence(int i); 403private static Double Lentz(Sequence a, Sequence b, Double tol = 1e-15) 409Double f = Unclamp(b(0)); 410Double c = f; 411Double d = 0; 415Double bi = b(i); 416Double ai = a(i); 419Double ratio = c * d; 427private static Double Beta(Double a, Double b) 434private static Double IncompleteBeta(Double x, Double a, Double b) 462Double denom = ((a + i - 2) * (a + i - 1)); 471private static Double Unclamp(Double val) 473const Double bound = 1e-30; 735public static Double CosineSimilarity(ReadOnlySpan<float> a, ReadOnlySpan<float> b, int aIdx, int bIdx, int len) 737const Double epsilon = 1e-12f; 742Double ab = 0; 743Double a2 = 0; 744Double b2 = 0; 748ab += (Double)a[aIdx] * b[bIdx]; 749a2 += (Double)a[aIdx] * a[aIdx]; 750b2 += (Double)b[bIdx] * b[bIdx]; 753Double similarity = ab / (Math.Sqrt(a2 * b2) + epsilon); 764public static Double Entropy(Double prob, bool useLnNotLog2 = false) 767return Double.NaN; 779public static Double CrossEntropy(Double probTrue, Double probPredicted, bool useLnNotLog2 = false) 782return Double.NaN; 802Double soFar = 0; 826var res = Math.Sin(a); 836var res = Math.Cos(a);
Utilities\Stream.cs (1)
385foreach (var v in e)
Utilities\SupervisedBinFinder.cs (23)
140public Double[] FindBins(int maxBins, int minBinSize, int nLabels, IList<Double> values, IList<int> labels) 149var seenValues = new HashSet<Double>(); 150var valuePairs = new ValuePair<Double>[_valueCount]; 153valuePairs[i] = new ValuePair<Double>(values[i], labels[i]); 161var distinctValues = new Double[_distinctValueCount]; 162Double curValue = Double.NegativeInfinity; 191Double[] result = new Double[numUpperBounds]; 203result[numUpperBounds - 1] = Double.PositiveInfinity; 219private void AssertStrictlyIncreasing(Double[] result) 232public readonly Double Gain; 246Double totalEntropy = binFinder.GetEntropy(min, lim, out totalCount); 252Double logN = Math.Log(lim - min); 257var leftEntropy = binFinder.GetEntropy(min, split, out leftCount); 258var rightEntropy = binFinder.GetEntropy(split, lim, out rightCount); 263var delta = logN - binFinder._labelCardinality * (totalEntropy - leftEntropy - rightEntropy); 265var curGain = totalCount * totalEntropy // total cost of transmitting non-split content 281private Double GetEntropy(int min, int lim, out int totalCount) 283Double entropy = 0; 294var p = (Double)count / totalCount;
Utilities\Utils.cs (8)
230public static int FindIndexSorted(this Double[] input, Double value) 355public static int FindIndexSorted(this Double[] input, int min, int lim, Double value) 359Contracts.Assert(!Double.IsNaN(value)); 367Contracts.Assert(!Double.IsNaN(input[mid])); 656var previousValue = values[0]; 660var currentValue = values[i];
Utilities\VBufferUtils.cs (3)
34public static bool HasNaNs(in VBuffer<Double> buffer) 39if (Double.IsNaN(values[i])) 56public static bool HasNonFinite(in VBuffer<Double> buffer)
Microsoft.ML.Core.Tests (19)
UnitTests\CoreBaseTestClass.cs (7)
62private const Double DoubleEps = 1e-9; 63private static bool EqualWithEps(Double x, Double y) 114return GetComparerVec<Double>(r1, r2, col, size, (x, y) => FloatUtils.GetBits(x) == FloatUtils.GetBits(y)); 116return GetComparerVec<Double>(r1, r2, col, size, EqualWithEps); 157return GetComparerOne<Double>(r1, r2, col, (x, y) => FloatUtils.GetBits(x) == FloatUtils.GetBits(y)); 159return GetComparerOne<Double>(r1, r2, col, EqualWithEps);
UnitTests\TestEntryPoints.cs (2)
6881var ndcgGetter = cursor.GetGetter<VBuffer<Double>>(data.Schema["NDCG"]); 6882VBuffer<Double> ndcgBuffer = default;
UnitTests\TestLoss.cs (2)
40Double loss = lossFunc.Loss((float)output, (float)label); 50Double almostLoss = lossFunc.Loss(almostOutput, (float)label);
UnitTests\TestUtilities.cs (6)
92var x1Temp = x[1]; 93var x7Temp = x[7]; 107var x0Temp = x[0]; 277var x1Temp = x[1]; 283var x0Temp = x[0]; 289var xLengthTemp = x[x.Length - 1];
UnitTests\TestVBuffer.cs (2)
1022private static void TestSame(ref VBuffer<float> expected, ref VBuffer<float> actual, Double tol = 0) 1165private static void TestEquivalent(ref VBuffer<float> expected, ref VBuffer<float> actual, Double tol = 0)
Microsoft.ML.CpuMath (12)
EigenUtils.cs (5)
69Double g; 70Double h; 121Double scale = 0; 157Double f = d[l]; 196Double hh = f / (h + h);
ProbabilityFunctions.cs (7)
23if (Double.IsInfinity(x)) 24return Double.IsPositiveInfinity(x) ? 0 : 2.0; 44if (Double.IsInfinity(x)) 45return Double.IsPositiveInfinity(x) ? 1.0 : -1.0; 66return Double.NaN; 69return Double.PositiveInfinity; 72return Double.NegativeInfinity;
Microsoft.ML.Data (885)
Commands\CrossValidationCommand.cs (2)
488trainFilter.Min = (Double)fold / _numFolds; 489trainFilter.Max = (Double)(fold + 1) / _numFolds;
Commands\DataCommand.cs (2)
185averageMetric[nameOfMetric] = Double.NaN; 189averageMetric.Add(nameOfMetric, Double.NaN);
Data\Combiner.cs (4)
90internal sealed class R8Adder : Combiner<Double> 107public override bool IsDefault(Double value) { return value == 0; } 108public override void Combine(ref Double dst, Double src) { dst += src; }
Data\Conversion.cs (64)
25using R8 = Double; 123AddStd<I1, R8>(Convert); 133AddStd<I2, R8>(Convert); 143AddStd<I4, R8>(Convert); 153AddStd<I8, R8>(Convert); 164AddStd<U1, R8>(Convert); 175AddStd<U2, R8>(Convert); 186AddStd<U4, R8>(Convert); 197AddStd<U8, R8>(Convert); 212AddStd<R4, R8>(Convert); 216AddStd<R8, R4>(Convert); 217AddStd<R8, R8>(Convert); 218AddStd<R8, BL>(Convert); 219AddAux<R8, SB>(Convert); 220AddStd<R8, TX>(Convert); 232AddStd<TX, R8>(Convert); 245AddStd<BL, R8>(Convert); 252AddStd<TS, R8>(Convert); 258AddStd<DT, R8>(Convert); 265AddStd<DZ, R8>(Convert); 270AddIsNA<R8>(IsNA); 273AddGetNA<R8>(GetNA); 276AddHasNA<R8>(HasNA); 283AddIsDef<R8>(IsDefault); 310AddTryParse<R8>(TryParse); 767private bool IsNA(in R8 src) => R8.IsNaN(src); 772private bool HasNA(in VBuffer<R8> src) { var srcValues = src.GetValues(); for (int i = 0; i < srcValues.Length; i++) { if (R8.IsNaN(srcValues[i])) return true; } return false; } 781private bool IsDefault(in R8 src) => src == 0; 803private void GetNA(ref R8 value) => value = R8.NaN; 897public void Convert(in I1 src, ref R8 dst) => dst = (R8)src; 898public void Convert(in I2 src, ref R8 dst) => dst = (R8)src; 899public void Convert(in I4 src, ref R8 dst) => dst = (R8)src; 900public void Convert(in I8 src, ref R8 dst) => dst = (R8)src; 901public void Convert(in U1 src, ref R8 dst) => dst = src; 902public void Convert(in U2 src, ref R8 dst) => dst = src; 903public void Convert(in U4 src, ref R8 dst) => dst = src; 907public void Convert(in U8 src, ref R8 dst) => dst = src; 909public void Convert(in TS src, ref R8 dst) => dst = (R8)src.Ticks; 910public void Convert(in DT src, ref R8 dst) => dst = (R8)src.Ticks; 911public void Convert(in DZ src, ref R8 dst) => dst = (R8)src.UtcDateTime.Ticks; 925public void Convert(in R8 src, ref SB dst) { ClearDst(ref dst); if (R8.IsNaN(src)) dst.AppendFormat(CultureInfo.InvariantCulture, "{0}", "?"); else dst.AppendFormat(CultureInfo.InvariantCulture, "{0:G17}", src); } 950public void Convert(in R8 src, ref TX dst) => dst = src.ToString("G17", CultureInfo.InvariantCulture).AsMemory(); 958public void Convert(in R8 src, ref BL dst) => dst = System.Convert.ToBoolean(src); 972public void Convert(in R4 src, ref R8 dst) => dst = src; 976public void Convert(in R8 src, ref R4 dst) => dst = (R4)src; 977public void Convert(in R8 src, ref R8 dst) => dst = src; 1389public bool TryParse(in TX src, out R8 dst) 1394dst = R8.NaN; 1690public void Convert(in TX src, ref R8 value) 1696value = R8.NaN; 1727public void Convert(in BL src, ref R8 dst) => dst = System.Convert.ToDouble(src);
Data\DataViewTypeManager.cs (1)
30typeof(Int64), typeof(UInt64), typeof(Single), typeof(Double),
Data\RowCursorUtils.cs (3)
361var getSingleSrc = cursor.GetGetter<Double>(cursor.Schema[labelIndex]); 365Double src = Double.NaN;
DataLoadSave\Binary\BinaryLoader.cs (5)
50public Double PoolBlocks = _defaultShuffleBlocks; 698private readonly Double _shuffleBlocks; 704private const Double _defaultShuffleBlocks = 4; 958private static void SaveParameters(ModelSaveContext ctx, int threads, Double shuffleBlocks) 1171var poolSize = Math.Ceiling(_shuffleBlocks * _rowsPerBlock);
DataLoadSave\Binary\UnsafeTypeOps.cs (7)
42_type2ops[typeof(Double)] = new DoubleUnsafeTypeOps(); 160private sealed class DoubleUnsafeTypeOps : UnsafeTypeOps<Double> 162public override int Size { get { return sizeof(Double); } } 163public override unsafe void Apply(ReadOnlySpan<Double> array, Action<IntPtr> func) 165fixed (Double* pArray = &MemoryMarshal.GetReference(array)) 168public override void Write(Double a, BinaryWriter writer) { writer.Write(a); } 169public override Double Read(BinaryReader reader) { return reader.ReadDouble(); }
DataLoadSave\Text\TextLoaderParser.cs (2)
266IsReal = typeof(TResult) == typeof(Single) || typeof(TResult) == typeof(Double); 451IsReal = typeof(TItem) == typeof(Single) || typeof(TItem) == typeof(Double);
DataLoadSave\Text\TextSaver.cs (3)
261private const Double _sparseWeight = 2.5; 701Double bestScore = _sparseWeight * _slotLim; 707Double score = cd + _sparseWeight * cs;
Dirty\ILoss.cs (1)
17Double Loss(TOutput output, TLabel label);
Dirty\PredictorInterfaces.cs (1)
38ISchemaBindableMapper CreateMapper(Double[] quantiles);
Evaluators\AnomalyDetectionEvaluator.cs (29)
34public Double P = 0.01; 75private readonly Double _p; 133var auc = new List<Double>(); 134var drAtK = new List<Double>(); 135var drAtP = new List<Double>(); 136var drAtNumAnomalies = new List<Double>(); 232protected readonly Double P; 236protected CountersBase(int k, Double p) 251public Double GetMetrics(int k, Double p, out Double drAtP, out Double drAtNumPos, 257return drAtP = drAtNumPos = Double.NaN; 262drAtNumPos = sorted.Take((int)NumAnomalies).Count(result => result.Label > 0) / (Double)NumAnomalies; 269protected Double DetectionRate(IEnumerable<Info> sortedExamples, int maxFalsePositives, out Single threshold) 284return (Double)truePositives / NumAnomalies; 313public OnePassCounters(int k, Double p) 326var max = P * (NumUpdates - NumAnomalies); 371public TwoPassCounters(int k, Double p) 402var max = P * (NumUpdates - NumAnomalies); 427private readonly Double _p; 431public Double Auc; 433public Double DrAtK; 434public Double DrAtP; 435public Double DrAtNumAnomalies; 449public Aggregator(IHostEnvironment env, int reservoirSize, int topK, int k, Double p, bool streaming, int nameIndex, string stratName) 573Double unweighted; 628public Double P = 0.01; 647private readonly Double _p;
Evaluators\AucAggregator.cs (58)
31public abstract Double ComputeWeightedAuc(out Double unweighted); 106public override Double ComputeWeightedAuc(out Double unweighted) 120protected abstract Double ComputeWeightedAucCore(out double unweighted); 130protected override Double ComputeWeightedAucCore(out Double unweighted) 138var cumPosWeight = 0.0; 139var cumNegWeight = 0.0; 140var cumAuc = 0.0; 143var curScorePosWeight = 0.0; 144var posScore = 0.0; 163var curScoreNegWeight = 0.0; 164var score = posScore; 231protected override Double ComputeWeightedAucCore(out Double unweighted) 241var cumPosWeight = 0.0; 242var cumNegWeight = 0.0; 243var cumWeightedAuc = 0.0; 244var cumAuc = 0.0; 247var curScorePosWeight = 0.0; 249var posScore = 0.0; 274var curScoreNegWeight = 0.0; 276var score = posScore; 328unweighted = cumAuc / ((Double)cumPosCount * cumNegCount); 367public abstract Double ComputeWeightedAuPrc(out Double unweighted); 389public override Double ComputeWeightedAuPrc(out Double unweighted) 396protected abstract Double ComputeWeightedAuPrcCore(out Double unweighted); 416protected override Double ComputeWeightedAuPrcCore(out Double unweighted) 434var prevRecall = 0.0; 435var prevPrecisionMin = 1.0; 438var cumAuPrc = 0.0; 445var curRecall = (Double)truePos / posCount; 446var curPrecision = (Double)truePos / (truePos + falsePos); 455prevPrecisionMin = (Double)truePos / (truePos + falsePos); 490protected override Double ComputeWeightedAuPrcCore(out Double unweighted) 496Double posWeight = 0; 497Double negWeight = 0; 517var prevWeightedRecall = 0.0; 518var prevWeightedPrecisionMin = 1.0; 519var truePosWeight = 0.0; 520var falsePosWeight = 0.0; 521var cumWeightedAuPrc = 0.0; 522var prevRecall = 0.0; 523var prevPrecision = 1.0; 524var truePosCount = 0.0; 525var falsePosCount = 0.0; 534var curWeightedRecall = truePosWeight / posWeight; 535var curWeightedPrecision = truePosWeight / (truePosWeight + falsePosWeight); 536var curRecall = truePosCount / posCount; 537var curPrecision = truePosCount / (truePosCount + falsePosCount);
Evaluators\BinaryClassifierEvaluator.cs (64)
223var auc = new List<Double>(); 224var accuracy = new List<Double>(); 225var posPrec = new List<Double>(); 226var posRecall = new List<Double>(); 227var negPrec = new List<Double>(); 228var negRecall = new List<Double>(); 229var logLoss = new List<Double>(); 230var logLossRed = new List<Double>(); 231var entropy = new List<Double>(); 232var f1 = new List<Double>(); 233var auprc = new List<Double>(); 235var counts = new List<Double[]>(); 236var weights = new List<Double[]>(); 241var precision = new List<Double>(); 242var recall = new List<Double>(); 243var fpr = new List<Double>(); 244var weightedPrecision = new List<Double>(); 245var weightedRecall = new List<Double>(); 246var weightedFpr = new List<Double>(); 404public Double NumTruePos; 405public Double NumTrueNeg; 406public Double NumFalsePos; 407public Double NumFalseNeg; 408private Double _numLogLossPositives; 409private Double _numLogLossNegatives; 410private Double _logLoss; 412public Double Acc 420public Double RecallPos 428public Double PrecisionPos 436public Double RecallNeg 444public Double PrecisionNeg 452public Double Entropy 461public Double LogLoss 465return Double.IsNaN(_logLoss) ? Double.NaN : (_numLogLossPositives + _numLogLossNegatives > 0) 470public Double LogLossReduction 476var logLoss = _logLoss / (_numLogLossPositives + _numLogLossNegatives); 477var priorPos = _numLogLossPositives / (_numLogLossPositives + _numLogLossNegatives); 478var priorLogLoss = MathUtils.Entropy(priorPos); 483public Double F1 487var precisionPlusRecall = PrecisionPos + RecallPos; 500public void Update(Single score, Single prob, Single label, Double logloss, Single weight) 540public readonly List<Double> Precision; 541public readonly List<Double> Recall; 542public readonly List<Double> FalsePositiveRate; 543public readonly List<Double> WeightedPrecision; 544public readonly List<Double> WeightedRecall; 545public readonly List<Double> WeightedFalsePositiveRate; 607Precision = new List<Double>(); 608Recall = new List<Double>(); 609FalsePositiveRate = new List<Double>(); 613WeightedPrecision = new List<Double>(); 614WeightedRecall = new List<Double>(); 615WeightedFalsePositiveRate = new List<Double>(); 663Double logloss; 675logloss = Double.NaN; 742Double pos = 0; 743Double neg = 0; 744Double wpos = 0; 745Double wneg = 0; 1220ValueGetter<Double> loglossFn = 1221(ref Double dst) => 1231private Double GetLogLoss(Single prob, Single label) 1234return Double.NaN;
Evaluators\ClusteringEvaluator.cs (27)
165var nmi = new List<Double>(); 166var avgMinScores = new List<Double>(); 167var dbi = new List<Double>(); 227private Double _numInstances; 228private Double _sumMinScores; 231private readonly Double[] _numInstancesOfClstr; 233private readonly List<Double> _numInstancesOfClass; 235private readonly List<Double[]> _confusionMatrix; 239private readonly Double[] _distancesToCentroids; 244public Double Nmi 248Double nmi = Double.NaN; 252Double entropy = 0; 255var px = _numInstancesOfClass[i] / _numInstances; 261var pxy = _confusionMatrix[i][j] / _numInstances; 262var py = _numInstancesOfClstr[j] / _numInstances; 278public Double AvgMinScores { get { return _sumMinScores / _numInstances; } } 280public Double Dbi 285return Double.NaN; 287Double dbi = 0; 294Double maxi = 0; 306Double num = _distancesToCentroids[i] + _distancesToCentroids[j]; 324_numInstancesOfClstr = new Double[_numClusters]; 325_numInstancesOfClass = new List<Double>(); 326_confusionMatrix = new List<Double[]>(); 333_distancesToCentroids = new Double[_numClusters]; 355_confusionMatrix.Add(new Double[scores.Length]);
Evaluators\EvaluatorUtils.cs (14)
316Double metricVal = 0; 1132Double metricVal = 0; 1133VBuffer<Double> metricVals = default(VBuffer<Double>); 1327var avg = agg[iMetric].Sum / numFolds; 1467var confusionTable = new Double[numConfusionTableLabels][]; 1469confusionTable[i] = new Double[numConfusionTableLabels]; 1471precisionSums = new Double[numConfusionTableLabels]; 1472recallSums = new Double[numConfusionTableLabels]; 1546var avg = sumMetrics[i] / numFolds; 1635var numTruePos = confusionTable[0][0]; 1636var numFalseNeg = confusionTable[0][1]; 1637var numTrueNeg = confusionTable[1][1]; 1638var numFalsePos = confusionTable[1][0];
Evaluators\MulticlassClassificationEvaluator.cs (1)
370foreach (var x in s)
Evaluators\MultiOutputRegressionEvaluator.cs (28)
101var l1 = new List<Double>(); 102var l2 = new List<Double>(); 103var dist = new List<Double>(); 104var perLabelL1 = new List<Double[]>(); 105var perLabelL2 = new List<Double[]>(); 106var perLabelRms = new List<Double[]>(); 107var perLabelLoss = new List<Double[]>(); 170private readonly Double[] _l1Loss; 171private readonly Double[] _l2Loss; 172private readonly Double[] _fnLoss; 173private Double _sumWeights; 174private Double _sumL1; 175private Double _sumL2; 176private Double _sumEuclidean; 180public Double L1 => _sumWeights > 0 ? _sumL1 / _sumWeights : 0; 182public Double L2 => _sumWeights > 0 ? _sumL2 / _sumWeights : 0; 184public Double Dist => _sumWeights > 0 ? _sumEuclidean / _sumWeights : 0; 186public Double[] PerLabelL1 199public Double[] PerLabelL2 212public Double[] PerLabelRms 225public Double[] PerLabelLoss 254Double wht = weight; 255Double l1 = 0; 256Double l2 = 0; 259Double currL1Loss = Math.Abs((Double)label[i] - score[i]); 728VBuffer<Double> metricVals = default(VBuffer<Double>);
Evaluators\QuantileRegressionEvaluator.cs (41)
29RegressionEvaluatorBase<QuantileRegressionEvaluator.Aggregator, VBuffer<float>, VBuffer<Double>> 95public override VBuffer<Double> Rms 99var res = new Double[_size]; 105return new VBuffer<Double>(_size, res); 109public override VBuffer<Double> RSquared 113var res = new Double[_size]; 119return new VBuffer<Double>(_size, res); 127TotalL1Loss = VBufferUtils.CreateDense<Double>(size); 128TotalL2Loss = VBufferUtils.CreateDense<Double>(size); 129TotalLoss = VBufferUtils.CreateDense<Double>(size); 132protected override void UpdateCore(float label, in VBuffer<float> score, in VBuffer<Double> loss, float weight) 151var diff = Math.Abs((Double)label - scoreValues[i]); 152var weightedDiff = diff * weight; 163var diff = Math.Abs((Double)label - scoreValues[i]); 164var weightedDiff = diff * weight; 170private void AddCustomLoss(float weight, in VBuffer<Double> loss) 191protected override void Normalize(in VBuffer<Double> src, ref VBuffer<Double> dst) 197var inv = 1 / SumWeights; 204protected override VBuffer<Double> Zero() 206return VBufferUtils.CreateDense<Double>(_size); 226Loss = new VBuffer<Double>(size, 0, null, null); 233protected override void ApplyLossFunction(in VBuffer<float> score, float label, ref VBuffer<Double> loss) 235VBufferUtils.PairManipulator<float, Double> lossFn = 236(int slot, float src, ref Double dst) => dst = LossFunction.Loss(src, label); 245public override void AddColumn(ArrayDataViewBuilder dvBldr, string metricName, params VBuffer<Double>[] metric) 390var l1 = VBufferUtils.CreateDense<Double>(_scoreSize); 406var lab = (Double)label; 417ValueGetter<VBuffer<Double>> l1Fn = 418(ref VBuffer<Double> dst) => 427VBufferUtils.PairManipulator<Double, Double> sqr = 428(int slot, Double x, ref Double y) => y = x * x; 430ValueGetter<VBuffer<Double>> l2Fn = 431(ref VBuffer<Double> dst) => 522(in VBuffer<Double> src, ref Double dst) => dst = src.GetItemOrDefault(index));
Evaluators\RankingEvaluator.cs (70)
70private readonly Double[] _labelGains; 84var labelGains = new List<Double>(); 88Double gain; 89if (!Double.TryParse(gains[i], out gain)) 164var ndcg = new List<Double[]>(); 165var dcg = new List<Double[]>(); 168var groupNdcg = new List<Double[]>(); 169var groupDcg = new List<Double[]>(); 170var groupMaxDcg = new List<Double[]>(); 285private readonly List<Double[]> _groupNdcg; 286private readonly List<Double[]> _groupDcg; 287private readonly List<Double[]> _groupMaxDcg; 288private readonly Double[] _groupDcgCur; 289private readonly Double[] _groupMaxDcgCur; 291private readonly Double[] _sumNdcgAtN; 292private readonly Double[] _sumDcgAtN; 293private Double _sumWeights; 297private readonly Double[] _labelGains; 298private readonly Double[] _discountMap; 302public Double[] Ndcg 306var ndcg = new Double[TruncationLevel]; 313public Double[] Dcg 317var dcg = new Double[TruncationLevel]; 324public Double[][] GroupDcg 334public Double[][] GroupNdcg 344public Double[][] GroupMaxDcg 354public Counters(Double[] labelGains, int truncationLevel, bool groupSummary) 362_sumDcgAtN = new Double[TruncationLevel]; 363_sumNdcgAtN = new Double[TruncationLevel]; 365_groupDcgCur = new Double[TruncationLevel]; 366_groupMaxDcgCur = new Double[TruncationLevel]; 369_groupNdcg = new List<Double[]>(); 370_groupDcg = new List<Double[]>(); 371_groupMaxDcg = new List<Double[]>(); 390var maxDcg = new Double[TruncationLevel]; 398var groupDcg = new Double[TruncationLevel]; 403var groupNdcg = new Double[TruncationLevel]; 406Double ndcg = _groupMaxDcgCur[t] > 0 ? _groupDcgCur[t] / _groupMaxDcgCur[t] : 0; 436public Aggregator(IHostEnvironment env, Double[] labelGains, int truncationLevel, bool groupSummary, bool weighted, string stratName) 590int truncationLevel, Double[] labelGains) 698private readonly Double[] _discountMap; 699private readonly Double[] _labelGains; 702int truncationLevel, Double[] labelGains) 758ValueGetter<VBuffer<Double>> fn = 759(ref VBuffer<Double> dst) => Copy(ndcg, ref dst); 765ValueGetter<VBuffer<Double>> fn = (ref VBuffer<Double> dst) => Copy(dcg, ref dst); 771ValueGetter<VBuffer<Double>> fn = (ref VBuffer<Double> dst) => Copy(maxDcg, ref dst); 777private void Copy(Double[] src, ref VBuffer<Double> dst) 821Double ndcg = state.MaxDcgCur[t] > 0 ? state.DcgCur[t] / state.MaxDcgCur[t] : 0; 833public readonly Double[] NdcgCur; 834public readonly Double[] DcgCur; 835public readonly Double[] MaxDcgCur; 844NdcgCur = new Double[truncationLevel]; 845DcgCur = new Double[truncationLevel]; 846MaxDcgCur = new Double[truncationLevel]; 965private static Double[] _discountMapFixed; 967private static Double[] GetDiscountMapCore(int truncationLevel) 969var discountMap = new Double[truncationLevel]; 977public static Double[] GetDiscountMap(int truncationLevel) 996public static void QueryMaxDcg(Double[] labelGains, int truncationLevel, Double[] discountMap, 997List<short> queryLabels, List<Single> queryOutputs, Double[] groupMaxDcgCur) 1010groupMaxDcgCur[t] = Double.NaN; 1035public static void QueryDcg(Double[] labelGains, int truncationLevel, Double[] discountMap, 1036List<short> queryLabels, List<Single> queryOutputs, Double[] groupDcgCur) 1045Double dcg = 0;
Evaluators\RegressionEvaluator.cs (5)
28RegressionEvaluatorBase<RegressionEvaluator.Aggregator, float, Double> 119Double currL1Loss = Math.Abs((Double)label - score); 305dst = Math.Abs((Double)label - score); 315dst = Math.Abs((Double)label - score);
Evaluators\RegressionEvaluatorBase.cs (3)
118protected Double SumWeights; 122protected Double TotalLabelW; 123protected Double TotalLabelSquaredW;
Prediction\Calibrator.cs (40)
1486Double slope = 0; 1487Double offset = 0; 1489Double prior0 = 0; 1490Double prior1 = 0; 1512Double hiTarget = (prior1 + 1) / (prior1 + 2); 1513Double loTarget = 1 / (prior0 + 2); 1515Double lambda = 0.001; 1516Double olderr = Double.MaxValue / 2; 1529Double a = 0; 1530Double b = 0; 1531Double c = 0; 1532Double d = 0; 1533Double e = 0; 1542var t = (d_i.Target ? hiTarget : loTarget); 1545Double deriv = p * (1 - p) * weight; 1546Double dd = (p - t) * weight; 1560Double err = 0; 1561Double oldA = slope; 1562Double oldB = offset; 1566Double det = (a + lambda) * (b + lambda) - c * c; 1584var t = d_i.Target ? hiTarget : loTarget; 1587Double logp = -200; 1588Double log1p = -200; 1615Double diff = err - olderr; 1617Double scale = 0.5 * (err + olderr + 1); 1638public Double Slope = -1; 1641public Double Offset = 0; 1654private readonly Double _slope; 1655private readonly Double _offset; 1696public Double Slope { get; } 1700public Double Offset { get; } 1707internal PlattCalibrator(IHostEnvironment env, Double slope, Double offset) 1778internal static float PredictProbability(float output, Double a, Double b) 1822Double a = 0; 1823Double b = 0; 2145public Double Slope = -1; 2148public Double Offset = 0;
Scorers\QuantileRegressionScorer.cs (4)
53private static Double[] ParseQuantiles(string quantiles) 56Double[] quantilesArray = quantiles.Split(',').Select( 59Double q; 60if (!Double.TryParse(v, out q))
Transforms\Hashing.cs (1)
589foreach (var value in values.DenseValues())
Transforms\LabelIndicatorTransform.cs (1)
217var src = default(double);
Transforms\NAFilter.cs (1)
134Host.CheckDecode(cbFloat == sizeof(Single) || cbFloat == sizeof(Double));
Transforms\NormalizeColumn.cs (14)
841Double src = 0; 842var getSrc = RowCursorUtils.GetGetterAs<Double>(NumberDataViewType.Double, row, col); 988return Dbl.MinMaxOneColumnFunctionBuilder.Create(column, host, srcType, cursor.GetGetter<Double>(srcColumn)); 995return Dbl.MinMaxVecColumnFunctionBuilder.Create(column, host, vectorType, cursor.GetGetter<VBuffer<Double>>(srcColumn)); 1027return Dbl.MeanVarOneColumnFunctionBuilder.Create(column, host, srcType, cursor.GetGetter<Double>(srcColumn)); 1034return Dbl.MeanVarVecColumnFunctionBuilder.Create(column, host, vectorType, cursor.GetGetter<VBuffer<Double>>(srcColumn)); 1068return Dbl.MeanVarOneColumnFunctionBuilder.Create(column, host, srcType, cursor.GetGetter<Double>(srcColumn)); 1075return Dbl.MeanVarVecColumnFunctionBuilder.Create(column, host, vectorType, cursor.GetGetter<VBuffer<Double>>(srcColumn)); 1108return Dbl.BinOneColumnFunctionBuilder.Create(column, host, srcType, cursor.GetGetter<Double>(srcColumn)); 1115return Dbl.BinVecColumnFunctionBuilder.Create(column, host, vectorType, cursor.GetGetter<VBuffer<Double>>(srcColumn)); 1270internal static void AdjustForZeros(ref Double mean, ref Double m2, ref long count, long numZeros) 1279var delta = 0 - mean; 1281var d2 = delta * (0 - mean);
Transforms\NormalizeColumnDbl.cs (311)
23using TFloat = Double; 28int numFeatures, int[] indices, TFloat[] scales, TFloat[] offsets, bool saveText = false) 48ctx.Writer.Write(sizeof(TFloat)); 89out int numFeatures, out TFloat[] scales, out TFloat[] offsets, 90out int[] indicesMorph, out TFloat[] scalesSparse, out TFloat[] offsetsSparse) 106Contracts.CheckDecode(cbFloat == sizeof(TFloat)); 133TFloat scale = scales[iv]; 134Contracts.CheckDecode(!TFloat.IsNaN(scale)); 142TFloat offset = offsets[iv]; 143Contracts.CheckDecode(!TFloat.IsNaN(offset)); 155scalesSparse = ctx.Reader.ReadDoubleArray(scaleCount) ?? new TFloat[0]; 161scales = Utils.CreateArray<TFloat>(numFeatures, 1); 162offsets = offsetsSparse != null ? new TFloat[numFeatures] : null; 169TFloat scale = scales[iv] = scalesSparse[iiv]; 170Contracts.CheckDecode(!TFloat.IsNaN(scale)); 178TFloat offset = offsets[iv] = offsetsSparse[iiv]; 179Contracts.CheckDecode(!TFloat.IsNaN(offset)); 195public static void SaveModel(ModelSaveContext ctx, TFloat[][] binUpperBounds, bool saveText = false) 207ctx.Writer.Write(sizeof(TFloat)); 234public static void LoadModel(ModelLoadContext ctx, out TFloat[][] binUpperBounds) 246Contracts.CheckDecode(cbFloat == sizeof(TFloat)); 251binUpperBounds = new TFloat[numFeatures][]; 254TFloat[] curUpperBounds = ctx.Reader.ReadDoubleArray(); 259Contracts.CheckDecode(curUpperBounds[curUpperBounds.Length - 1] == TFloat.PositiveInfinity); 266public static void SaveModel(ModelSaveContext ctx, bool useLog, TFloat[] mean, TFloat[] stddev) 274ctx.Writer.Write(sizeof(TFloat)); 290public static void LoadModel(ModelLoadContext ctx, int cv, out bool useLog, out TFloat[] mean, out TFloat[] stddev) 300Contracts.CheckDecode(cbFloat == sizeof(TFloat)); 318internal sealed class MinMaxDblAggregator : IColumnAggregator<VBuffer<TFloat>> 320private readonly TFloat[] _min; 321private readonly TFloat[] _max; 328_min = new TFloat[size]; 329_max = new TFloat[size]; 333_min[i] = TFloat.PositiveInfinity; 334_max[i] = TFloat.NegativeInfinity; 338public TFloat[] Min 343public TFloat[] Max 353public void ProcessValue(in VBuffer<TFloat> value) 367var val = values[j]; 377var val = values[k]; 396private void Update(int j, TFloat val) 414private readonly Double[] _mean; 415private readonly Double[] _m2; 423_mean = new Double[size]; 424_m2 = new Double[size]; 435public Double[] Mean 440public Double[] StdDevPopulation 445public Double[] StdDevSample 450public Double[] MeanSquareError 455public Double[] SampleVariance 460public Double[] M2 465public void ProcessValue(in VBuffer<TFloat> value) 478var origVal = values[j]; 487var origVal = values[k]; 507private void Update(int j, TFloat origVal) 511var val = _useLog ? (TFloat)Math.Log(origVal) : origVal; 520var delta = val - _mean[j]; 522var dm2 = delta * (val - _mean[j]); 645public static IColumnFunction Create(IHost host, TFloat scale, TFloat offset) 650public static IColumnFunction Create(IHost host, TFloat[] scale, TFloat[] offset, int[] indicesNonZeroOffset) 658public sealed class ImplOne : ImplOne<TFloat> 660public ImplOne(IHost host, TFloat scale, TFloat offset) 667host.Check(typeSrc.RawType == typeof(TFloat), "The column type must be R8."); 670TFloat[] scales; 671TFloat[] offsets; 673TFloat[] scalesSparse; 674TFloat[] offsetsSparse; 687private void GetResult(ref TFloat input, ref TFloat value) 709var getSrc = input.GetGetter<TFloat>(input.Schema[icol]); 710ValueGetter<TFloat> del = 711(ref TFloat dst) => 722public sealed class ImplVec : ImplVec<TFloat> 724public ImplVec(IHost host, TFloat[] scale, TFloat[] offset, int[] indicesNonZeroOffset) 731host.Check(typeSrc.ItemType.RawType == typeof(TFloat), "The column type must be vector of Double."); 735TFloat[] scales; 736TFloat[] offsets; 738TFloat[] scalesSparse; 739TFloat[] offsetsSparse; 777node.AddAttribute("offset", Enumerable.Repeat<TFloat>(0, featureCount)); 785var getSrc = input.GetGetter<VBuffer<TFloat>>(input.Schema[icol]); 786var bldr = new BufferBuilder<TFloat>(R8Adder.Instance); 787ValueGetter<VBuffer<TFloat>> del; 790del = (ref VBuffer<TFloat> dst) => 800del = (ref VBuffer<TFloat> dst) => 810del = (ref VBuffer<TFloat> dst) => 823private static void FillValues(in VBuffer<TFloat> input, BufferBuilder<TFloat> bldr, TFloat[] scale) 852private static void FillValues(in VBuffer<TFloat> input, BufferBuilder<TFloat> bldr, TFloat[] scale, 853TFloat[] offset) 896private static void FillValues(in VBuffer<TFloat> input, BufferBuilder<TFloat> bldr, TFloat[] scale, 897TFloat[] offset, int[] nz) 971public static IColumnFunction Create(IHost host, TFloat mean, TFloat stddev, bool useLog) 976public static IColumnFunction Create(IHost host, TFloat[] mean, TFloat[] stddev, bool useLog) 983public sealed class ImplOne : ImplOne<TFloat> 985public ImplOne(IHost host, TFloat mean, TFloat stddev, bool useLog) 992host.Check(typeSrc.RawType == typeof(TFloat), "The column type must be Double."); 997TFloat[] mean; 998TFloat[] stddev; 1004private void GetResult(ref TFloat input, ref TFloat value) 1006var val = UseLog ? (TFloat)Math.Log(input) : input; 1027if (Stddev <= TFloat.Epsilon) 1029ValueGetter<TFloat> trivial = 1030(ref TFloat dst) => 1037var getSrc = input.GetGetter<TFloat>(input.Schema[icol]); 1038ValueGetter<TFloat> del = 1039(ref TFloat dst) => 1048public sealed class ImplVec : ImplVec<TFloat> 1050public ImplVec(IHost host, TFloat[] mean, TFloat[] stddev, bool useLog) 1057host.Check(typeSrc.ItemType.RawType == typeof(TFloat), "The column type must be vector of Double."); 1064TFloat[] mean; 1065TFloat[] stddev; 1082var getSrc = input.GetGetter<VBuffer<TFloat>>(input.Schema[icol]); 1083var bldr = new BufferBuilder<TFloat>(R8Adder.Instance); 1084ValueGetter<VBuffer<TFloat>> del; 1085del = (ref VBuffer<TFloat> dst) => 1096private static void FillValues(in VBuffer<TFloat> input, BufferBuilder<TFloat> bldr, TFloat[] mean, 1097TFloat[] stddev, bool useLog) 1114var sigma = stddev[i]; 1115if (sigma > TFloat.Epsilon) 1117var val = useLog ? (TFloat)Math.Log(values[i]) : values[i]; 1130var sigma = stddev[ivDst]; 1131if (sigma > TFloat.Epsilon) 1133var val = useLog ? (TFloat)Math.Log(values[ii]) : values[ii]; 1145public static IColumnFunction Create(IHost host, TFloat[] binUpperBounds, bool fixZero) 1150public static IColumnFunction Create(IHost host, TFloat[][] binUpperBounds, bool fixZero) 1159private readonly TFloat[] _binUpperBounds; 1160private readonly TFloat _den; 1161private readonly TFloat _offset; 1163public ImplOne(IHost host, TFloat[] binUpperBounds, bool fixZero) 1175host.Check(typeSrc.RawType == typeof(TFloat), "The column type must be Double."); 1183TFloat[][] binUpperBounds = null; 1211var getSrc = input.GetGetter<TFloat>(input.Schema[icol]); 1212ValueGetter<TFloat> del = 1213(ref TFloat dst) => 1221private void GetResult(ref TFloat input, ref TFloat value) 1227=> new NormalizingTransformer.BinNormalizerModelParameters<TFloat>(ImmutableArray.Create(_binUpperBounds), _den, _offset); 1232private readonly TFloat[][] _binUpperBounds; 1233private readonly TFloat[] _den; 1234private readonly TFloat[] _offset; 1236public ImplVec(IHost host, TFloat[][] binUpperBounds, bool fixZero) 1240_den = new TFloat[_binUpperBounds.Length]; 1245_offset = new TFloat[_binUpperBounds.Length]; 1260host.Check(typeSrc.ItemType.RawType == typeof(TFloat), "The column type must be vector of Double."); 1269TFloat[][] binUpperBounds = null; 1296var getSrc = input.GetGetter<VBuffer<TFloat>>(input.Schema[icol]); 1297var bldr = new BufferBuilder<TFloat>(R8Adder.Instance); 1298ValueGetter<VBuffer<TFloat>> del = 1299(ref VBuffer<TFloat> dst) => 1308private void GetResult(in VBuffer<TFloat> input, ref VBuffer<TFloat> value, BufferBuilder<TFloat> bldr) 1346TFloat zero = 0; 1377=> new NormalizingTransformer.BinNormalizerModelParameters<ImmutableArray<TFloat>>(_binUpperBounds.Select(b => ImmutableArray.Create(b)).ToImmutableArray(), 1386public static void ComputeScaleAndOffset(bool fixZero, TFloat max, TFloat min, out TFloat scale, out TFloat offset) 1394private static void ComputeScaleAndOffset(TFloat max, TFloat min, out TFloat scale, out TFloat offset) 1396Contracts.Assert(!TFloat.IsNaN(min)); 1397Contracts.Assert(!TFloat.IsNaN(max)); 1401Contracts.Assert(min <= max || (TFloat.IsPositiveInfinity(min) && TFloat.IsNegativeInfinity(max))); 1416Contracts.Assert(0 <= scale && scale < TFloat.PositiveInfinity); 1419private static void ComputeScaleAndOffsetFixZero(TFloat max, TFloat min, out TFloat scale, out TFloat offset) 1421Contracts.Assert(!TFloat.IsNaN(min)); 1422Contracts.Assert(!TFloat.IsNaN(max)); 1426Contracts.Assert(min <= max || (TFloat.IsPositiveInfinity(min) && TFloat.IsNegativeInfinity(max))); 1437Contracts.Assert(0 <= scale && scale < TFloat.PositiveInfinity); 1443public static void ComputeScaleAndOffset(Double mean, Double stddev, out TFloat scale, out TFloat offset) 1445Contracts.Assert(!Double.IsNaN(mean)); 1453else if ((scale = 1 / (TFloat)stddev) == 0) 1456offset = (TFloat)mean; 1457Contracts.Assert(0 <= scale && scale < TFloat.PositiveInfinity); 1460public static void ComputeScaleAndOffsetFixZero(Double mean, Double meanSquaredError, out TFloat scale, out TFloat offset) 1462Contracts.Assert(!Double.IsNaN(mean)); 1472scale = 1 / (TFloat)Math.Sqrt(meanSquaredError + mean * mean); 1473Contracts.Assert(0 <= scale && scale < TFloat.PositiveInfinity); 1479public static TFloat Cdf(TFloat input, TFloat mean, TFloat stddev) 1485var x = (input - mean) / stddev; 1486var x2 = x * x / 2; 1487const TFloat a = (TFloat)0.147; 1488var ax2 = a * x2; 1489return (TFloat)(0.5 + 0.5 * Math.Sign(x) * Math.Sqrt(1 - Math.Exp(-x2 * (4 / Math.PI + ax2) / (1 + ax2)))); 1495public static TFloat GetValue(in TFloat input, TFloat[] binUpperBounds, TFloat den, TFloat offset) 1497if (TFloat.IsNaN(input)) 1501var value = binIdx / den - offset; 1506public static TFloat GetValue(in TFloat input, TFloat[] binUpperBounds, TFloat den) 1508if (TFloat.IsNaN(input)) 1512var value = binIdx / den; 1520public abstract class MinMaxOneColumnFunctionBuilderBase : OneColumnFunctionBuilderBase<TFloat> 1524private VBuffer<TFloat> _buffer; 1526protected MinMaxOneColumnFunctionBuilderBase(IHost host, long lim, bool fix, ValueGetter<TFloat> getSrc) 1531_buffer = new VBuffer<TFloat>(1, new TFloat[1]); 1534protected override bool ProcessValue(in TFloat val) 1546private MinMaxOneColumnFunctionBuilder(IHost host, long lim, bool fix, ValueGetter<TFloat> getSrc) 1552ValueGetter<TFloat> getter) 1561TFloat scale; 1562TFloat offset; 1569public abstract class MinMaxVecColumnFunctionBuilderBase : VecColumnFunctionBuilderBase<TFloat> 1574protected MinMaxVecColumnFunctionBuilderBase(IHost host, int cv, long lim, bool fix, ValueGetter<VBuffer<TFloat>> getSrc) 1581protected override bool ProcessValue(in VBuffer<TFloat> buffer) 1596ValueGetter<VBuffer<TFloat>> getSrc) 1602ValueGetter<VBuffer<TFloat>> getter) 1645public sealed class MeanVarOneColumnFunctionBuilder : OneColumnFunctionBuilderBase<TFloat> 1652private VBuffer<TFloat> _buffer; 1654private MeanVarOneColumnFunctionBuilder(IHost host, long lim, bool fix, ValueGetter<TFloat> getSrc, bool useLog, bool useCdf, bool useSampleVariance) 1662_buffer = new VBuffer<TFloat>(1, new TFloat[1]); 1666ValueGetter<TFloat> getter) 1673ValueGetter<TFloat> getter) 1680protected override bool ProcessValue(in TFloat origVal) 1701return AffineColumnFunction.Create(Host, (TFloat)0, (TFloat)0); 1702TFloat scale; 1703TFloat offset; 1704var stdDev = _useSampleVariance ? _aggregator.StdDevSample[0] : _aggregator.StdDevPopulation[0]; 1705var variance = _useSampleVariance ? _aggregator.SampleVariance[0] : _aggregator.MeanSquareError[0]; 1719return CdfColumnFunction.Create(Host, (TFloat)0, (TFloat)0, _useLog); 1721var stdDev = _useSampleVariance ? _aggregator.StdDevSample[0] : _aggregator.StdDevPopulation[0]; 1723return CdfColumnFunction.Create(Host, (TFloat)_aggregator.Mean[0], (TFloat)stdDev, _useLog); 1727public sealed class MeanVarVecColumnFunctionBuilder : VecColumnFunctionBuilderBase<TFloat> 1736ValueGetter<VBuffer<TFloat>> getSrc, bool useLog, bool useCdf, bool useSampleVariance) 1747ValueGetter<VBuffer<TFloat>> getter) 1755ValueGetter<VBuffer<TFloat>> getter) 1763protected override bool ProcessValue(in VBuffer<TFloat> buffer) 1787var scale = new TFloat[cv]; 1788var offset = new TFloat[cv]; 1799var stdDev = _useSampleVariance ? _aggregator.StdDevSample[i] : _aggregator.StdDevPopulation[i]; 1800var variance = _useSampleVariance ? _aggregator.SampleVariance[i] : _aggregator.MeanSquareError[i]; 1833var mean = new TFloat[cv]; 1834var stddev = new TFloat[cv]; 1844mean[i] = (TFloat)_aggregator.Mean[i]; 1845stddev[i] = (TFloat)(_useSampleVariance ? _aggregator.StdDevSample[i] : _aggregator.StdDevPopulation[i]); 1853public sealed class BinOneColumnFunctionBuilder : OneColumnFunctionBuilderBase<TFloat> 1857private readonly List<TFloat> _values; 1859private BinOneColumnFunctionBuilder(IHost host, long lim, bool fix, int numBins, ValueGetter<TFloat> getSrc) 1864_values = new List<TFloat>(); 1868ValueGetter<TFloat> getter) 1878protected override bool ProcessValue(in TFloat val) 1891_values.RemoveAll(TFloat.IsNaN); 1897public sealed class BinVecColumnFunctionBuilder : VecColumnFunctionBuilderBase<TFloat> 1901private readonly List<TFloat>[] _values; 1904ValueGetter<VBuffer<TFloat>> getSrc) 1909_values = new List<TFloat>[cv]; 1912_values[i] = new List<TFloat>(); 1917ValueGetter<VBuffer<TFloat>> getter) 1928protected override bool ProcessValue(in VBuffer<TFloat> buffer) 1951var val = values[k]; 1963var binUpperBounds = new TFloat[count][]; 1967_values[i].RemoveAll(TFloat.IsNaN); 1974public sealed class SupervisedBinOneColumnFunctionBuilder : OneColumnSupervisedBinFunctionBuilderBase<TFloat> 1988protected override bool AcceptColumnValue(in TFloat colValue) 1990return !TFloat.IsNaN(colValue); 2012public sealed class SupervisedBinVecColumnFunctionBuilder : VecColumnSupervisedBinFunctionBuilderBase<TFloat> 2026protected override bool AcceptColumnValue(in VBuffer<TFloat> colValuesBuffer) 2034TFloat[][] binUpperBounds = new TFloat[ColumnSlotCount][];
Transforms\NormalizeColumnSng.cs (23)
415private readonly Double[] _mean; 416private readonly Double[] _m2; 424_mean = new Double[size]; 425_m2 = new Double[size]; 436public Double[] Mean 441public Double[] StdDevPopulation 446public Double[] StdDevSample 451public Double[] MeanSquareError 456public Double[] SampleVariance 461public Double[] M2 522var delta = val - _mean[j]; 524var dm2 = delta * (val - _mean[j]); 1606public static void ComputeScaleAndOffset(Double mean, Double stddev, out TFloat scale, out TFloat offset) 1608Contracts.Assert(!Double.IsNaN(mean)); 1623public static void ComputeScaleAndOffsetFixZero(Double mean, Double meanSquaredError, out TFloat scale, out TFloat offset) 1625Contracts.Assert(!Double.IsNaN(mean)); 1867var stdDev = _useSampleVariance ? _aggregator.StdDevSample[0] : _aggregator.StdDevPopulation[0]; 1868var variance = _useSampleVariance ? _aggregator.SampleVariance[0] : _aggregator.MeanSquareError[0]; 1884var stdDev = _useSampleVariance ? _aggregator.StdDevSample[0] : _aggregator.StdDevPopulation[0]; 1962var stdDev = _useSampleVariance ? _aggregator.StdDevSample[i] : _aggregator.StdDevPopulation[i]; 1963var variance = _useSampleVariance ? _aggregator.SampleVariance[i] : _aggregator.MeanSquareError[i];
Transforms\RangeFilter.cs (28)
39public Double? Min; 42public Double? Max; 75private readonly Double _min; 76private readonly Double _max; 90public RangeFilter(IHostEnvironment env, IDataView input, string column, Double lowerBound, Double upperBound, bool includeUpperBound) 124_min = options.Min ?? Double.NegativeInfinity; 125_max = options.Max ?? Double.PositiveInfinity; 270protected readonly Func<Double, bool> CheckBounds; 271private readonly Double _min; 272private readonly Double _max; 283CheckBounds = Parent._complement ? (Func<Double, bool>)TestNotCC : TestCC; 285CheckBounds = Parent._complement ? (Func<Double, bool>)TestNotCO : TestCO; 290CheckBounds = Parent._complement ? (Func<Double, bool>)TestNotOC : TestOC; 292CheckBounds = Parent._complement ? (Func<Double, bool>)TestNotOO : TestOO; 300private bool TestOO(Double value) => _min < value && value < _max; 301private bool TestCO(Double value) => _min <= value && value < _max; 302private bool TestOC(Double value) => _min < value && value <= _max; 303private bool TestCC(Double value) => _min <= value && value <= _max; 304private bool TestNotOO(Double value) => _min >= value || value >= _max; 305private bool TestNotCO(Double value) => _min > value || value >= _max; 306private bool TestNotOC(Double value) => _min >= value || value > _max; 307private bool TestNotCC(Double value) => _min > value || value > _max; 383private readonly ValueGetter<Double> _srcGetter; 384private readonly ValueGetter<Double> _getter; 385private Double _value; 391_srcGetter = Input.GetGetter<Double>(Input.Schema[Parent._index]); 393(ref Double value) =>
Transforms\ValueToKeyMappingTransformer.cs (1)
845CastInputToFloat<Double>(ctx, out node, out termIds, srcVariableName, iinfo, opType, labelEncoderOutput);
Utilities\TimerScope.cs (2)
43Double elapsedSeconds = (Double)_watch.ElapsedMilliseconds / 1000;
Utils\ApiUtils.cs (1)
50if (t == typeof(Double))
Utils\LossFunctions.cs (23)
74Double DualLoss(float label, float dual); 133public Double Loss(float output, float label) 164public Double DualLoss(float label, float dual) 172return Double.NegativeInfinity; 177private static Double Log(Double x) 239public Double Loss(float output, float label) 265public Double DualLoss(float label, float dual) 272return Double.NegativeInfinity; 323private readonly Double _halfSmoothConst; 324private readonly Double _doubleSmoothConst; 348public Double Loss(float output, float label) 389public Double DualLoss(float label, float dual) 396return Double.NegativeInfinity; 447public Double Loss(float output, float label) 489public Double Loss(float output, float label) 512public Double DualLoss(float label, float dual) 542public Double Loss(float output, float label) 585public Double Index = 1.5; 592private readonly Double _index; // The index parameter specified by the user. 593private readonly Double _index1; // 1 minus the index parameter. 594private readonly Double _index2; // 2 minus the index parameter. 624public Double Loss(float output, float label)
Microsoft.ML.Ensemble (3)
Selector\SubModelSelector\BaseSubModelSelector.cs (1)
36var metric = 0.0;
Selector\SubsetSelector\RandomPartitionSelector.cs (2)
49var viewTrain = new RangeFilter(Host, new RangeFilter.Options() { Column = name, Min = (Double)i / Size, Max = (Double)(i + 1) / Size }, view);
Microsoft.ML.EntryPoints (4)
JsonUtils\JsonManifestUtils.cs (4)
157var inputs = new List<KeyValuePair<Double, JObject>>(); 273inputs.Add(new KeyValuePair<Double, JObject>(inputAttr.SortOrder, jo)); 285var outputs = new List<KeyValuePair<Double, JObject>>(); 302outputs.Add(new KeyValuePair<Double, JObject>(outputAttr.SortOrder, jo));
Microsoft.ML.Fairlearn (1)
Reductions\UtilityParity.cs (1)
97var expectEvent = Tags["pred"].Mean();
Microsoft.ML.FastTree (154)
BinFile\BinFinder.cs (6)
54private int FindDistinctCounts(in VBuffer<Double> values, double[] valueBuffer, double[] distinctValues, int[] counts) 142var prev = double.NegativeInfinity; 145var v = distinctValues[i]; 179var firstBinUpperBound = binUpperBounds[0]; 227public bool FindBins(in VBuffer<Double> values, int maxBins, int minPerLeaf, out double[] binUpperBounds) 270var ave = a / 2 + b / 2;
Dataset\DenseIntArray.cs (8)
17using FloatType = System.Double; 78FloatType* pSumTargetsByBin, double* pSumTargets2ByBin, int* pCountByBin, 84FloatType* pSumTargetsByBin, double* pSumTargets2ByBin, int* pCountByBin, 92fixed (FloatType* pSumTargetsByBin = histogram.SumTargetsByBin) 93fixed (FloatType* pSampleOutputs = input.Outputs) 308private void SumupRoot(FeatureHistogram histogram, FloatType[] outputs, double[] weights) 337fixed (FloatType* pSumTargetsByBin = histogram.SumTargetsByBin) 338fixed (FloatType* pTargets = input.Outputs)
Dataset\FeatureFlock.cs (7)
8using FloatType = System.Double; 30public readonly Double SumTargets; 32public readonly Double SumWeights; 36public PerBinStats(Double sumTargets, Double sumWeights, int count) 106FloatType[] outputs, 135FloatType[] outputs,
Dataset\FeatureHistogram.cs (10)
14using FloatType = System.Double; 22public readonly FloatType[] SumTargetsByBin; 43SumTargetsByBin = new FloatType[NumFeatureValues]; 63+ sizeof(FloatType) * numBins // SumTargetsByBin 76fixed (FloatType* pSumTargetsByBin = SumTargetsByBin) 77fixed (FloatType* pChildSumTargetsByBin = child.SumTargetsByBin) 104public void Sumup(int numDocsInLeaf, double sumTargets, FloatType[] outputs, int[] docIndices) 109public void SumupWeighted(int numDocsInLeaf, double sumTargets, double sumWeights, FloatType[] outputs, double[] weights, int[] docIndices) 146public readonly FloatType[] Outputs; 152FloatType[] outputs, double[] weights, int[] docIndices)
Dataset\RepeatIntArray.cs (8)
15using FloatType = Double; 222fixed (FloatType* pOutputsFixed = input.Outputs) 223fixed (FloatType* pSumTargetsFixed = histogram.SumTargetsByBin) 227FloatType* pOutputs = pOutputsFixed; 233FloatType subsum = pSumTargetsFixed[featureBin]; 260fixed (FloatType* pOutputsFixed = input.Outputs) 266FloatType* pOutputs = pOutputsFixed; 274FloatType subsum = histogram.SumTargetsByBin[bin];
Dataset\SegmentIntArray.cs (3)
17using FloatType = System.Double; 554fixed (FloatType* pSumTargetsByBin = histogram.SumTargetsByBin) 555fixed (FloatType* pSampleOutputs = input.Outputs)
Dataset\SparseIntArray.cs (24)
16using FloatType = System.Double; 293FloatType output = (FloatType)input.Outputs[currentPos]; 295histogram.SumTargetsByBin[featureBin] = (FloatType)(histogram.SumTargetsByBin[featureBin] + output); 300histogram.SumTargetsByBin[0] += (FloatType)(input.SumTargets - totalOutput); 318FloatType output = (FloatType)input.Outputs[currentPos]; 319FloatType weight = (FloatType)input.Weights[currentPos]; 321histogram.SumTargetsByBin[featureBin] = (FloatType)(histogram.SumTargetsByBin[featureBin] + output); 322histogram.SumWeightsByBin[featureBin] = (FloatType)(histogram.SumWeightsByBin[featureBin] + weight); 328histogram.SumTargetsByBin[0] += (FloatType)(input.SumTargets - totalOutput); 329histogram.SumWeightsByBin[0] += (FloatType)(input.SumWeights - totalWeight); 346FloatType totalOutput = 0; 351fixed (FloatType* pOutputs = input.Outputs) 370FloatType output = pOutputs[iDocIndices]; 392histogram.SumTargetsByBin[0] += (FloatType)(input.SumTargets - totalOutput); 404FloatType totalOutput = 0; 410fixed (FloatType* pOutputs = input.Outputs) 430FloatType output = pOutputs[iDocIndices]; 453histogram.SumTargetsByBin[0] += (FloatType)(input.SumTargets - totalOutput); 454histogram.SumWeightsByBin[0] += (FloatType)(input.SumWeights - totalWeights); 503fixed (FloatType* pSumTargetsByBin = histogram.SumTargetsByBin) 504fixed (FloatType* pSampleOutputs = input.Outputs)
FastTreeArguments.cs (15)
175public Double Index = 1.5; 387public Double EntropyCoefficient; 467public Double SparsifyThreshold = 0.7; 473public Double FeatureFirstUsePenalty; 479public Double FeatureReusePenalty; 489public Double GainConfidenceLevel; 495public Double SoftmaxTemperature; 542public Double FeatureFraction = 1; 558public Double BaggingExampleFraction = 0.7; 564public Double FeatureFractionPerSplit = 1; 570public Double Smoothing; 674public Double MinimumStepSize; 765public Double Shrinkage = 1; 773public Double DropoutRate = 0; 791public Double MaximumTreeOutput = 100;
FastTreeRanking.cs (1)
155private Double[] GetLabelGains()
FastTreeTweedie.cs (10)
371private readonly Double _index1; // 1 minus the index parameter. 372private readonly Double _index2; // 2 minus the index parameter. 373private readonly Double _maxClamp; 410Double num = 0; 411Double denom = 0; 418var s = scores[i]; 419var w = weights == null ? 1 : weights[i]; 429var s = scores[i]; 430var w = weights == null ? 1 : weights[i]; 436var step = shrinkage * (Math.Log(num) - Math.Log(denom));
GamModelParameters.cs (2)
662var score = _pred.GetFeatureBinsAndScore(in cursor.Features, bins); 706var deltaEffect = effect - effects[bin];
GamTrainer.cs (2)
304var sumWeights = HasWeights ? TrainSet.SampleWeights.Sum() : 0; 313var sumTargets = gradient.Sum();
RandomForestClassification.cs (1)
159public Double MaximumOutputMagnitudePerTree = 100;
RandomForestRegression.cs (1)
260ISchemaBindableMapper IQuantileRegressionPredictor.CreateMapper(Double[] quantiles)
SumupPerformanceCommand.cs (7)
8using FloatType = System.Double; 247FloatType osum = 0; 251osum += (data.Outputs[i] = (FloatType)(2 * rgen.NextDouble() - 1)); 256FloatType wsum = 0; 259osum += (data.Outputs[i] = (FloatType)(2 * rgen.NextDouble() - 1)); 260wsum += (data.Weights[i] = (FloatType)(2 * rgen.NextDouble() - 1)); 281SumupInputData data = new SumupInputData(_len, 0, 0, new FloatType[_len], null, new int[_len]);
Training\DocumentPartitioning.cs (5)
16using FloatType = System.Double; 429FloatType weight = (FloatType)sampleWeights[_documents[i]]; 439FloatType weight = (FloatType)sampleWeights[_documents[i]];
Training\EnsembleCompression\LassoBasedEnsembleCompressor.cs (1)
256curLambda = Double.MaxValue; // first lambda is infinity
Training\Parallel\IParallelTraining.cs (4)
17using FloatType = System.Double; 30int[] countByBin, FloatType[] sumTargetsByBin, FloatType[] sumWeightsByBin, 148void SyncGlobalBoundary(int numFeatures, int maxBin, Double[][] binUpperBounds);
Training\Parallel\SingleTrainer.cs (1)
75void IParallelTraining.SyncGlobalBoundary(int numFeatures, int maxBin, Double[][] binUpperBounds)
Training\TreeLearners\FastForestLeastSquaresTreeLearner.cs (11)
15public RandomForestLeastSquaresTreeLearner(Dataset trainData, int numLeaves, int minDocsInLeaf, Double entropyCoefficient, Double featureFirstUsePenalty, 16Double featureReusePenalty, Double softmaxTemperature, int histogramPoolSize, int randomSeed, Double splitFraction, bool allowEmptyTrees, 17Double gainConfidenceLevel, int maxCategoricalGroupsPerNode, int maxCategoricalSplitPointsPerNode, bool quantileEnabled, int quantileSampleCount, IParallelTraining parallelTraining, 32public InternalRegressionTree FitTargets(IChannel ch, bool[] activeFeatures, Double[] weightedtargets, Double[] targets, Double[] weights) 37Double[] distributionWeights = null; 60if (infos[i].Gain > max && Rand.NextDouble() < SplitFraction || Double.IsNegativeInfinity(max))
Training\TreeLearners\LeastSquaresRegressionTreeLearner.cs (21)
18using FloatType = System.Double; 240if (Double.IsNaN(rootSplitInfo.Gain) || Double.IsNegativeInfinity(rootSplitInfo.Gain)) 712int[] countByBin, FloatType[] sumTargetsByBin, FloatType[] sumWeightsByBin, 832public readonly FloatType[] Targets; 848Targets = new FloatType[data.NumDocs]; 898+ sizeof(FloatType) * Targets.Length 899+ sizeof(FloatType) * Utils.Size(Weights) 929FloatType target = targets[docIndex]; 937FloatType weight = weights[docIndex]; 961FloatType target = targets[docIndex]; 974FloatType target = targets[docIndex]; 975FloatType weight = weights[docIndex]; 1015FloatType target = targets[i]; 1018Targets[nonZeroCount] = (FloatType)target; 1027FloatType weight = weights[i]; 1048FloatType target = targets[i]; 1058FloatType target = targets[i]; 1059FloatType weight = weights[i]; 1061Targets[i] = (FloatType)target;
TreeEnsemble\InternalRegressionTree.cs (4)
1538var trueOutput = GetOutput(mainLeaf); 1571var ghostOutput = GetOutput(ghostLeaf); 1587var ghostOutput = GetOutput(ghostLeaf); 1616var ghostOutput = GetOutput(ghostLeaf);
TreeEnsemble\InternalTreeEnsemble.cs (1)
330var maxValue = sortedByGain.First().Value;
TreeEnsemble\TreeEnsembleCombiner.cs (1)
92var scale = 1 / (double)modelCount;
Microsoft.ML.GenAI.Core (3)
Utility\AttentionMaskConverter.cs (3)
64var min = torch.finfo(dType).min; 107var min = torch.finfo(dType).min; 175var min = torch.finfo(dType).min;
Microsoft.ML.GenAI.Phi (1)
Module\Phi3SuScaledRotaryEmbedding.cs (1)
64var scale = (1.0 * this._maxPositionEmbeddings) / this._originalMaxPositionEmbeddings;
Microsoft.ML.ImageAnalytics (1)
ExtensionsCatalog.cs (1)
207/// This estimator operates over known-sized vector of <see cref="System.Single"/>, <see cref="System.Double"/> and <see cref="System.Byte"/>.</param>
Microsoft.ML.IntegrationTests (6)
Common.cs (4)
245foreach (var precision in confusionMatrix.PerClassPrecision) 248foreach (var recall in confusionMatrix.PerClassRecall) 259foreach (var dcg in metrics.DiscountedCumulativeGains) 261foreach (var ndcg in metrics.NormalizedDiscountedCumulativeGains)
DataTransformation.cs (2)
44var petalMagnitude = Math.Sqrt(petalWidth * petalWidth + petalLength * petalLength); 45var sepalMagnitude = Math.Sqrt(sepalWidth * sepalWidth + sepalLength * sepalLength);
Microsoft.ML.KMeansClustering (11)
KMeansPlusPlusTrainer.cs (11)
358var elapsedHours = stopWatch.Elapsed.TotalHours; 359var expectedHours = elapsedHours * k * (k - 1) / (checkIterations * (checkIterations - 1)); 370Double cumulativeWeight = 0; // sum of weights accumulated so far 1526private const Double FloatingPointErrorThreshold = 0.1F; 1530Double a = (Double)af; 1531Double b = (Double)bf; 1540Double relativeError; 1557return ((Double)a - (Double)b) < 0;
Microsoft.ML.LightGbm (1)
LightGbmTrainerBase.cs (1)
429field.SetValue(LightGbmTrainerOptions, Double.Parse(modelParameters[lightGbmName]));
Microsoft.ML.Mkl.Components (48)
ComputeLRTrainingStdThroughHal.cs (1)
36Double[] invHessian = null;
OlsLinearRegression.cs (47)
149private static Double ProbClamp(Double p) => Math.Max(0, Math.Min(p, 1)); 196private void ComputeOneDalRegression(IChannel ch, FloatLabelCursor.Factory cursorFactory, int m, ref Double[] beta, Double[] xtx, ref long n, ref Double yMean) 198var xty = new Double[m]; 207var labelsArray = new Double[batchSize]; 208var featuresArray = new Double[(m - 1) * batchSize]; 304private void ComputeMklRegression(IChannel ch, FloatLabelCursor.Factory cursorFactory, int m, ref Double[] beta, Double[] xtx, ref long n, ref Double yMean) 306var xty = new Double[m]; 375Double squared = _l2Weight * _l2Weight * n; 429var xtx = new Double[m * (m + 1) / 2]; 430var beta = new Double[m]; 431Double yMean = 0; 455Double rss = 0; // residual sum of squares 456Double tss = 0; // total sum of squares 472var rSquared = ProbClamp(1 - (rss / tss)); 482rSquaredAdjusted = Double.NaN; 490ch.Assert(!Double.IsNaN(rSquaredAdjusted)); 491var standardErrors = new Double[m]; 492var tValues = new Double[m]; 493var pValues = new Double[m]; 494var s2 = rss / (n - m); // estimate of variance of y 553private static extern int PptrfInternal(Layout layout, UpLo uplo, int n, Double[] ap); 565public static void Pptrf(Layout layout, UpLo uplo, int n, Double[] ap) 588private static extern int PptrsInternal(Layout layout, UpLo uplo, int n, int nrhs, Double[] ap, Double[] b, int ldb); 604public static void Pptrs(Layout layout, UpLo uplo, int n, int nrhs, Double[] ap, Double[] b, int ldb) 635private static extern int PptriInternal(Layout layout, UpLo uplo, int n, Double[] ap); 647public static void Pptri(Layout layout, UpLo uplo, int n, Double[] ap) 771Double[] standardErrors = null, Double[] tValues = null, Double[] pValues = null, Double rSquared = 1, Double rSquaredAdjusted = float.NaN) 779Contracts.Assert(!Double.IsNaN(rSquaredAdjusted) || standardErrors == null); 783Contracts.Assert(Double.IsNaN(rSquaredAdjusted) || (0 <= rSquaredAdjusted && rSquaredAdjusted <= 1)); 824if (!Double.IsNaN(RSquaredAdjusted)) 827Host.CheckDecode(!Double.IsNaN(RSquaredAdjusted) || !hasStats); 864Contracts.Assert(Double.IsNaN(RSquaredAdjusted) || (0 <= RSquaredAdjusted && RSquaredAdjusted <= 1)); 866Contracts.Assert(!Double.IsNaN(RSquaredAdjusted) || !HasStatistics); 881private static void TValueCheckDecode(Double param, Double tvalue) 886private static void ProbCheckDecode(Double p)
Microsoft.ML.OnnxTransformer (3)
OnnxTypeParser.cs (1)
60scalarType = typeof(System.Double);
OnnxUtils.cs (2)
497typeof(Double), 514{ typeof(Double) , InternalDataKind.R8},
Microsoft.ML.Parquet (6)
ParquetLoader.cs (6)
525return CreateGetterDelegateCore<double?, Double>(col, _parquetConversions.Conv); 527return CreateGetterDelegateCore<decimal?, Double>(col, _parquetConversions.Conv); 707public void Conv(in double? src, ref Double dst) => dst = src ?? Double.NaN; 709public void Conv(in decimal? src, ref Double dst) => dst = src != null ? Decimal.ToDouble((decimal)src) : Double.NaN;
Microsoft.ML.PCA (3)
PcaTrainer.cs (1)
221Double memoryUsageEstimate = 2.0 * dimension * oversampledRank * sizeof(float) / 1e9;
PcaTransformer.cs (2)
406Double[] totalColWeight = new Double[_numColumns];
Microsoft.ML.Predictor.Tests (8)
TestParallelFasttreeInterface.cs (1)
127public void SyncGlobalBoundary(int numFeatures, int maxBin, Double[][] binUpperBounds)
TestTransposer.cs (7)
106int rowCount, Double density, Random rgen, Func<T> generator, int slotCount, params int[] forceDenseSlot) 139private static T[] GenerateHelper<T>(int rowCount, Double density, Random rgen, Func<T> generator) 193TransposeCheckHelper<Double>(view, 1, trans); // B check. 194TransposeCheckHelper<Double>(view, 3, trans); // D check. 210TransposeCheckHelper<Double>(view, 3, trans); // D check. 253TransposeCheckHelper<Double>(view, 1, loader); // B 255TransposeCheckHelper<Double>(view, 3, loader); // D
Microsoft.ML.ResultProcessor (7)
ResultProcessor.cs (7)
580Double metricValue; 598Double metricValue; 693public static void ProcessResultLines(string filename, string metricName, out Double metricValue) 788private static Dictionary<string, ResultMetric> ParseResultLines(List<string> fileResults, ResultProcessorArguments cmd, out Double metricValue, string metricName) 799Double doubleValue = Double.Parse(matchNameValueDeviation.Groups["value"].Value, CultureInfo.InvariantCulture); 801float deviation = (float)Double.Parse(matchNameValueDeviation.Groups["deviation"].Value, CultureInfo.InvariantCulture);
Microsoft.ML.Samples (6)
Dynamic\DataOperations\LoadingText.cs (1)
33var value = random.NextDouble();
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportance.cs (1)
105var max = bias + 4.5 * weight1 + 4.5 * weight2 + 0.5;
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportanceLoadFromDisk.cs (1)
114var max = bias + 4.5 * weight1 + 4.5 * weight2 + 0.5;
Dynamic\Trainers\Ranking\PermutationFeatureImportance.cs (1)
115var max = bias + 4.5 * weight1 + 4.5 * weight2 + 0.5;
Dynamic\Trainers\Ranking\PermutationFeatureImportanceLoadFromDisk.cs (1)
122var max = bias + 4.5 * weight1 + 4.5 * weight2 + 0.5;
Dynamic\Transforms\CalculateFeatureContributionCalibrated.cs (1)
136var value = bias + weight1 * data.Feature1 + weight2 * data.Feature2
Microsoft.ML.SearchSpace (12)
Option\UniformNumericOption.cs (10)
59var x = param.AsType<double>(); 63var logMax = Math.Log(Max); 64var logMin = Math.Log(Min); 65var logX = Math.Log(x); 79var value = values[0]; 84var order = Math.Pow(Max / Min, value); 85var res = Min * order; 142var doubleValue = Convert.ToDouble(singleValue); 149var doubleValue = base.SampleFromFeatureSpace(values).AsType<double>(); 189var valueAsDouble = Convert.ToDouble(value);
Tuner\GridSearchTuner.cs (2)
35foreach (var i in arrays.First()) 42foreach (var i in arrays.First())
Microsoft.ML.StandardTrainers (62)
Standard\LogisticRegression\LbfgsPredictorBase.cs (4)
161private protected Double WeightSum; 604Double totalCount = data.Data.GetRowCount() ?? Double.NaN; 776Double r = 0;
Standard\LogisticRegression\LogisticRegression.cs (3)
249Double regLoss = 0; 258Double priorPosRate = _posWeight / WeightSum; 323var hessian = new Double[hessianDimension];
Standard\LogisticRegression\MulticlassLogisticRegression.cs (3)
123private Double[] _prior; 178_prior = new Double[_numClasses]; 335Double regLoss = 0;
Standard\ModelStatistics.cs (1)
411const Double sqrt2 = 1.41421356237; // Math.Sqrt(2);
Standard\MulticlassClassification\OneVersusAllTrainer.cs (1)
751Double sum = 0;
Standard\MulticlassClassification\PairwiseCouplingTrainer.cs (2)
380var value = buffer[i] = Pi(i, buffer); 401var pii = buffer[index + i];
Standard\Online\AveragedLinear.cs (1)
226Double loss = _loss.Loss(output, label);
Standard\PoissonRegression\PoissonRegression.cs (1)
73private Double _lossNormalizer;
Standard\SdcaBinary.cs (31)
135private protected float WScaledDot(in VBuffer<float> features, Double scaling, in VBuffer<float> weights, float bias) 493var bestPrimalLoss = double.PositiveInfinity; 553Double[] metrics; 737private void InitializeConvergenceMetrics(out string[] names, out Double[] initialValues) 740initialValues = new Double[] { Double.PositiveInfinity, 0, Double.PositiveInfinity, 0, 0, 0 }; 958Double[] metrics, 959ref Double bestPrimalLoss, 964var reportedValues = new Double?[metrics.Length + 1]; 982Double subLoss = Loss.Loss(output, cursor.Label); 984Double subDualLoss = Loss.DualLoss(cursor.Label, duals[idx]); 994Double l2Const = SdcaTrainerOptions.L2Regularization.Value; 995Double l1Threshold = SdcaTrainerOptions.L1Regularization.Value; 996Double l1Regularizer = l1Threshold * l2Const * (VectorUtils.L1Norm(in weights[0]) + Math.Abs(biasReg[0])); 1000var loss = metrics[(int)MetricKind.Loss]; 1004var dualityGap = metrics[(int)MetricKind.DualityGap] = newLoss - newDualLoss; 1007metrics[(int)MetricKind.L1Sparsity] = SdcaTrainerOptions.L1Regularization == 0 ? 1 : (Double)firstWeights.GetValues().Count(w => w != 0) / weights.Length; 1422private Double _roundOffError; 1423private Double _sum; 1425public Double Sum => _sum; 1427public void Add(Double summand) 1429var compensated = summand - _roundOffError; 1430var sum = _sum + compensated; 2064Double loss = Math.Log(2); // for log loss, this is exact; for Hinge, it's a reasonable estimate 2065Double improvement = 0; // exponentially weighted moving average of improvements 2074Double trainTime = watch.Elapsed.TotalSeconds; 2085Double subLoss = lossFunc.Loss(WScaledDot(in features, weightScaling, in weights, bias), cursor.Label); 2110var ilr = _options.LearningRate; 2133Double rate = ilr / (1 + ilr * l2Weight * (t++)); 2134Double step = -derivative * rate;
Standard\SdcaMulticlass.cs (15)
353Double[] metrics, 354ref Double bestPrimalLoss, 366var reportedValues = new Double?[metrics.Length + 1]; 384Double subLoss = 0; 385Double subDualLoss = 0; 413Double l2Const = SdcaTrainerOptions.L2Regularization.Value; 414Double l1Threshold = SdcaTrainerOptions.L1Regularization.Value; 416Double weightsL1Norm = 0; 417Double weightsL2NormSquared = 0; 418Double biasRegularizationAdjustment = 0; 426Double l1Regularizer = SdcaTrainerOptions.L1Regularization.Value * l2Const * weightsL1Norm; 427var l2Regularizer = l2Const * weightsL2NormSquared * 0.5; 429var newLoss = lossSum.Sum / count + l2Regularizer + l1Regularizer; 430var newDualLoss = dualLossSum.Sum / count - l2Regularizer - l2Const * biasRegularizationAdjustment; 431var dualityGap = newLoss - newDualLoss;
Microsoft.ML.Sweeper (35)
Algorithms\SweeperProbabilityUtils.cs (1)
139if (total <= Double.Epsilon)
ISweeper.cs (5)
51IParameterValue CreateFromNormalized(Double normalizedValue); 205public sealed class RunResult : IRunResult<Double> 208private readonly Double? _metricValue; 222public RunResult(ParameterSet parameterSet, Double metricValue, bool isMetricMaximizing) 234public Double MetricValue
Parameters.cs (28)
39public Double? StepSize = null; 230public IParameterValue CreateFromNormalized(Double normalizedValue) 236var logBase = !_options.StepSize.HasValue 239var logMax = Math.Log(_options.Max, logBase); 240var logMin = Math.Log(_options.Min, logBase); 266var logBase = _options.StepSize ?? Math.Pow(1.0 * _options.Max / _options.Min, 1.0 / (_options.NumSteps - 1)); 269var maxPlusEpsilon = _options.Max * Math.Sqrt(logBase); 270for (Double value = _options.Min; value <= maxPlusEpsilon; value *= logBase) 280var stepSize = _options.StepSize ?? (Double)(_options.Max - _options.Min) / (_options.NumSteps - 1); 282var maxPlusEpsilon = _options.Max + stepSize / 2; 283for (Double value = _options.Min; value <= maxPlusEpsilon; value += stepSize) 362public IParameterValue CreateFromNormalized(Double normalizedValue) 368var logBase = !_options.StepSize.HasValue 371var logMax = Math.Log(_options.Max, logBase); 372var logMin = Math.Log(_options.Min, logBase); 390var logBase = _options.StepSize ?? Math.Pow(1.0 * _options.Max / _options.Min, 1.0 / (_options.NumSteps - 1)); 393var maxPlusEpsilon = _options.Max * Math.Sqrt(logBase); 394for (Double value = _options.Min; value <= maxPlusEpsilon; value *= logBase) 404var stepSize = _options.StepSize ?? (Double)(_options.Max - _options.Min) / (_options.NumSteps - 1); 406var maxPlusEpsilon = _options.Max + stepSize / 2; 407for (Double value = _options.Min; value <= maxPlusEpsilon; value += stepSize) 481public IParameterValue CreateFromNormalized(Double normalizedValue) 572Double stepSize = -1; 594stepSize = Double.Parse(option.Substring(option.IndexOf(':') + 1), CultureInfo.InvariantCulture); 627generatorOptions.StepSize = (stepSize > 0 ? stepSize : new Nullable<Double>()); 651floatOptions.StepSize = (stepSize > 0 ? stepSize : new Nullable<Double>());
SweepResultEvaluator.cs (1)
76Double result;
Microsoft.ML.TensorFlow (1)
TensorflowTransform.cs (1)
614var d = numOfUnkDim > 0 ? Math.Pow(typeValueCount / valCount, 1.0 / numOfUnkDim) : 0;
Microsoft.ML.TestFramework (13)
DataPipe\TestDataPipe.cs (10)
30private static Double[] _dataDouble = new Double[] { -0.0, 0, 1, -1, 2, -2, Double.NaN, Double.MinValue, 31Double.MaxValue, Double.Epsilon, Double.NegativeInfinity, Double.PositiveInfinity }; 34private static VBuffer<Double> _dataDoubleSparse = new VBuffer<Double>(5, 3, new double[] { -0.0, 0, 1 }, new[] { 0, 3, 4 });
DataPipe\TestDataPipeBase.cs (3)
984private const Double DoubleEps = 1e-9; 986private static bool EqualWithEpsDouble(Double x, Double y)
Microsoft.ML.Tests (33)
ExpressionLanguageTests\ExpressionLanguageTests.cs (7)
39using R8 = Double; 383var v = (Double)src; 491FunctionProviderUtils.Fn<R8, R8>(Dump), 497FunctionProviderUtils.Fn<TX, R8, R8>(Dump),
Scenarios\ClusteringTests.cs (1)
46var shift = (rand.NextDouble() - 0.5) / 10;
TextLoaderTests.cs (20)
1475Double baselineDoub1 = default; 1476Double baselineDoub2 = default; 1477Double baselineDoub3 = default; 1478Double baselineDoub4 = default; 1489Double testDoub1 = default; 1490Double testDoub2 = default; 1491Double testDoub3 = default; 1492Double testDoub4 = default; 1493VBuffer<Double> testDoubFt1 = default; 1494VBuffer<Double> testDoubFt2 = default; 1506var delegateBaselineDoub1 = cursorBaseline.GetGetter<Double>(baselineDV.Schema["doub1"]); 1507var delegateBaselineDoub2 = cursorBaseline.GetGetter<Double>(baselineDV.Schema["doub2"]); 1508var delegateBaselineDoub3 = cursorBaseline.GetGetter<Double>(baselineDV.Schema["doub3"]); 1509var delegateBaselineDoub4 = cursorBaseline.GetGetter<Double>(baselineDV.Schema["doub4"]); 1520var delegateTestDoub1 = cursorTest.GetGetter<Double>(testDV.Schema["doub1"]); 1521var delegateTestDoub2 = cursorTest.GetGetter<Double>(testDV.Schema["doub2"]); 1522var delegateTestDoub3 = cursorTest.GetGetter<Double>(testDV.Schema["doub3"]); 1523var delegateTestDoub4 = cursorTest.GetGetter<Double>(testDV.Schema["doub4"]); 1524var delegateTestDoubFt1 = cursorTest.GetGetter<VBuffer<Double>>(testDV.Schema["doubFt1"]); 1525var delegateTestDoubFt2 = cursorTest.GetGetter<VBuffer<Double>>(testDV.Schema["doubFt2"]);
TrainerEstimators\TreeEstimators.cs (5)
110var sigmoid = .789; 365var sigmoid = .789; 587var sigmoidScale = .790; 624var firstSigmoidScale = .790; 625var secondSigmoidScale = .2;
Microsoft.ML.TimeSeries (178)
AdaptiveSingularSpectrumSequenceModeler.cs (27)
42public Double Growth; 44public Double Ratio { get { return Math.Pow(Growth, 1d / TimeSpan); } } 134public Double ExponentialTrendFactor; 158private readonly Double _maxTrendRatio; 281_maxTrendRatio = maxGrowth == null ? Double.PositiveInfinity : ((GrowthRatio)maxGrowth).Ratio; 662Double minErr = Double.MaxValue; 672Double error; 673Double sumSingularVals = 0; 755Double minErr = Double.MaxValue; 764Double error; 826public Double Phase; 830public SignalComponent(Double phase, int index) 860var coeff = new Double[_windowSize - 1]; 864Double maxTrendMagnitude = Double.NegativeInfinity; 865Double maxNonTrendMagnitude = Double.NegativeInfinity; 866Double eps = 1e-9; 867Double highFrequenceyBoundry = Math.PI / 2; 952Double largestSeasonalityPhase = 0; 959Double avgPhase = 0; 960Double avgMagnitude = 0; 1046var smallTrendMagnitude = Math.Min(maxTrendMagnitude, (maxTrendMagnitude + 1) / 2); 1062var phase = roots[i].Phase; 1518var z = ProbabilityFunctions.Probit(0.5 + confidenceLevel / 2.0);
EigenUtils.cs (8)
526Double[] a = new Double[n2]; 528Double[] d = new Double[size]; 529Double[] e = new Double[size - 1]; 530Double[] tau = new Double[size];
ExtensionsCatalog.cs (14)
23/// The column data is a vector of <see cref="System.Double"/>. The vector contains 4 elements: alert (non-zero value means a change point), raw score, p-Value and martingale score.</param> 48/// The column data is a vector of <see cref="System.Double"/>. The vector contains 4 elements: alert (non-zero value means a change point), raw score, p-Value and martingale score.</param> 72/// The column data is a vector of <see cref="System.Double"/>. The vector contains 3 elements: alert (non-zero value means a spike), raw score, and p-value.</param> 97/// The column data is a vector of <see cref="System.Double"/>. The vector contains 3 elements: alert (non-zero value means a spike), raw score, and p-value.</param> 120/// The column data is a vector of <see cref="System.Double"/>. The vector contains 4 elements: alert (non-zero value means a change point), raw score, p-Value and martingale score.</param> 149/// The column data is a vector of <see cref="System.Double"/>. The vector contains 4 elements: alert (non-zero value means a change point), raw score, p-Value and martingale score.</param> 188/// The column data is a vector of <see cref="System.Double"/>. The vector contains 3 elements: alert (non-zero value means a spike), raw score, and p-value.</param> 215/// The column data is a vector of <see cref="System.Double"/>. The vector contains 3 elements: alert (non-zero value means a spike), raw score, and p-value.</param> 240/// The column data is a vector of <see cref="System.Double"/>. The vector contains 3 elements: alert (1 means anomaly while 0 means normal), raw score, and magnitude of spectual residual.</param> 265/// The column data is a vector of <see cref="System.Double"/>. The length of this vector varies depending on <paramref name="detectMode"/>.</param> 266/// <param name="inputColumnName">Name of column to process. The column data must be <see cref="System.Double"/>.</param> 305/// The column data is a vector of <see cref="System.Double"/>. The length of this vector varies depending on <paramref name="options.DetectMode"/>.</param> 306/// <param name="inputColumnName">Name of column to process. The column data must be <see cref="System.Double"/>.</param> 398/// <param name="inputColumnName">Name of column to process. The column data must be <see cref="System.Double"/>.</param>
IidChangePointDetector.cs (3)
124InternalTransform.AlertThreshold = Double.MaxValue; 222/// <seealso cref="Microsoft.ML.TimeSeriesCatalog.DetectIidChangePoint(Microsoft.ML.TransformsCatalog,System.String,System.String,System.Double,System.Int32,Microsoft.ML.Transforms.TimeSeries.MartingaleType,System.Double)" />
IidSpikeDetector.cs (1)
202/// <seealso cref="Microsoft.ML.TimeSeriesCatalog.DetectIidSpike(Microsoft.ML.TransformsCatalog,System.String,System.String,System.Double,System.Int32,Microsoft.ML.Transforms.TimeSeries.AnomalySide)" />
PercentileThresholdTransform.cs (4)
43public Double Percentile = 1; 51public const Double MinPercentile = 0; 52public const Double MaxPercentile = 100; 65private readonly Double _percentile;
PolynomialUtils.cs (19)
18private static Double _tol; 25internal static void FindQuadraticRoots(Double b, Double c, out Complex root1, out Complex root2) 27var delta = b * b - 4 * c; 28var sqrtDelta = Math.Sqrt(Math.Abs(delta)); 42private static void CreateFullCompanionMatrix(Double[] coefficients, ref Double[] companionMatrix) 49companionMatrix = new Double[n2]; 69public static bool FindPolynomialRoots(Double[] coefficients, ref Complex[] roots, 70int roundOffDigits = 6, Double doublePrecision = 2.22 * 1e-100) 105coeff = new Double[n - i]; 114Double[] companionMatrix = null; 115var realPart = new Double[n - i]; 116var imaginaryPart = new Double[n - i]; 117var dummy = new Double[1]; 279public static bool FindPolynomialCoefficients(Complex[] roots, ref Double[] coefficients) 293if (Double.IsNaN(roots[i].Real) || Double.IsNaN(roots[i].Imaginary)) 377coefficients = new Double[n];
RootCauseAnalyzer.cs (9)
264if (Double.IsNaN(gain)) 272if (Double.IsInfinity(gainRatio)) 311if (Double.IsNaN(entropy)) 313entropy = Double.MaxValue; 319if (Double.IsInfinity(gainRatio)) 498bool isRatioNan = Double.IsNaN(valueRatioMap[best]); 535private BestDimension GetBestDimension(BestDimension best, KeyValuePair<BestDimension, double> dimension, Dictionary<BestDimension, Double> valueRatioMap) 618if (Double.IsNaN(a)) 720private double Log2(double val) => Double.IsNaN(val) ? 0 : Math.Log(val) / Math.Log(2);
SeasonalityDetector.cs (3)
44/// <param name="inputColumnName">Name of column to process. The column data must be <see cref="System.Double"/>.</param> 279var typicalEnergy = medianAggregator.Median; 319var currentEnergy = values[i].Real;
SequentialAnomalyDetectionTransformBase.cs (34)
108public Double PowerMartingaleEpsilon = 0.1; 112public Double AlertThreshold; 126internal abstract class SequentialAnomalyDetectionTransformBase<TInput, TState> : SequentialTransformerBase<TInput, VBuffer<Double>, TState> 136internal Double PowerMartingaleEpsilon; 142internal Double AlertThreshold; 148internal const Double MinPValue = 1e-8; 151internal const Double MaxPValue = 1 - MinPValue; 169AnomalySide anomalySide, MartingaleType martingale, AlertingScore alertingScore, Double powerMartingaleEpsilon, 170Double alertThreshold) 272internal Double LogPowerMartigaleBettingFunc(Double p, Double epsilon) 288internal Double LogMixtureMartigaleBettingFunc(Double p) 294Double logP = Math.Log(p); 423internal abstract class AnomalyDetectionStateBase : SequentialTransformerBase<TInput, VBuffer<Double>, TState>.StateBase 429private FixedSizeQueue<Double> LogMartingaleUpdateBuffer { get; set; } 435private Double _logMartingaleValue; 439private Double _sumSquaredDist; 443protected Double LatestMartingaleScore => Math.Exp(_logMartingaleValue); 475private Double ComputeKernelPValue(Double rawScore) 483Double pValue = 0; 484Double bandWidth = Math.Sqrt(2) * ((n == 1) ? 1 : Math.Sqrt(_sumSquaredDist) / n); 487Double diff; 511private protected override void SetNaOutput(ref VBuffer<Double> dst) 517editor.Values[i] = Double.NaN; 522public sealed override void TransformCore(ref TInput input, FixedSizeQueue<TInput> windowedBuffer, long iteration, ref VBuffer<Double> dst) 531result.Values[i] = Double.NaN; 536if (Double.IsNaN(result.Values[1])) 589Double martingaleUpdate = 0; 663LogMartingaleUpdateBuffer = new FixedSizeQueue<Double>(WindowSize == 0 ? 1 : WindowSize); 665LogMartingaleUpdateBuffer = new FixedSizeQueue<Double>(1); 688private protected abstract Double ComputeRawAnomalyScore(ref TInput input, FixedSizeQueue<TInput> windowedBuffer, long iteration);
SrCnnEntireAnomalyDetector.cs (13)
496_minimumOriginValue = Double.MaxValue; 497_maximumOriginValue = Double.MinValue; 499var sum = 0.0; 500var squareSum = 0.0; 505var value = values[i]; 622var score = CalculateScore(_ifftMagList[i], _cumSumList[i]); 633var zscore = Math.Abs(values[i] - _mean) / _std; 655var predictedValue = PredictNext(_predictArray); 744var margin = CalculateMargin(_units[i], sensitivity); 840var margin = CalculateMargin(_units[i], sensitivity); 881var boundMargin = CalculateMargin(unit, _boundSensitivity); 947var a = ((n * sumXY) - (sumX * sumY)) / ((n * sumXX) - (sumX * sumX)); 948var b = ((sumXX * sumY) - (sumX * sumXY)) / ((n * sumXX) - (sumX * sumX));
SrCnnTransformBase.cs (4)
54internal abstract class SrCnnTransformBase<TInput, TState> : SequentialTransformerBase<TInput, VBuffer<Double>, TState> 70int backAddWindowSize, int lookaheadWindowSize, int averagingWindowSize, int judgementWindowSize, Double alertThreshold) 263internal abstract class SrCnnStateBase : SequentialTransformerBase<TInput, VBuffer<Double>, TState>.StateBase 300result.Values.Fill(Double.NaN);
SsaAnomalyDetectionBase.cs (20)
31public static double SignedDifference(double actual, Double predicted) 36public static Double AbsoluteDifference(Double actual, Double predicted) 41public static Double SignedProportion(Double actual, Double predicted) 46public static Double AbsoluteProportion(Double actual, Double predicted) 51public static Double SquaredDifference(Double actual, Double predicted) 53Double temp = actual - predicted; 57public static Func<Double, Double, Double> GetErrorFunction(ErrorFunction errorFunction) 188internal readonly Func<Double, Double, Double> ErrorFunc;
SsaChangePointDetector.cs (3)
134InternalTransform.AlertThreshold = Double.MaxValue; 229/// <seealso cref="Microsoft.ML.TimeSeriesCatalog.DetectChangePointBySsa(Microsoft.ML.TransformsCatalog,System.String,System.String,System.Double,System.Int32,System.Int32,System.Int32,Microsoft.ML.Transforms.TimeSeries.ErrorFunction,Microsoft.ML.Transforms.TimeSeries.MartingaleType,System.Double)" />
SsaSpikeDetector.cs (1)
210/// <seealso cref="Microsoft.ML.TimeSeriesCatalog.DetectSpikeBySsa(Microsoft.ML.TransformsCatalog,System.String,System.String,System.Double,System.Int32,System.Int32,System.Int32,Microsoft.ML.Transforms.TimeSeries.AnomalySide,Microsoft.ML.Transforms.TimeSeries.ErrorFunction)" />
TrajectoryMatrix.cs (15)
51private Double[] _cachedSeriesFftRe; 56private Double[] _cachedSeriesFftIm; 58private Double[] _allZerosIm; 59private Double[] _inputRe; 60private Double[] _outputRe; 61private Double[] _outputIm; 154private static Single RoundUpToReal(Double re, Double im, Double coeff = 1) 163_cachedSeriesFftRe = new Double[_seriesLength]; 164_cachedSeriesFftIm = new Double[_seriesLength]; 165_allZerosIm = new Double[_seriesLength]; 166_inputRe = new Double[_seriesLength]; 167_outputIm = new Double[_seriesLength]; 168_outputRe = new Double[_seriesLength];
Microsoft.ML.TorchSharp (2)
NasBert\Modules\ConvSeparable.cs (1)
28var std = Math.Sqrt((4 * (1.0 - dropout)) / (kernelSize * inChannels));
NasBert\Modules\Embedding\SinusoidalPositionalEmbedding.cs (1)
38var embedDouble = Math.Log(10000) / (halfDim - 1);
Microsoft.ML.TorchSharp.Tests (2)
TextClassificationTests.cs (2)
449var pearson = Correlation.Pearson(predictions, targets); 451var spearman = Correlation.Spearman(predictions, targets);
Microsoft.ML.Transforms (239)
Dracula\CountTable.cs (1)
76var d = 1.0 / LabelCardinality;
Dracula\DictCountTable.cs (1)
225if (!_tables[labelKey].TryGetValue(key, out var old))
Expression\BuiltinFunctions.cs (127)
25using R8 = Double; 40if (type == typeof(R8)) 41return R8.IsNaN((R8)v); 54if (type == typeof(R8)) 55return R8.NaN; 146return FunctionProviderUtils.Ret(FunctionProviderUtils.Fn<R8>(Pi)); 151FunctionProviderUtils.Fn<R8, R8>(NA)); 157FunctionProviderUtils.Fn<R8, R8>(Default), 166FunctionProviderUtils.Fn<R8, R8>(Math.Abs)); 172FunctionProviderUtils.Fn<R8, R8>(Sign)); 176FunctionProviderUtils.Fn<R8, R8>(Math.Exp)); 180FunctionProviderUtils.Fn<R8, R8>(Math.Log)); 184FunctionProviderUtils.Fn<R8, R8>(Math.Log), 186FunctionProviderUtils.Fn<R8, R8, R8>(Math.Log)); 192FunctionProviderUtils.Fn<R8, R8>(Deg)); 197FunctionProviderUtils.Fn<R8, R8>(Rad)); 202FunctionProviderUtils.Fn<R8, R8>(Sin)); 206FunctionProviderUtils.Fn<R8, R8>(SinD)); 210FunctionProviderUtils.Fn<R8, R8>(Cos)); 214FunctionProviderUtils.Fn<R8, R8>(CosD)); 218FunctionProviderUtils.Fn<R8, R8>(Math.Tan)); 222FunctionProviderUtils.Fn<R8, R8>(TanD)); 227FunctionProviderUtils.Fn<R8, R8>(Math.Asin)); 231FunctionProviderUtils.Fn<R8, R8>(Math.Acos)); 235FunctionProviderUtils.Fn<R8, R8>(Math.Atan)); 240FunctionProviderUtils.Fn<R8, R8, R8>(Atan2)); 245FunctionProviderUtils.Fn<R8, R8>(Math.Sinh)); 249FunctionProviderUtils.Fn<R8, R8>(Math.Cosh)); 253FunctionProviderUtils.Fn<R8, R8>(Math.Tanh)); 258FunctionProviderUtils.Fn<R8, R8>(Math.Sqrt)); 264FunctionProviderUtils.Fn<R8, R8>(Math.Truncate)); 268FunctionProviderUtils.Fn<R8, R8>(Math.Floor)); 273FunctionProviderUtils.Fn<R8, R8>(Math.Ceiling)); 277FunctionProviderUtils.Fn<R8, R8>(Math.Round)); 284FunctionProviderUtils.Fn<R8, R8, R8>(Math.Min)); 290FunctionProviderUtils.Fn<R8, R8, R8>(Math.Max)); 316FunctionProviderUtils.Fn<R8, BL>(IsNA)); 326FunctionProviderUtils.Fn<R8, I4>(Convert.ToInt32), 334FunctionProviderUtils.Fn<R8, I8>(Convert.ToInt64), 344FunctionProviderUtils.Fn<R8, R4>(ToR4), 349FunctionProviderUtils.Fn<I4, R8>(Convert.ToDouble), 350FunctionProviderUtils.Fn<I8, R8>(Convert.ToDouble), 351FunctionProviderUtils.Fn<R4, R8>(ToR8), 352FunctionProviderUtils.Fn<R8, R8>(ToR8), 353FunctionProviderUtils.Fn<BL, R8>(Convert.ToDouble), 354FunctionProviderUtils.Fn<TX, R8>(ToR8)); 360FunctionProviderUtils.Fn<R8, TX>(ToTX), 384if (type == typeof(R8)) 385return R8.NaN; 399if (type == typeof(R8)) 400return default(R8); 425public static R8 Pi() 437public static R8 NA(R8 a) 439return R8.NaN; 461public static R8 Default(R8 a) 463return default(R8); 487public static R8 Sign(R8 a) 537public static R8 Deg(R8 a) 549public static R8 Rad(R8 a) 561public static R8 Sin(R8 a) 573public static R8 SinD(R8 a) 585public static R8 Cos(R8 a) 597public static R8 CosD(R8 a) 615public static R8 TanD(R8 a) 649public static R8 Atan2(R8 a, R8 b) 653if (R8.IsInfinity(a) && R8.IsInfinity(b)) 654return R8.NaN; 839public static BL IsNA(R8 a) 841return R8.IsNaN(a); 875public static R4 ToR4(R8 a) 888public static R8 ToR8(R4 a) 890return (R8)a; 894public static R8 ToR8(R8 a) 902public static R8 ToR8(TX a) 904R8 res = default(R8); 912public static TX ToTX(R8 src) => src.ToString("G17", CultureInfo.InvariantCulture).AsMemory();
Expression\CodeGen.cs (9)
18using R8 = Double; 251Contracts.Assert(value is R8); 252_gen.Ldc_R8((R8)value); 312Contracts.Assert(value is R8); 313_gen.Ldc_R8((R8)value); 661CallBin<R8>(Math.Pow); 857typeLoc = typeof(R8); 997var x = (R8)val;
Expression\LambdaBinder.cs (52)
19using R8 = Double; 278node.SetValue(-(R8?)arg.ExprValue); 489R8? v1; 490R8? v2; 652private void ReduceBinOp(BinaryOpNode node, R8? a, R8? b) 659var v = a.Value; 663if (!R8.IsNaN(v)) 669if (R8.IsNaN(v)) 675if (R8.IsNaN(v)) 683if (R8.IsNaN(v)) 691var v = b.Value; 695if (R8.IsNaN(v)) 699if (R8.IsNaN(v)) 705if (R8.IsNaN(v)) 713if (R8.IsNaN(v)) 792private R8 BinOp(BinaryOpNode node, R8 v1, R8 v2) 797return !R8.IsNaN(v1) ? v1 : v2; 812return R8.NaN; 926R8? v1; 927R8? v2; 1525R8? val; 1784(a,b) => { var x = Cast<R8>(a); var y = Cast<R8>(b); if (x == y) return true; if (!R8.IsNaN(x) && !R8.IsNaN(y)) return false; return null; }, 1798(a,b) => { var x = Cast<R8>(a); var y = Cast<R8>(b); if (x == y) return false; if (!R8.IsNaN(x) && !R8.IsNaN(y)) return true; return null; }, 1812(a,b) => { var x = Cast<R8>(a); var y = Cast<R8>(b); if (x < y) return true; if (x >= y) return false; return null; }, 1826(a,b) => { var x = Cast<R8>(a); var y = Cast<R8>(b); if (x <= y) return true; if (x > y) return false; return null; }, 1840(a,b) => { var x = Cast<R8>(a); var y = Cast<R8>(b); if (x > y) return true; if (x <= y) return false; return null; }, 1854(a,b) => { var x = Cast<R8>(a); var y = Cast<R8>(b); if (x >= y) return true; if (x < y) return false; return null; },
Expression\Node.cs (10)
18using R8 = Double; 357return typeof(R8); 375if (type == typeof(R8)) 438public void SetValue(R8 value) 444public void SetValue(R8? value) 496ExprValue = (R8)(I4)ExprValue; 501ExprValue = (R8)(I8)ExprValue; 506ExprValue = (R8)(R4)ExprValue; 570public bool TryGet(out R8? value) 584value = (R8?)ExprValue;
Expression\Printer.cs (4)
16using R8 = Double; 230Show((R8)value); 262private void Show(R8 x) 264if (R8.IsNaN(x))
ExtensionsCatalog.cs (3)
27/// This estimator operates over scalar or vector of <see cref="System.Single"/> or <see cref="System.Double"/>.</param> 45/// <param name="columns">The pairs of input and output columns. This estimator operates over data which is either scalar or vector of <see cref="System.Single"/> or <see cref="System.Double"/>.</param> 67/// This estimator operates over scalar or vector of <see cref="System.Single"/> or <see cref="System.Double"/>.</param>
MutualInformationFeatureSelection.cs (8)
537var tmp = default(VBuffer<Double>); 616(ref VBuffer<Double> src, ref VBuffer<int> dst, out int min, out int lim) => 840private void BinDoubles(in VBuffer<Double> input, ref VBuffer<int> output, 847var val = inputValues[i]; 848if (!Double.IsNaN(val)) 855ValueMapper<Double, int> mapper = 856(in Double src, ref int dst) => 857dst = Double.IsNaN(src) ? offset : offset + 1 + bounds.FindIndexSorted(src);
NormalizerCatalog.cs (14)
41/// The data type on this column should be <see cref="System.Single"/>, <see cref="System.Double"/> or a known-sized vector of those types.</param> 65/// The input columns must be of data type <see cref="System.Single"/>, <see cref="System.Double"/> or a known-sized vector of those types. 90/// The data type on this column should be <see cref="System.Single"/>, <see cref="System.Double"/> or a known-sized vector of those types.</param> 116/// The input columns must be of data type <see cref="System.Single"/>, <see cref="System.Double"/> or a known-sized vector of those types. 136/// The data type on this column should be <see cref="System.Single"/>, <see cref="System.Double"/> or a known-sized vector of those types.</param> 160/// The input columns must be of data type <see cref="System.Single"/>, <see cref="System.Double"/> or a known-sized vector of those types. 179/// The data type on this column should be <see cref="System.Single"/>, <see cref="System.Double"/> or a known-sized vector of those types.</param> 205/// The input columns must be of data type <see cref="System.Single"/>, <see cref="System.Double"/> or a known-sized vector of those types. 225/// The data type on this column should be <see cref="System.Single"/>, <see cref="System.Double"/> or a known-sized vector of those types.</param> 251/// The input columns must be of data type <see cref="System.Single"/>, <see cref="System.Double"/> or a known-sized vector of those types. 278/// The data type on this column should be <see cref="System.Single"/>, <see cref="System.Double"/> or a known-sized vector of those types.</param> 308/// The input columns must be of data type <see cref="System.Single"/>, <see cref="System.Double"/> or a known-sized vector of those types. 334/// The data type on this column should be <see cref="System.Single"/>, <see cref="System.Double"/> or a known-sized vector of those types.</param> 363/// The input columns must be of data type <see cref="System.Single"/>, <see cref="System.Double"/> or a known-sized vector of those types.
Text\LdaTransform.cs (9)
415public int FeedTrain(IExceptionContext ectx, in VBuffer<Double> input) 465public void Output(in VBuffer<Double> src, ref VBuffer<float> dst, int numBurninIter, bool reset) 607var getSrc = RowCursorUtils.GetVecGetterAs<Double>(NumberDataViewType.Double, input, _srcCols[iinfo]); 608var src = default(VBuffer<Double>); 865var getters = new ValueGetter<VBuffer<Double>>[columns.Length]; 870getters[i] = RowCursorUtils.GetVecGetterAs<Double>(NumberDataViewType.Double, cursor, srcCols[i]); 872VBuffer<Double> src = default; 945var getters = new ValueGetter<VBuffer<Double>>[columns.Length]; 949getters[i] = RowCursorUtils.GetVecGetterAs<Double>(NumberDataViewType.Double, cursor, srcCols[i]);
Text\NgramTransform.cs (1)
266var rowCount = trainingData.GetRowCount() ?? double.NaN;
Microsoft.ML.Vision (1)
DnnRetrainTransform.cs (1)
817var d = numOfUnkDim > 0 ? Math.Pow(typeValueCount / valCount, 1.0 / numOfUnkDim) : 0;
Microsoft.Net.Http.Headers (8)
HeaderUtilities.cs (1)
63if (TryParseQualityDouble(qualityParameter.Value, 0, out var qualityValue, out _))
MediaTypeHeaderValueComparer.cs (3)
121var mediaType1Quality = mediaType1.Quality ?? HeaderQuality.Match; 122var mediaType2Quality = mediaType2.Quality ?? HeaderQuality.Match; 123var qualityDifference = mediaType1Quality - mediaType2Quality;
StringWithQualityHeaderValue.cs (1)
255if (!HeaderUtilities.TryParseQualityDouble(input, current, out var quality, out var qualityLength))
StringWithQualityHeaderValueComparer.cs (3)
46var quality1 = stringWithQuality1.Quality ?? HeaderQuality.Match; 47var quality2 = stringWithQuality2.Quality ?? HeaderQuality.Match; 48var qualityDifference = quality1 - quality2;
Microsoft.Net.Http.Headers.Tests (2)
HeaderUtilitiesTest.cs (2)
354var result = HeaderUtilities.TryParseQualityDouble(input, startIndex, out var actualQuality, out var actualLength); 406var result = HeaderUtilities.TryParseQualityDouble(input, startIndex, out var quality, out var length);
Microsoft.VisualBasic.Core (2)
Microsoft\VisualBasic\Strings.vb (2)
1180If System.Double.IsNaN(dbl) OrElse System.Double.IsInfinity(dbl) Then
Microsoft.VisualStudio.LanguageServices (3)
DocumentOutline\DocumentOutlineView.xaml.cs (1)
342var croppedRenderWidth = Math.Min(item.RenderSize.Width, SymbolTree.RenderSize.Width / 4);
InheritanceMargin\MarginGlyph\InheritanceMarginGlyphViewModel.cs (1)
122var scaleFactor = zoomLevel / 100;
PreviewPane\PreviewPane.xaml.cs (1)
285var titleTextBlockHeight = double.PositiveInfinity;
MSBuild (2)
ConversionUtilities.cs (2)
132return Double.Parse(number, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture.NumberFormat); 205return Double.TryParse(number, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture.NumberFormat, out value) && !double.IsInfinity(value);
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
219[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Double))]
netstandard (1)
netstandard.cs (1)
744[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Double))]
PresentationBuildTasks (5)
src\Microsoft.DotNet.Wpf\src\PresentationCore\MS\Internal\Media\XamlSerializationHelper.cs (3)
287internal static void WriteDouble( BinaryWriter writer, Double value ) 424internal static bool CanConvertToInteger( Double doubleValue , ref int intValue ) 438else if ( ( scaledValue - scaledInteger ) > Double.Epsilon )
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\KnownTypes.cs (1)
5499case KnownElements.Double: t = typeof(Double); break;
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (1)
184else if (typeof(Double).IsAssignableFrom(type))
PresentationCore (503)
MS\Internal\AnimatedTypeHelpers.cs (87)
19internal static Byte InterpolateByte(Byte from, Byte to, Double progress) 21return (Byte)((Int32)from + (Int32)((((Double)(to - from)) + (Double)0.5) * progress)); 24internal static Color InterpolateColor(Color from, Color to, Double progress) 29internal static Decimal InterpolateDecimal(Decimal from, Decimal to, Double progress) 34internal static Double InterpolateDouble(Double from, Double to, Double progress) 39internal static Int16 InterpolateInt16(Int16 from, Int16 to, Double progress) 51Double addend = (Double)(to - from); 59internal static Int32 InterpolateInt32(Int32 from, Int32 to, Double progress) 71Double addend = (Double)(to - from); 79internal static Int64 InterpolateInt64(Int64 from, Int64 to, Double progress) 91Double addend = (Double)(to - from); 99internal static Point InterpolatePoint(Point from, Point to, Double progress) 104internal static Point3D InterpolatePoint3D(Point3D from, Point3D to, Double progress) 109internal static Quaternion InterpolateQuaternion(Quaternion from, Quaternion to, Double progress, bool useShortestPath) 114internal static Rect InterpolateRect(Rect from, Rect to, Double progress) 130internal static Rotation3D InterpolateRotation3D(Rotation3D from, Rotation3D to, Double progress) 135internal static Single InterpolateSingle(Single from, Single to, Double progress) 140internal static Size InterpolateSize(Size from, Size to, Double progress) 145internal static System.Windows.Vector InterpolateVector(System.Windows.Vector from, System.Windows.Vector to, Double progress) 150internal static Vector3D InterpolateVector3D(Vector3D from, Vector3D to, Double progress) 174internal static Double AddDouble(Double value1, Double value2) 276internal static Double SubtractDouble(Double value1, Double value2) 356internal static Double GetSegmentLengthBoolean(Boolean from, Boolean to) 368internal static Double GetSegmentLengthByte(Byte from, Byte to) 373internal static Double GetSegmentLengthChar(Char from, Char to) 385internal static Double GetSegmentLengthColor(Color from, Color to) 393internal static Double GetSegmentLengthDecimal(Decimal from, Decimal to) 398return (Double)Math.Abs(to - from); 401internal static Double GetSegmentLengthDouble(Double from, Double to) 406internal static Double GetSegmentLengthInt16(Int16 from, Int16 to) 411internal static Double GetSegmentLengthInt32(Int32 from, Int32 to) 416internal static Double GetSegmentLengthInt64(Int64 from, Int64 to) 421internal static Double GetSegmentLengthMatrix(Matrix from, Matrix to) 433internal static Double GetSegmentLengthObject(Object from, Object to) 438internal static Double GetSegmentLengthPoint(Point from, Point to) 443internal static Double GetSegmentLengthPoint3D(Point3D from, Point3D to) 448internal static Double GetSegmentLengthQuaternion(Quaternion from, Quaternion to) 455internal static Double GetSegmentLengthRect(Rect from, Rect to) 461Double a = GetSegmentLengthPoint(from.Location, to.Location); 462Double b = GetSegmentLengthSize(from.Size, to.Size); 468internal static Double GetSegmentLengthRotation3D(Rotation3D from, Rotation3D to) 473internal static Double GetSegmentLengthSingle(Single from, Single to) 478internal static Double GetSegmentLengthSize(Size from, Size to) 483internal static Double GetSegmentLengthString(String from, String to) 495internal static Double GetSegmentLengthVector(System.Windows.Vector from, System.Windows.Vector to) 500internal static Double GetSegmentLengthVector3D(Vector3D from, Vector3D to) 509internal static Byte ScaleByte(Byte value, Double factor) 511return (Byte)((Double)value * factor); 514internal static Color ScaleColor(Color value, Double factor) 519internal static Decimal ScaleDecimal(Decimal value, Double factor) 524internal static Double ScaleDouble(Double value, Double factor) 529internal static Int16 ScaleInt16(Int16 value, Double factor) 531return (Int16)((Double)value * factor); 534internal static Int32 ScaleInt32(Int32 value, Double factor) 536return (Int32)((Double)value * factor); 539internal static Int64 ScaleInt64(Int64 value, Double factor) 541return (Int64)((Double)value * factor); 544internal static Point ScalePoint(Point value, Double factor) 551internal static Point3D ScalePoint3D(Point3D value, Double factor) 559internal static Quaternion ScaleQuaternion(Quaternion value, Double factor) 564internal static Rect ScaleRect(Rect value, Double factor) 579internal static Rotation3D ScaleRotation3D(Rotation3D value, Double factor) 584internal static Single ScaleSingle(Single value, Double factor) 586return (Single)((Double)value * factor); 589internal static Size ScaleSize(Size value, Double factor) 594internal static System.Windows.Vector ScaleVector(System.Windows.Vector value, Double factor) 599internal static Vector3D ScaleVector3D(Vector3D value, Double factor) 633internal static bool IsValidAnimationValueDouble(Double value) 775internal static Double GetZeroValueDouble(Double baseValue) 844private static Boolean IsInvalidDouble(Double value) 846return Double.IsInfinity(value)
MS\Internal\Ink\InkSerializedFormat\CustomAttributeSerializer.cs (2)
859if ( Double.IsNaN(dVal) || dVal < DrawingAttributes.MinHeight || dVal > DrawingAttributes.MaxHeight) 866if (Double.IsNaN(dVal) || dVal < DrawingAttributes.MinWidth || dVal > DrawingAttributes.MaxWidth)
MS\Internal\Ink\InkSerializedFormat\DrawingAttributeSerializer.cs (2)
366double height = DoubleUtil.IsZero(stylusHeight) ? (Double)DrawingAttributes.GetDefaultDrawingAttributeValue(KnownIds.StylusHeight) : stylusHeight; 367double width = DoubleUtil.IsZero(stylusWidth) ? (Double)DrawingAttributes.GetDefaultDrawingAttributeValue(KnownIds.StylusWidth) : stylusWidth;
MS\Internal\Ink\InkSerializedFormat\SerializationHelper.cs (2)
282else if (typeof(Double) == type) 286else if (typeof(Double[]) == type)
MS\Internal\Ink\StrokeNode.cs (2)
835return new Point(Double.NaN, Double.NaN);
MS\Internal\Ink\StrokeRenderer.cs (2)
1120internal static readonly Point ArcToMarker = new Point(Double.MinValue, Double.MinValue);
MS\Internal\Ink\StylusShape.cs (6)
41if (Double.IsNaN(width) || Double.IsInfinity(width) || width < DrawingAttributes.MinWidth || width > DrawingAttributes.MaxWidth) 46if (Double.IsNaN(height) || Double.IsInfinity(height) || height < DrawingAttributes.MinHeight || height > DrawingAttributes.MaxHeight) 51if (Double.IsNaN(rotation) || Double.IsInfinity(rotation))
MS\Internal\Media\ParserStreamGeometryContext.cs (1)
567private static Double DeserializeDouble(BinaryReader br, bool isScaledInt)
MS\Internal\Media\XamlSerializationHelper.cs (3)
287internal static void WriteDouble( BinaryWriter writer, Double value ) 424internal static bool CanConvertToInteger( Double doubleValue , ref int intValue ) 438else if ( ( scaledValue - scaledInteger ) > Double.Epsilon )
MS\Internal\Media3D\GeneralTransform2DTo3DTo2D.cs (2)
1023double closestDistance = Double.MaxValue; 1093if (closestDistance != Double.MaxValue)
MS\Internal\Media3D\LineUtil.cs (2)
331if (tau < Double.MaxValue && tau > -Double.MaxValue)
MS\Internal\TextFormatting\TextStore.cs (1)
2349if (Double.IsPositiveInfinity(metrics.Width))
src\Microsoft.DotNet.Wpf\src\Common\Graphics\wgx_core_types.cs (4)
925return new MilRectD(Double.NaN,Double.NaN,Double.NaN,Double.NaN);
System\Windows\Ink\Stroke.cs (12)
1107if (Double.IsNaN(matrix.M11) || 1108Double.IsNaN(matrix.M12) || 1109Double.IsNaN(matrix.M21) || 1110Double.IsNaN(matrix.M22) || 1111Double.IsNaN(matrix.OffsetX) || 1112Double.IsNaN(matrix.OffsetY)) 1122if (Double.IsInfinity(matrix.M11) || 1123Double.IsInfinity(matrix.M12) || 1124Double.IsInfinity(matrix.M21) || 1125Double.IsInfinity(matrix.M22) || 1126Double.IsInfinity(matrix.OffsetX) || 1127Double.IsInfinity(matrix.OffsetY))
System\Windows\Ink\Stroke2.cs (1)
193if (Double.IsNaN(diameter) || diameter < DrawingAttributes.MinWidth || diameter > DrawingAttributes.MaxWidth)
System\Windows\Ink\StrokeCollection2.cs (1)
64if (Double.IsNaN(diameter) || diameter < DrawingAttributes.MinWidth || diameter > DrawingAttributes.MaxWidth)
System\Windows\Input\InertiaExpansionBehavior.cs (2)
52if (Double.IsInfinity(value) || Double.IsNaN(value))
System\Windows\Input\InertiaRotationBehavior.cs (4)
52if (Double.IsInfinity(value) || Double.IsNaN(value)) 72if (Double.IsInfinity(value) || Double.IsNaN(value))
System\Windows\Input\InertiaTranslationBehavior.cs (4)
52if (Double.IsInfinity(value) || Double.IsNaN(value)) 72if (Double.IsInfinity(value) || Double.IsNaN(value))
System\Windows\Input\Stylus\Common\StylusPoint.cs (4)
70if (Double.IsNaN(x)) 74if (Double.IsNaN(y)) 164if (Double.IsNaN(value)) 184if (Double.IsNaN(value))
System\Windows\Media\Animation\AnimationStorage.cs (1)
1110if (type == typeof(Double))
System\Windows\Media\Animation\Clock.cs (7)
1966Double currentProgress; 1970Double repeatCount = repeatBehavior.Count; 1979Double wholePart = (Double)((Int32)repeatCount); 4100internal Double InteractiveSpeedRatio 4121internal Double? PendingSpeedRatio 4459private Double _appliedSpeedRatio;
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (4)
375Double currentSegmentProgress = 0.0; 830List<Double> segmentLengths = new List<Double>(); 838Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (4)
375Double currentSegmentProgress = 0.0; 830List<Double> segmentLengths = new List<Double>(); 838Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\DiscreteKeyFrames.cs (4)
421public DiscreteDoubleKeyFrame(Double value) 429public DiscreteDoubleKeyFrame(Double value, KeyTime keyTime) 457protected override Double InterpolateValueCore(Double baseValue, double keyFrameProgress)
System\Windows\Media\Animation\Generated\DoubleAnimation.cs (32)
32private Double[] _keyValues; 47Type typeofProp = typeof(Double?); 56new PropertyMetadata((Double?)null, propCallback), 63new PropertyMetadata((Double?)null, propCallback), 70new PropertyMetadata((Double?)null, propCallback), 94public DoubleAnimation(Double toValue, Duration duration) 106public DoubleAnimation(Double toValue, Duration duration, FillBehavior fillBehavior) 119public DoubleAnimation(Double fromValue, Double toValue, Duration duration) 132public DoubleAnimation(Double fromValue, Double toValue, Duration duration, FillBehavior fillBehavior) 205protected override Double GetCurrentValueCore(Double defaultOriginValue, Double defaultDestinationValue, AnimationClock animationClock) 222Double from = new Double(); 223Double to = new Double(); 224Double accumulated = new Double(); 225Double foundation = new Double(); 339Double accumulator = AnimatedTypeHelpers.SubtractDouble(to, from); 364_keyValues = new Double[2]; 371_keyValues = new Double[2]; 378_keyValues = new Double[1]; 385_keyValues = new Double[1]; 391_keyValues = new Double[1]; 412Double? typedValue = (Double?)value; 432public Double? From 436return (Double?)GetValue(FromProperty); 452public Double? To 456return (Double?)GetValue(ToProperty); 472public Double? By 476return (Double?)GetValue(ByProperty);
System\Windows\Media\Animation\Generated\DoubleAnimationBase.cs (9)
80return GetCurrentValue((Double)defaultOriginValue, (Double)defaultDestinationValue, animationClock); 92return typeof(Double); 129public Double GetCurrentValue(Double defaultOriginValue, Double defaultDestinationValue, AnimationClock animationClock) 185protected abstract Double GetCurrentValueCore(Double defaultOriginValue, Double defaultDestinationValue, AnimationClock animationClock);
System\Windows\Media\Animation\Generated\DoubleAnimationClockResource.cs (4)
39Double baseValue, 51public Double BaseValue 62public Double CurrentValue 131private Double _baseValue;
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (14)
312protected sealed override Double GetCurrentValueCore( 313Double defaultOriginValue, 314Double defaultDestinationValue, 340Double currentIterationValue; 375Double currentSegmentProgress = 0.0; 376Double fromValue; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 621private Double GetResolvedKeyFrameValue(Int32 resolvedKeyFrameIndex) 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0; 934Double prevKeyValue = _keyFrames[index - 1].Value; 938Double currentKeyValue = _keyFrames[index].Value;
System\Windows\Media\Animation\Generated\DoubleIndependentAnimationStorage.cs (2)
45Double tempValue = (Double)dobj.GetValue(_dependencyProperty);
System\Windows\Media\Animation\Generated\EasingKeyFrames.cs (5)
417public EasingDoubleKeyFrame(Double value) 426public EasingDoubleKeyFrame(Double value, KeyTime keyTime) 436public EasingDoubleKeyFrame(Double value, KeyTime keyTime, IEasingFunction easingFunction) 465protected override Double InterpolateValueCore(Double baseValue, double keyFrameProgress)
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\KeyFrames.cs (10)
742protected DoubleKeyFrame(Double value) 751protected DoubleKeyFrame(Double value, KeyTime keyTime) 794typeof(Double), 809Value = (Double)value; 816public Double Value 820return (Double)GetValue(ValueProperty); 837public Double InterpolateValue( 838Double baseValue, 855protected abstract Double InterpolateValueCore( 856Double baseValue,
System\Windows\Media\Animation\Generated\LinearKeyFrames.cs (4)
273public LinearDoubleKeyFrame(Double value) 281public LinearDoubleKeyFrame(Double value, KeyTime keyTime) 307protected override Double InterpolateValueCore(Double baseValue, double keyFrameProgress)
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (4)
375Double currentSegmentProgress = 0.0; 830List<Double> segmentLengths = new List<Double>(); 838Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (4)
375Double currentSegmentProgress = 0.0; 830List<Double> segmentLengths = new List<Double>(); 838Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\SplineKeyFrames.cs (5)
428public SplineDoubleKeyFrame(Double value) 437public SplineDoubleKeyFrame(Double value, KeyTime keyTime) 447public SplineDoubleKeyFrame(Double value, KeyTime keyTime, KeySpline keySpline) 478protected override Double InterpolateValueCore(Double baseValue, double keyFrameProgress)
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (4)
375Double currentSegmentProgress = 0.0; 830List<Double> segmentLengths = new List<Double>(); 838Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\KeyTimeConverter.cs (1)
183typeof(Double)).ConvertTo(
System\Windows\Media\ArcSegment.cs (1)
70Double rotation = RotationAngle;
System\Windows\Media\BitmapCacheBrush.cs (2)
264element.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
System\Windows\Media\BoundsDrawingContextWalker.cs (12)
152Double radiusX, 153Double radiusY) 202Double radiusX, 203Double radiusY) 379Double opacity) 444Double coordinate) 465Double leadingCoordinate, 466Double offsetToDrivenCoordinate) 590bounds.X = Double.NegativeInfinity; 591bounds.Y = Double.NegativeInfinity; 592bounds.Width = Double.PositiveInfinity; 593bounds.Height = Double.PositiveInfinity;
System\Windows\Media\CompositionTarget.cs (4)
548Double.MinValue / 2.0, 549Double.MinValue / 2.0, 550Double.MaxValue, 551Double.MaxValue);
System\Windows\Media\DashStyle.cs (1)
41public DashStyle(IEnumerable<double> dashes, Double offset)
System\Windows\Media\DrawingDrawingContext.cs (13)
243Double radiusX, 244Double radiusY) 284Double radiusX, 286Double radiusY, 378Double radiusX, 379Double radiusY) 421Double radiusX, 423Double radiusY, 789Double opacity 810Double opacity, 911Double coordinate) 956Double leadingCoordinate, 957Double offsetToDrivenCoordinate)
System\Windows\Media\EllipseGeometry.cs (2)
81Double currentRadiusX = RadiusX; 82Double currentRadiusY = RadiusY;
System\Windows\Media\FormattedText.cs (1)
1742double lineStartOfLongestLine = Double.MaxValue;
System\Windows\Media\Generated\DashStyle.cs (3)
178data.DashesSize = (uint)(sizeof(Double) * DashesCount); 190Double resource = vDashes.Internal_GetItem(i); 193sizeof(Double)
System\Windows\Media\Generated\DrawingContext.cs (13)
121Double radiusX, 122Double radiusY); 154Double radiusX, 156Double radiusY, 187Double radiusX, 188Double radiusY); 222Double radiusX, 224Double radiusY, 353Double opacity); 365Double opacity, 392Double coordinate); 405Double leadingCoordinate, 406Double offsetToDrivenCoordinate);
System\Windows\Media\Generated\DrawingContextDrawingContextWalker.cs (13)
151Double radiusX, 152Double radiusY) 193Double radiusX, 195Double radiusY, 237Double radiusX, 238Double radiusY) 281Double radiusX, 283Double radiusY, 475Double opacity) 492Double opacity, 534Double coordinate) 552Double leadingCoordinate, 553Double offsetToDrivenCoordinate)
System\Windows\Media\Generated\DrawingContextWalker.cs (13)
134Double radiusX, 135Double radiusY) 170Double radiusX, 172Double radiusY, 206Double radiusX, 207Double radiusY) 244Double radiusX, 246Double radiusY, 405Double opacity) 420Double opacity, 456Double coordinate) 472Double leadingCoordinate, 473Double offsetToDrivenCoordinate)
System\Windows\Media\Generated\GuidelineSet.cs (6)
198data.GuidelinesXSize = (uint)(sizeof(Double) * GuidelinesXCount); 199data.GuidelinesYSize = (uint)(sizeof(Double) * GuidelinesYCount); 213Double resource = vGuidelinesX.Internal_GetItem(i); 216sizeof(Double) 223Double resource = vGuidelinesY.Internal_GetItem(i); 226sizeof(Double)
System\Windows\Media\Generated\RenderDataDrawingContext.cs (14)
278Double radiusX, 279Double radiusY) 350Double radiusX, 352Double radiusY, 431Double radiusX, 432Double radiusY) 505Double radiusX, 507Double radiusY, 1004Double opacity) 1047Double opacity, 1211Double coordinate) 1255Double leadingCoordinate, 1256Double offsetToDrivenCoordinate) 1385Double baseValue,
System\Windows\Media\HitTestDrawingContextWalker.cs (4)
102Double radiusX, 103Double radiusY) 137Double radiusX, 138Double radiusY)
System\Windows\Media\HitTestWithGeometryDrawingContextWalker.cs (4)
241Double opacity) 297Double coordinate) 315Double leadingCoordinate, 316Double offsetToDrivenCoordinate)
System\Windows\Media\HitTestWithPointDrawingContextWalker.cs (4)
171Double opacity) 242Double coordinate) 263Double leadingCoordinate, 264Double offsetToDrivenCoordinate)
System\Windows\Media\Visual.cs (16)
404bboxSubgraph.X = Double.NegativeInfinity; 405bboxSubgraph.Y = Double.NegativeInfinity; 406bboxSubgraph.Width = Double.PositiveInfinity; 407bboxSubgraph.Height = Double.PositiveInfinity; 599bboxSubgraph.X = Double.NegativeInfinity; 600bboxSubgraph.Y = Double.NegativeInfinity; 601bboxSubgraph.Width = Double.PositiveInfinity; 602bboxSubgraph.Height = Double.PositiveInfinity; 1052_bboxSubgraph.X = Double.NegativeInfinity; 1053_bboxSubgraph.Y = Double.NegativeInfinity; 1054_bboxSubgraph.Width = Double.PositiveInfinity; 1055_bboxSubgraph.Height = Double.PositiveInfinity; 1127bboxSubgraph.X = Double.NegativeInfinity; 1128bboxSubgraph.Y = Double.NegativeInfinity; 1129bboxSubgraph.Width = Double.PositiveInfinity; 1130bboxSubgraph.Height = Double.PositiveInfinity;
System\Windows\Media\VisualBrush.cs (2)
231element.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
System\Windows\Media3D\Generated\PointLightBase.cs (2)
270internal const double c_Range = Double.PositiveInfinity; 310Double.PositiveInfinity,
System\Windows\Media3D\Generated\ProjectionCamera.cs (2)
270internal const double c_FarPlaneDistance = (double)Double.PositiveInfinity; 310(double)Double.PositiveInfinity,
System\Windows\Media3D\PerspectiveCamera.cs (1)
81double m22 = zf != Double.PositiveInfinity ? zf/(zn-zf) : -1;
System\Windows\Media3D\Quaternion.cs (3)
144if (!(msin <= Double.MaxValue)) 237if (norm2 > Double.MaxValue) 416if (!(norm2 <= Double.MaxValue))
System\Windows\Media3D\Rect3D.cs (6)
598_x = Double.PositiveInfinity, 599_y = Double.PositiveInfinity, 600_z = Double.PositiveInfinity, 602_sizeX = Double.NegativeInfinity, 603_sizeY = Double.NegativeInfinity, 604_sizeZ = Double.NegativeInfinity
System\Windows\Media3D\Size3D.cs (3)
176_x = Double.NegativeInfinity, 177_y = Double.NegativeInfinity, 178_z = Double.NegativeInfinity
System\Windows\UIElement.cs (6)
1089Double.IsInfinity(newValue) || 1090DoubleUtil.AreClose(newValue, Double.MaxValue)) 1392return ( (!double.IsNaN(v.X) && !Double.IsPositiveInfinity(v.X) && !Double.IsNegativeInfinity(v.X)) 1393&& (!double.IsNaN(v.Y) && !Double.IsPositiveInfinity(v.Y) && !Double.IsNegativeInfinity(v.Y)));
PresentationFramework (401)
MS\Internal\AnimatedTypeHelpers.cs (17)
29private static Double InterpolateDouble(Double from, Double to, Double progress) 47private static Double AddDouble(Double value1, Double value2) 78private static Double GetSegmentLengthDouble(Double from, Double to) 98private static Double ScaleDouble(Double value, Double factor) 116private static bool IsValidAnimationValueDouble(Double value) 144private static Double GetZeroValueDouble(Double baseValue) 164return Double.IsInfinity(value)
MS\Internal\Annotations\Anchoring\AttachedAnnotation.cs (2)
195if (!Double.IsInfinity(pt.X) && !Double.IsInfinity(pt.Y))
MS\Internal\Annotations\Anchoring\TextSelectionHelper.cs (2)
298Point endPoint = new Point(Double.MaxValue, Double.MaxValue);
MS\Internal\Annotations\Component\AnnotationAdorner.cs (2)
131Size childConstraint = new Size(Double.PositiveInfinity, Double.PositiveInfinity);
MS\Internal\Controls\InkCanvasInnerCanvas.cs (2)
78Size childConstraint = new Size(Double.PositiveInfinity, Double.PositiveInfinity);
MS\Internal\Controls\TemplatedAdorner.cs (2)
145(_child).Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
MS\Internal\Data\DefaultValueConverter.cs (1)
526typeof(Int32), typeof(Int64), typeof(Single), typeof(Double),
MS\Internal\Documents\DocumentGrid.cs (5)
592if (Double.IsNaN(offset)) 635if (Double.IsNaN(offset)) 2139if (Double.IsNaN(offset)) 2159if (Double.IsNaN(offset)) 2231double minAspectDiff = Double.MaxValue; //The current optimal aspect ratio match
MS\Internal\Documents\TextDocumentView.cs (1)
2057double closestDistance = Double.MaxValue;
MS\Internal\Helper.cs (2)
551return !(Double.IsInfinity(value) || Double.IsNaN(value));
MS\Internal\PtsHost\FigureHelper.cs (1)
205value = Double.NaN;
MS\Internal\PtsHost\FloaterParagraph.cs (5)
204if (Double.IsInfinity(StructuralCache.CurrentFormatContext.PageHeight)) 265if(fsbbox.fsrc.du < subpageWidth && Double.IsNaN(specifiedWidth) && HorizontalAlignment != HorizontalAlignment.Stretch) 443if(fsbbox.fsrc.du < subpageWidth && Double.IsNaN(specifiedWidth) && HorizontalAlignment != HorizontalAlignment.Stretch) 648if (!Double.IsNaN(specifiedWidth)) 869return Double.NaN;
MS\Internal\PtsHost\Line.cs (2)
350pageHeight = Double.PositiveInfinity; 1265private double _trackWidth = Double.NaN;
MS\Internal\PtsHost\MbpInfo.cs (16)
137Double.IsNaN(mbp.Margin.Left) ? defaultMargin.Left : mbp.Margin.Left, 138Double.IsNaN(mbp.Margin.Top) ? defaultMargin.Top : mbp.Margin.Top, 139Double.IsNaN(mbp.Margin.Right) ? defaultMargin.Right : mbp.Margin.Right, 140Double.IsNaN(mbp.Margin.Bottom) ? defaultMargin.Bottom : mbp.Margin.Bottom); 162Double.IsNaN(mbp.Padding.Left) ? defaultPadding.Left : mbp.Padding.Left, 163Double.IsNaN(mbp.Padding.Top) ? defaultPadding.Top : mbp.Padding.Top, 164Double.IsNaN(mbp.Padding.Right) ? defaultPadding.Right : mbp.Padding.Right, 165Double.IsNaN(mbp.Padding.Bottom) ? defaultPadding.Bottom : mbp.Padding.Bottom); 336Double.IsNaN(_padding.Left) || 337Double.IsNaN(_padding.Right) || 338Double.IsNaN(_padding.Top) || 339Double.IsNaN(_padding.Bottom)); 351Double.IsNaN(_margin.Left) || 352Double.IsNaN(_margin.Right) || 353Double.IsNaN(_margin.Top) || 354Double.IsNaN(_margin.Bottom));
MS\Internal\PtsHost\OptimalTextSource.cs (1)
227pageHeight = Double.PositiveInfinity;
MS\Internal\PtsHost\UIElementParagraph.cs (1)
434elementHeight = Double.PositiveInfinity;
MS\Internal\Text\LineProperties.cs (1)
54if (LineStackingStrategy == LineStackingStrategy.BlockLineHeight && !Double.IsNaN(_lineHeight))
MS\Internal\Text\MarkerProperties.cs (1)
32if (Double.IsNaN(_offset))
System\Windows\Annotations\AnnotationDocumentPaginator.cs (4)
307decorator.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity)); 348decorator.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
System\Windows\Controls\BorderGapMaskConverter.cs (1)
73lineWidth = Double.Parse(((string)parameter), NumberFormatInfo.InvariantInfo);
System\Windows\Controls\Canvas.cs (6)
203new FrameworkPropertyMetadata(Double.NaN, new PropertyChangedCallback(OnPositioningChanged)), 214new FrameworkPropertyMetadata(Double.NaN, new PropertyChangedCallback(OnPositioningChanged)), 226new FrameworkPropertyMetadata(Double.NaN, new PropertyChangedCallback(OnPositioningChanged)), 237new FrameworkPropertyMetadata(Double.NaN, new PropertyChangedCallback(OnPositioningChanged)), 257Size childConstraint = new Size(Double.PositiveInfinity, Double.PositiveInfinity);
System\Windows\Controls\ColumnDefinition.cs (1)
1044Double.PositiveInfinity,
System\Windows\Controls\DataGrid.cs (5)
205return !(value < 0d || double.IsNaN(value) || Double.IsPositiveInfinity(value)); 1253var newValue = (double)e.NewValue; 6417double closestDistance = Double.PositiveInfinity; 6550distance = Double.PositiveInfinity; 8471else if (!Double.IsNaN(RowHeaderWidth))
System\Windows\Controls\DataGridCellsPanel.cs (1)
2011if (!double.IsNaN(rowPresenterAvailableSize.Width) && !Double.IsInfinity(rowPresenterAvailableSize.Width))
System\Windows\Controls\DataGridColumn.cs (2)
454return !(value < 0d || double.IsNaN(value) || Double.IsPositiveInfinity(value)); 531return Double.PositiveInfinity;
System\Windows\Controls\DataGridColumnCollection.cs (7)
897!double.IsNaN(availableStarSpace) && !Double.IsNegativeInfinity(availableStarSpace), 1561double minPerStarExcessRatio = Double.PositiveInfinity; 1598minPerStarExcessRatio = Double.PositiveInfinity; 1816double minPerStarLagRatio = Double.PositiveInfinity; 1848minPerStarLagRatio = Double.PositiveInfinity; 2050double minLagWidth = Double.PositiveInfinity; 2313double minExcessWidth = Double.PositiveInfinity;
System\Windows\Controls\DataGridLength.cs (5)
52: this(value, type, (type == DataGridLengthUnitType.Pixel ? value : Double.NaN), (type == DataGridLengthUnitType.Pixel ? value : Double.NaN)) 75if (double.IsNaN(value) || Double.IsInfinity(value)) 93if (Double.IsInfinity(desiredValue)) 100if (Double.IsInfinity(displayValue))
System\Windows\Controls\DataGridLengthConverter.cs (1)
94if (!Double.IsInfinity(doubleValue))
System\Windows\Controls\DefinitionBase.cs (1)
206return (!double.IsNaN(v) && v >= 0.0d && !Double.IsPositiveInfinity(v));
System\Windows\Controls\FlowDocumentReader.cs (2)
1793return (!Double.IsNaN(value) && !Double.IsInfinity(value) && DoubleUtil.GreaterThanZero(value));
System\Windows\Controls\FlowDocumentScrollViewer.cs (2)
1671return (!Double.IsNaN(value) && !Double.IsInfinity(value) && DoubleUtil.GreaterThanZero(value));
System\Windows\Controls\Grid.cs (9)
1751if (Double.IsPositiveInfinity(maxStar)) 1761double power = Math.Floor(Math.Log(Double.MaxValue / maxStar / starCount, 2.0)); 1813if (!Double.IsPositiveInfinity(effectiveMaxSize)) 1858double minRatio = (minCount > 0) ? tempDefinitions[minCount - 1].MeasureSize : Double.PositiveInfinity; 2330if (Double.IsPositiveInfinity(maxStar)) 2340double power = Math.Floor(Math.Log(Double.MaxValue / maxStar / starCount, 2.0)); 2388if (!Double.IsPositiveInfinity(effectiveMaxSize)) 2466double minRatio = (minCount > 0) ? definitions[definitionIndices[minCount - 1]].MeasureSize : Double.PositiveInfinity; 3241return (Double.IsPositiveInfinity(def.UserSize.Value)) ? 1.0 : 0.0;
System\Windows\Controls\GridSplitter.cs (1)
260return delta > 0.0 && !Double.IsPositiveInfinity(delta);
System\Windows\Controls\GridViewColumn.cs (6)
42_state = Double.IsNaN(Width) ? ColumnMeasureState.Init : ColumnMeasureState.SpecificWidth; 380Double.NaN /* default value */, 404c.State = Double.IsNaN(newWidth) ? ColumnMeasureState.Init : ColumnMeasureState.SpecificWidth; 422if (Double.IsNaN(value) || Double.IsInfinity(value) || value < 0.0) 529_state = Double.IsNaN(Width) ? ColumnMeasureState.Init : ColumnMeasureState.SpecificWidth;
System\Windows\Controls\GridViewColumnHeader.cs (2)
705if (Double.IsNaN(Column.Width)) 711Column.Width = Double.NaN;
System\Windows\Controls\GridViewHeaderRowPresenter.cs (1)
1119paddingHeader.Width = Double.NaN;
System\Windows\Controls\InkCanvas.cs (6)
422new FrameworkPropertyMetadata(Double.NaN, new PropertyChangedCallback(OnPositioningChanged)), 456new FrameworkPropertyMetadata(Double.NaN, new PropertyChangedCallback(OnPositioningChanged)), 490new FrameworkPropertyMetadata(Double.NaN, new PropertyChangedCallback(OnPositioningChanged)), 524new FrameworkPropertyMetadata(Double.NaN, new PropertyChangedCallback(OnPositioningChanged)), 1839Double.IsInfinity(point.X)|| 1840Double.IsInfinity(point.Y) )
System\Windows\Controls\ItemsControl.cs (4)
2984viewPortBounds = new Rect(Double.NegativeInfinity, viewPortBounds.Top, 2985Double.PositiveInfinity, viewPortBounds.Height); 2989viewPortBounds = new Rect(viewPortBounds.Left, Double.NegativeInfinity, 2990viewPortBounds.Width, Double.PositiveInfinity);
System\Windows\Controls\MenuScrollingVisibilityConverter.cs (1)
69target = Double.Parse(((string)parameter), NumberFormatInfo.InvariantInfo);
System\Windows\Controls\Primitives\DataGridColumnHeadersPresenter.cs (1)
107childConstraint.Width = Double.PositiveInfinity;
System\Windows\Controls\Primitives\DocumentPageView.cs (5)
234if (!Double.IsInfinity(availableSize.Width) || !Double.IsInfinity(availableSize.Height)) 237if (Double.IsInfinity(availableSize.Width)) 245else if (Double.IsInfinity(availableSize.Height)) 593Invariant.Assert(!DoubleUtil.LessThanOrClose(pageZoom, 0d) && !Double.IsInfinity(pageZoom));
System\Windows\Controls\Primitives\GridViewRowPresenterBase.cs (1)
195DesiredWidthList.Add(Double.NaN);
System\Windows\Controls\Primitives\Popup.cs (2)
2241limitSize = new Size(Double.PositiveInfinity, Double.PositiveInfinity);
System\Windows\Controls\Primitives\PopupRoot.cs (4)
140Size desiredSize = new Size(Double.PositiveInfinity, Double.PositiveInfinity); 185Size restricted1DDesiredSize = new Size(restrictWidth ? restrictedSize.Width : Double.PositiveInfinity, 186restrictHeight ? restrictedSize.Height : Double.PositiveInfinity);
System\Windows\Controls\Primitives\ScrollContentPresenter.cs (4)
421if (_scrollData._canHorizontallyScroll) { childConstraint.Width = Double.PositiveInfinity; } 422if (_scrollData._canVerticallyScroll) { childConstraint.Height = Double.PositiveInfinity; } 798if (Double.IsInfinity(viewport.Width)) viewport.Width = extent.Width; 799if (Double.IsInfinity(viewport.Height)) viewport.Height = extent.Height;
System\Windows\Controls\Primitives\TextBoxBase.cs (2)
277if (Double.IsNaN(offset)) 294if (Double.IsNaN(offset))
System\Windows\Controls\Primitives\ToolBarOverflowPanel.cs (2)
23new FrameworkPropertyMetadata(Double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure), 39return (double.IsNaN(v)) || (DoubleUtil.GreaterThanOrClose(v, 0d) && !Double.IsPositiveInfinity(v));
System\Windows\Controls\Primitives\ToolBarPanel.cs (2)
240layoutSlotSize.Width = Double.PositiveInfinity; 245layoutSlotSize.Height = Double.PositiveInfinity;
System\Windows\Controls\Primitives\Track.cs (4)
641ThumbCenterOffset = Double.NaN; 642Density = Double.NaN; 840private double _density = Double.NaN; 841private double _thumbCenterOffset = Double.NaN;
System\Windows\Controls\RichTextBox.cs (1)
304if (constraint.Width == Double.PositiveInfinity)
System\Windows\Controls\RowDefinition.cs (1)
1039Double.PositiveInfinity,
System\Windows\Controls\ScrollViewer.cs (8)
109public void ScrollToLeftEnd() { EnqueueCommand(Commands.SetHorizontalOffset, Double.NegativeInfinity, null); } 113public void ScrollToRightEnd() { EnqueueCommand(Commands.SetHorizontalOffset, Double.PositiveInfinity, null); } 120EnqueueCommand(Commands.SetHorizontalOffset, Double.NegativeInfinity, null); 121EnqueueCommand(Commands.SetVerticalOffset, Double.NegativeInfinity, null); 128EnqueueCommand(Commands.SetHorizontalOffset, Double.NegativeInfinity, null); 129EnqueueCommand(Commands.SetVerticalOffset, Double.PositiveInfinity, null); 135public void ScrollToTop() { EnqueueCommand(Commands.SetVerticalOffset, Double.NegativeInfinity, null); } 139public void ScrollToBottom() { EnqueueCommand(Commands.SetVerticalOffset, Double.PositiveInfinity, null); }
System\Windows\Controls\SinglePageViewer.cs (2)
1448return (!Double.IsNaN(value) && !Double.IsInfinity(value) && DoubleUtil.GreaterThanZero(value));
System\Windows\Controls\Slider.cs (1)
1397Double snappedValue = SnapToTick(value);
System\Windows\Controls\Stack.cs (6)
561layoutSlotSize.Width = Double.PositiveInfinity; 562if (measureElement.IsScrolling && measureElement.CanVerticallyScroll) { layoutSlotSize.Height = Double.PositiveInfinity; } 568layoutSlotSize.Height = Double.PositiveInfinity; 569if (measureElement.IsScrolling && measureElement.CanHorizontallyScroll) { layoutSlotSize.Width = Double.PositiveInfinity; } 979if (Double.IsNegativeInfinity(offset)) 983else if (Double.IsPositiveInfinity(offset))
System\Windows\Controls\TextRangeAdaptor.cs (2)
796nextLineStart = textView.GetPositionAtNextLine(lineRange.End, Double.NaN, 1, out newSuggestedX, out linesMoved); 823previousLineEnd = textView.GetPositionAtNextLine(lineRange.Start, Double.NaN, -1, out newSuggestedX, out linesMoved);
System\Windows\Controls\ToolBarTray.cs (2)
349Size childConstraint = new Size(Double.PositiveInfinity, Double.PositiveInfinity);
System\Windows\Controls\ViewBox.cs (4)
311Size infinteConstraint = new Size(Double.PositiveInfinity, Double.PositiveInfinity); 374bool isConstrainedWidth = !Double.IsPositiveInfinity(availableSize.Width); 375bool isConstrainedHeight = !Double.IsPositiveInfinity(availableSize.Height);
System\Windows\Controls\VirtualizationCacheLengthConverter.cs (1)
196lengths[i] = Double.Parse(th.GetCurrentToken(), cultureInfo);
System\Windows\Controls\VirtualizingStackPanel.cs (37)
2342childConstraint.Width = Double.PositiveInfinity; 2343if (IsScrolling && CanVerticallyScroll) { childConstraint.Height = Double.PositiveInfinity; } 2347childConstraint.Height = Double.PositiveInfinity; 2348if (IsScrolling && CanHorizontallyScroll) { childConstraint.Width = Double.PositiveInfinity; } 4455Double.PositiveInfinity, 4458Double.PositiveInfinity); 4575viewport.Width = Double.PositiveInfinity; 4579viewport.Height = Double.PositiveInfinity; 4666if (Double.IsPositiveInfinity(factor)) 5668List<Double> childOffsetList = effectiveOffsetInformation?.OffsetList; 9650if (Double.IsPositiveInfinity(constraint.Height)) 9677if (Double.IsPositiveInfinity(constraint.Width)) 9695if (!Double.IsPositiveInfinity(constraint.Width)) 9700if (!Double.IsPositiveInfinity(constraint.Height)) 9981viewportOffset.X = Double.PositiveInfinity; 10004viewportOffset.X = Double.PositiveInfinity; 10036viewportOffset.X = Double.PositiveInfinity; 10104viewportOffset.Y = Double.PositiveInfinity; 10198viewportOffset.Y = Double.PositiveInfinity; 10221viewportOffset.Y = Double.PositiveInfinity; 10253viewportOffset.Y = Double.PositiveInfinity; 10320viewportOffset.X = Double.PositiveInfinity; 10499if (Double.IsPositiveInfinity(constraint.Height)) 10526if (Double.IsPositiveInfinity(constraint.Width)) 10544if (!Double.IsPositiveInfinity(constraint.Width)) 10549if (!Double.IsPositiveInfinity(constraint.Height)) 10654viewportOffset.X = Double.PositiveInfinity; 10689viewportOffset.X = Double.PositiveInfinity; 10785viewportOffset.Y = Double.PositiveInfinity; 10820viewportOffset.Y = Double.PositiveInfinity; 11941private class UniformOrAverageContainerSizeDual : Tuple<Double, Double> 11943public UniformOrAverageContainerSizeDual(Double pixelSize, Double itemSize) 11948public Double PixelSize 11953public Double ItemSize 12854internal List<Double> _effectiveOffsets;
System\Windows\Controls\WrapPanel.cs (3)
68return (double.IsNaN(v)) || (v >= 0.0d && !Double.IsPositiveInfinity(v)); 80Double.NaN, 109Double.NaN,
System\Windows\CornerRadius.cs (8)
213if (Double.IsPositiveInfinity(_topLeft) || Double.IsPositiveInfinity(_topRight) || Double.IsPositiveInfinity(_bottomLeft) || Double.IsPositiveInfinity(_bottomRight)) 221if (Double.IsNegativeInfinity(_topLeft) || Double.IsNegativeInfinity(_topRight) || Double.IsNegativeInfinity(_bottomLeft) || Double.IsNegativeInfinity(_bottomRight))
System\Windows\Documents\AdornerLayer.cs (2)
535adornerInfo.RenderSize = new Size(Double.NaN, Double.NaN);
System\Windows\Documents\AnchoredBlock.cs (2)
93new Thickness(Double.NaN), 112new Thickness(Double.NaN),
System\Windows\Documents\Block.cs (9)
488if (Double.IsNaN(lineHeight)) 533if (Double.IsNaN(t.Left) || Double.IsNaN(t.Right) || Double.IsNaN(t.Top) || Double.IsNaN(t.Bottom)) 538if (!Double.IsNaN(t.Left) && (t.Left < 0 || t.Left > maxThickness)) 542if (!Double.IsNaN(t.Right) && (t.Right < 0 || t.Right > maxThickness)) 546if (!Double.IsNaN(t.Top) && (t.Top < 0 || t.Top > maxThickness)) 550if (!Double.IsNaN(t.Bottom) && (t.Bottom < 0 || t.Bottom > maxThickness))
System\Windows\Documents\ColumnResizeAdorner.cs (3)
37_x = Double.NaN; 38_top = Double.NaN; 39_height = Double.NaN;
System\Windows\Documents\Figure.cs (1)
299if (Double.IsNaN(offset))
System\Windows\Documents\FixedPage.cs (6)
450new FrameworkPropertyMetadata(Double.NaN, FrameworkPropertyMetadataOptions.AffectsParentArrange)); 467new FrameworkPropertyMetadata(Double.NaN, FrameworkPropertyMetadataOptions.AffectsParentArrange)); 484new FrameworkPropertyMetadata(Double.NaN, FrameworkPropertyMetadataOptions.AffectsParentArrange)); 502new FrameworkPropertyMetadata(Double.NaN, FrameworkPropertyMetadataOptions.AffectsParentArrange)); 740Size childConstraint = new Size(Double.PositiveInfinity, Double.PositiveInfinity);
System\Windows\Documents\FixedTextView.cs (5)
68if (point.Y == Double.MaxValue && point.X == Double.MaxValue) 815double closestDistance = Double.MaxValue; 887if (Double.IsInfinity(suggestedX)) 896double closestDistance = Double.MaxValue;
System\Windows\Documents\Floater.cs (2)
104Double.NaN, 132if (Double.IsNaN(width))
System\Windows\Documents\FlowDocument.cs (8)
695new Thickness(Double.NaN), 1517if (Double.IsNaN(value)) 1532if (Double.IsNaN(value)) 1536if (!Double.IsNegativeInfinity(value) && (value < 0 || value > maxSize)) 1547if (Double.IsNaN(value)) 1551if (!Double.IsPositiveInfinity(value) && (value < 0 || value > maxSize)) 1568if (Double.IsNaN(ruleWidth) || ruleWidth < 0 || ruleWidth > maxRuleWidth) 1579if (Double.IsNaN(gap))
System\Windows\Documents\Glyphs.cs (2)
834new FrameworkPropertyMetadata(Double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, new PropertyChangedCallback(OriginPropertyChanged))); 857new FrameworkPropertyMetadata(Double.NaN, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender, new PropertyChangedCallback(OriginPropertyChanged)));
System\Windows\Documents\ImmComposition.cs (1)
1811if (Double.IsNaN(value))
System\Windows\Documents\List.cs (2)
116Double.NaN, 329if (Double.IsNaN(value))
System\Windows\Documents\Paragraph.cs (6)
235return (Double.IsNaN(margin.Left) && Double.IsNaN(margin.Right) && Double.IsNaN(margin.Top) && Double.IsNaN(margin.Bottom)); 240return (Double.IsNaN(lineHeight)); 304if (Double.IsNaN(indent))
System\Windows\Documents\Table.cs (2)
32MarginProperty.OverrideMetadata(typeof(Table), new FrameworkPropertyMetadata(new Thickness(Double.NaN))); 367if (Double.IsNaN(spacing))
System\windows\Documents\TextEditor.cs (1)
1969internal Double _suggestedX;
System\windows\Documents\TextEditorSelection.cs (6)
94This._suggestedX = Double.NaN; 2218private static Double GetSuggestedX(TextEditor This, out ITextPointer innerMovingPosition) 2228return Double.NaN; // This value is not supposed to be used by a caller. 2231if (Double.IsNaN(This._suggestedX)) 2266private static Double GetSuggestedYFromPosition(TextEditor This, ITextPointer position) 2268double suggestedY = Double.NaN;
System\Windows\Documents\TextElement.cs (1)
1589if (Double.IsNaN(fontSize))
System\Windows\Documents\TextPointerBase.cs (1)
809position = textView.GetPositionAtNextLine(thisPointer, Double.NaN, count, out newSuggestedX, out count);
System\Windows\FontSizeConverter.cs (1)
80if (value is System.Int32 || value is System.Single || value is System.Double)
System\Windows\FrameworkElement.cs (36)
3440return (double.IsNaN(v)) || (v >= 0.0d && !Double.IsPositiveInfinity(v)); 3446return (!double.IsNaN(v) && v >= 0.0d && !Double.IsPositiveInfinity(v)); 3472Double.NaN, 3524Double.PositiveInfinity, 3551Double.NaN, 3603Double.PositiveInfinity, 4044double height = (double.IsNaN(l) ? Double.PositiveInfinity : l); 4054double width = (double.IsNaN(l) ? Double.PositiveInfinity : l); 4113Double xConstr = transformSpaceBounds.Width; 4114Double yConstr = transformSpaceBounds.Height; 4120bool xConstrInfinite = Double.IsInfinity(xConstr); 4121bool yConstrInfinite = Double.IsInfinity(yConstr); 4125return new Size(Double.PositiveInfinity, Double.PositiveInfinity); 4145Double a = trMatrix.M11; 4146Double b = trMatrix.M12; 4147Double c = trMatrix.M21; 4148Double d = trMatrix.M22; 4151Double w=0, h=0; 4160Double yCoverD = (yConstrInfinite ? Double.PositiveInfinity : Math.Abs(yConstr/d)); 4161Double xCoverA = (xConstrInfinite ? Double.PositiveInfinity : Math.Abs(xConstr/a)); 4200Double yCoverB = Math.Abs(yConstr/b); 4201Double xCoverC = Math.Abs(xConstr/c); 4238Double xCoverA = Math.Abs(xConstr / a); // w-intercept of x-constraint line. 4239Double xCoverC = Math.Abs(xConstr / c); // h-intercept of x-constraint line. 4241Double yCoverB = Math.Abs(yConstr / b); // w-intercept of y-constraint line. 4242Double yCoverD = Math.Abs(yConstr / d); // h-intercept of y-constraint line. 4267Double expandFactor = Math.Min(xConstr / childBoundsTr.Width, 4269if( !Double.IsNaN(expandFactor) 4270&& !Double.IsInfinity(expandFactor)) 4889double maxWidthClip = (Double.IsPositiveInfinity(mm.maxWidth) ? inkSize.Width : mm.maxWidth); 4890double maxHeightClip = (Double.IsPositiveInfinity(mm.maxHeight) ? inkSize.Height : mm.maxHeight); 5232double maxWidthClip = (Double.IsPositiveInfinity(mm.maxWidth) ? inkSize.Width : mm.maxWidth); 5233double maxHeightClip = (Double.IsPositiveInfinity(mm.maxHeight) ? inkSize.Height : mm.maxHeight);
System\Windows\Input\KeyboardNavigation.cs (1)
3458private const double BASELINE_DEFAULT = Double.MinValue;
System\Windows\Interop\ActiveXHost.cs (2)
195if (Double.IsPositiveInfinity(swConstraint.Width)) 200if (Double.IsPositiveInfinity(swConstraint.Height))
System\Windows\LengthConverter.cs (1)
196return Double.NaN;
System\Windows\Markup\Baml2006\Baml2006KnownTypes.cs (1)
261case 168: t = () => typeof(Double); break;
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
4047typeof(System.Double),
System\Windows\Markup\KnownTypes.cs (1)
5715case KnownElements.Double: t = typeof(System.Double); break;
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (6)
375Double currentSegmentProgress = 0.0; 431Double currentRepeat = (Double)(animationClock.CurrentIteration - 1); 922List<Double> segmentLengths = new List<Double>(); 930Double totalLength = 0.0;
System\Windows\Media\Animation\Storyboard.cs (12)
1287public Nullable<Double> GetCurrentGlobalSpeed( FrameworkElement containingObject ) 1297public Nullable<Double> GetCurrentGlobalSpeed( FrameworkContentElement containingObject ) 1306public Double GetCurrentGlobalSpeed() 1308Nullable<Double> currentGlobalSpeed = GetCurrentGlobalSpeedImpl(this); 1316return default(Double); 1320private Nullable<Double> GetCurrentGlobalSpeedImpl( DependencyObject containingObject ) 1385public Nullable<Double> GetCurrentProgress( FrameworkElement containingObject ) 1394public Nullable<Double> GetCurrentProgress( FrameworkContentElement containingObject ) 1403public Double GetCurrentProgress() 1405Nullable<Double> currentProgress = GetCurrentProgressImpl(this); 1413return default(Double); 1417private Nullable<Double> GetCurrentProgressImpl( DependencyObject containingObject )
System\Windows\Shapes\Ellipse.cs (4)
82if (Double.IsInfinity(width) && Double.IsInfinity(height)) 86else if (Double.IsInfinity(width) || Double.IsInfinity(height))
System\Windows\Shapes\Rectangle.cs (4)
135if (Double.IsInfinity(width) && Double.IsInfinity(height)) 139else if (Double.IsInfinity(width) || Double.IsInfinity(height))
System\Windows\Shapes\Shape.cs (5)
523return !(Double.IsInfinity(d) || double.IsNaN(d) || d < 0.0); 528return !(Double.IsInfinity(d) || double.IsNaN(d)); 533return !(Double.IsInfinity(d)); 599if (geometryBounds.Width > xScale * Double.Epsilon) 613if (geometryBounds.Height > yScale * Double.Epsilon)
System\Windows\Thickness.cs (8)
163if(Double.IsPositiveInfinity(Left) || Double.IsPositiveInfinity(Right) || Double.IsPositiveInfinity(Top) || Double.IsPositiveInfinity(Bottom)) 171if(Double.IsNegativeInfinity(Left) || Double.IsNegativeInfinity(Right) || Double.IsNegativeInfinity(Top) || Double.IsNegativeInfinity(Bottom))
System\Windows\Window.cs (23)
953Double.NaN, 1004Double.NaN, 2781if (!Double.IsPositiveInfinity(maxSizeDeviceUnits.X) && (sizeDeviceUnits.Width > maxSizeDeviceUnits.X)) 2787if (!Double.IsPositiveInfinity(minSizeDeviceUnits.Y) && (sizeDeviceUnits.Height > maxSizeDeviceUnits.Y)) 3415Width = ((constraint.Width == Double.PositiveInfinity) ? Double.PositiveInfinity : Math.Max(0.0, (constraint.Width - frameSize.Width))), 3416Height = ((constraint.Height == Double.PositiveInfinity) ? Double.PositiveInfinity : Math.Max(0.0, (constraint.Height - frameSize.Height))) 3480if (!Double.IsPositiveInfinity(MaxWidth)) 3502if (!Double.IsPositiveInfinity(MaxHeight)) 5683if (!Double.IsPositiveInfinity(l) && !double.IsNaN(l) && 5694if (Double.IsPositiveInfinity(length) || 5695Double.IsNegativeInfinity(length)) 6121Invariant.Assert(!Double.IsNaN(_actualLeft), "_actualLeft cannot be NaN after show"); 6122UpdateHwndPositionOnTopLeftChange(Double.IsNaN(Left) ? _actualLeft : Left, newTop); 6216Invariant.Assert(!Double.IsNaN(_actualTop), "_actualTop cannot be NaN after show"); 6217UpdateHwndPositionOnTopLeftChange(newLeft, Double.IsNaN(Top) ? _actualTop : Top); 7265private double _trackMaxWidthDeviceUnits = Double.PositiveInfinity; 7266private double _trackMaxHeightDeviceUnits = Double.PositiveInfinity; 7267private double _windowMaxWidthDeviceUnits = Double.PositiveInfinity; 7268private double _windowMaxHeightDeviceUnits = Double.PositiveInfinity; 7270private double _actualTop = Double.NaN; 7272private double _actualLeft = Double.NaN;
PresentationFramework.Aero (6)
Microsoft\Windows\Themes\ProgressBarHighlightConverter.cs (4)
50if (width <= 0.0 || Double.IsInfinity(width) || Double.IsNaN(width) || 51height <= 0.0 || Double.IsInfinity(height) || Double.IsNaN(height) )
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (2)
190if (!Double.IsInfinity(childWidth)) 195if (!Double.IsInfinity(childHeight))
PresentationFramework.Aero2 (6)
Microsoft\Windows\Themes\ProgressBarHighlightConverter.cs (4)
50if (width <= 0.0 || Double.IsInfinity(width) || Double.IsNaN(width) || 51height <= 0.0 || Double.IsInfinity(height) || Double.IsNaN(height) )
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (2)
190if (!Double.IsInfinity(childWidth)) 195if (!Double.IsInfinity(childHeight))
PresentationFramework.AeroLite (6)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (2)
190if (!Double.IsInfinity(childWidth)) 195if (!Double.IsInfinity(childHeight))
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (4)
54if (width <= 0.0 || Double.IsInfinity(width) || Double.IsNaN(width) || 55height <= 0.0 || Double.IsInfinity(height) || Double.IsNaN(height) )
PresentationFramework.Classic (6)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (2)
190if (!Double.IsInfinity(childWidth)) 195if (!Double.IsInfinity(childHeight))
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (4)
54if (width <= 0.0 || Double.IsInfinity(width) || Double.IsNaN(width) || 55height <= 0.0 || Double.IsInfinity(height) || Double.IsNaN(height) )
PresentationFramework.Luna (6)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (2)
190if (!Double.IsInfinity(childWidth)) 195if (!Double.IsInfinity(childHeight))
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (4)
54if (width <= 0.0 || Double.IsInfinity(width) || Double.IsNaN(width) || 55height <= 0.0 || Double.IsInfinity(height) || Double.IsNaN(height) )
PresentationFramework.Royale (6)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (2)
190if (!Double.IsInfinity(childWidth)) 195if (!Double.IsInfinity(childHeight))
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (4)
54if (width <= 0.0 || Double.IsInfinity(width) || Double.IsNaN(width) || 55height <= 0.0 || Double.IsInfinity(height) || Double.IsNaN(height) )
ReachFramework (23)
AlphaFlattener\BrushProxy.cs (6)
3708double min = Double.MaxValue; 3709double max = Double.MinValue; 3944if (Math.Abs(di) < Double.Epsilon) 4213double mint = Double.MaxValue; 4214double maxt = Double.MinValue; 4429if (len < Double.Epsilon)
AlphaFlattener\PrimitiveList.cs (2)
52else if (obj is Double) 54s = ((Double)obj).ToString("F1", CultureInfo.InvariantCulture);
AlphaFlattener\SegmentTree.cs (8)
154if (! Double.Equals(values[i].value, val)) 171if (! Double.Equals(values[i].value, newvalues[last].value)) 200AddPoint(0, -1, Double.MinValue, Double.MinValue); 220AddPoint(p, count + 1, Double.MaxValue, Double.MaxValue); 238bool left = Double.Equals(c.value, dl[c.index].Left); 292if (Double.Equals(c.value, dl[c.index].Left))
AlphaFlattener\Utility.cs (1)
1063else if (Double.IsNaN(opacity) || (opacity < 0))
PrintConfig\PrintSchema.cs (1)
1784public const double UnspecifiedDoubleValue = System.Double.MinValue;
Serialization\Manager\ReachSerializationUtils.cs (4)
1176Double.IsPositiveInfinity(documentSize.Width) || 1177Double.IsPositiveInfinity(documentSize.Height) || 1178Double.IsNegativeInfinity(documentSize.Width) || 1179Double.IsNegativeInfinity(documentSize.Height)
Serialization\VisualSerializer.cs (1)
225Double d = CheckFloat((double) obj);
Roslyn.VisualStudio.Next.UnitTests (1)
Services\PerformanceTrackerServiceTests.cs (1)
177var timeSpan = kv.Value[index];
RunTests (1)
AssemblyScheduler.cs (1)
228var executionTime = tests
Stress.ApiService (1)
TestMetrics.cs (1)
46var sum = 0d;
System.Linq.Expressions (3)
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (3)
64case TypeCode.Double: return FastCreate<Double>(target, pi); 108case TypeCode.Double: return FastCreate<T0, Double>(target, pi); 150case TypeCode.Double: return new FuncCallInstruction<T0, T1, Double>(target);
System.Private.CoreLib (152)
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (1)
1970double IConvertible.ToDouble(IFormatProvider? provider) => throw InvalidCast(nameof(Double));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (151)
19using NativeType = System.Double; 35private readonly NativeType _value; 50_value = (NativeType)value; 57get => new NFloat(NativeType.Epsilon); 64get => new NFloat(NativeType.MaxValue); 71get => new NFloat(NativeType.MinValue); 78get => new NFloat(NativeType.NaN); 85get => new NFloat(NativeType.NegativeInfinity); 92get => new NFloat(NativeType.PositiveInfinity); 99get => sizeof(NativeType); 131NativeType tmp = value._value; 142NativeType tmp = value._value; 240public static explicit operator NFloat(decimal value) => new NFloat((NativeType)value); 246public static explicit operator NFloat(double value) => new NFloat((NativeType)value); 459public static implicit operator NFloat(byte value) => new NFloat((NativeType)value); 465public static implicit operator NFloat(char value) => new NFloat((NativeType)value); 477public static implicit operator NFloat(short value) => new NFloat((NativeType)value); 483public static implicit operator NFloat(int value) => new NFloat((NativeType)value); 489public static implicit operator NFloat(long value) => new NFloat((NativeType)value); 509public static implicit operator NFloat(nint value) => new NFloat((NativeType)value); 516public static implicit operator NFloat(sbyte value) => new NFloat((NativeType)value); 522public static implicit operator NFloat(float value) => new NFloat((NativeType)value); 529public static implicit operator NFloat(ushort value) => new NFloat((NativeType)value); 536public static implicit operator NFloat(uint value) => new NFloat((NativeType)value); 543public static implicit operator NFloat(ulong value) => new NFloat((NativeType)value); 557public static implicit operator NFloat(nuint value) => new NFloat((NativeType)value); 572public static bool IsFinite(NFloat value) => NativeType.IsFinite(value._value); 578public static bool IsInfinity(NFloat value) => NativeType.IsInfinity(value._value); 584public static bool IsNaN(NFloat value) => NativeType.IsNaN(value._value); 590public static bool IsNegative(NFloat value) => NativeType.IsNegative(value._value); 596public static bool IsNegativeInfinity(NFloat value) => NativeType.IsNegativeInfinity(value._value); 602public static bool IsNormal(NFloat value) => NativeType.IsNormal(value._value); 608public static bool IsPositiveInfinity(NFloat value) => NativeType.IsPositiveInfinity(value._value); 614public static bool IsSubnormal(NFloat value) => NativeType.IsSubnormal(value._value); 623var result = NativeType.Parse(s); 640var result = NativeType.Parse(s, style); 652var result = NativeType.Parse(s, provider); 670var result = NativeType.Parse(s, style, provider); 687var result = NativeType.Parse(s, style, provider); 698return NativeType.TryParse(s, out Unsafe.As<NFloat, NativeType>(ref result)); 708return NativeType.TryParse(s, out Unsafe.As<NFloat, NativeType>(ref result)); 718return NativeType.TryParse(utf8Text, out Unsafe.As<NFloat, NativeType>(ref result)); 735return NativeType.TryParse(s, style, provider, out Unsafe.As<NFloat, NativeType>(ref result)); 752return NativeType.TryParse(s, style, provider, out Unsafe.As<NFloat, NativeType>(ref result)); 870static NFloat IAdditiveIdentity<NFloat, NFloat>.AdditiveIdentity => new NFloat(NativeType.AdditiveIdentity); 889public static bool IsPow2(NFloat value) => NativeType.IsPow2(value._value); 892public static NFloat Log2(NFloat value) => new NFloat(NativeType.Log2(value._value)); 907NativeType result = BitConverter.UInt64BitsToDouble(bits); 921NativeType result = BitConverter.UInt64BitsToDouble(bits); 935NativeType result = BitConverter.UInt64BitsToDouble(bits); 949NativeType result = BitConverter.UInt64BitsToDouble(bits); 959public static NFloat Exp(NFloat x) => new NFloat(NativeType.Exp(x._value)); 962public static NFloat ExpM1(NFloat x) => new NFloat(NativeType.ExpM1(x._value)); 965public static NFloat Exp2(NFloat x) => new NFloat(NativeType.Exp2(x._value)); 968public static NFloat Exp2M1(NFloat x) => new NFloat(NativeType.Exp2M1(x._value)); 971public static NFloat Exp10(NFloat x) => new NFloat(NativeType.Exp10(x._value)); 974public static NFloat Exp10M1(NFloat x) => new NFloat(NativeType.Exp10M1(x._value)); 981public static NFloat Ceiling(NFloat x) => new NFloat(NativeType.Ceiling(x._value)); 992public static NFloat Floor(NFloat x) => new NFloat(NativeType.Floor(x._value)); 995public static NFloat Round(NFloat x) => new NFloat(NativeType.Round(x._value)); 998public static NFloat Round(NFloat x, int digits) => new NFloat(NativeType.Round(x._value, digits)); 1001public static NFloat Round(NFloat x, MidpointRounding mode) => new NFloat(NativeType.Round(x._value, mode)); 1004public static NFloat Round(NFloat x, int digits, MidpointRounding mode) => new NFloat(NativeType.Round(x._value, digits, mode)); 1007public static NFloat Truncate(NFloat x) => new NFloat(NativeType.Truncate(x._value)); 1141public static NFloat E => new NFloat(NativeType.E); 1144public static NFloat Pi => new NFloat(NativeType.Pi); 1147public static NFloat Tau => new NFloat(NativeType.Tau); 1154public static NFloat NegativeZero => new NFloat(NativeType.NegativeZero); 1157public static NFloat Atan2(NFloat y, NFloat x) => new NFloat(NativeType.Atan2(y._value, x._value)); 1160public static NFloat Atan2Pi(NFloat y, NFloat x) => new NFloat(NativeType.Atan2Pi(y._value, x._value)); 1163public static NFloat BitDecrement(NFloat x) => new NFloat(NativeType.BitDecrement(x._value)); 1166public static NFloat BitIncrement(NFloat x) => new NFloat(NativeType.BitIncrement(x._value)); 1169public static NFloat FusedMultiplyAdd(NFloat left, NFloat right, NFloat addend) => new NFloat(NativeType.FusedMultiplyAdd(left._value, right._value, addend._value)); 1172public static NFloat Ieee754Remainder(NFloat left, NFloat right) => new NFloat(NativeType.Ieee754Remainder(left._value, right._value)); 1175public static int ILogB(NFloat x) => NativeType.ILogB(x._value); 1178public static NFloat Lerp(NFloat value1, NFloat value2, NFloat amount) => new NFloat(NativeType.Lerp(value1._value, value2._value, amount._value)); 1181public static NFloat ReciprocalEstimate(NFloat x) => new NFloat(NativeType.ReciprocalEstimate(x._value)); 1184public static NFloat ReciprocalSqrtEstimate(NFloat x) => new NFloat(NativeType.ReciprocalSqrtEstimate(x._value)); 1187public static NFloat ScaleB(NFloat x, int n) => new NFloat(NativeType.ScaleB(x._value, n)); 1197public static NFloat Acosh(NFloat x) => new NFloat(NativeType.Acosh(x._value)); 1200public static NFloat Asinh(NFloat x) => new NFloat(NativeType.Asinh(x._value)); 1203public static NFloat Atanh(NFloat x) => new NFloat(NativeType.Atanh(x._value)); 1206public static NFloat Cosh(NFloat x) => new NFloat(NativeType.Cosh(x._value)); 1209public static NFloat Sinh(NFloat x) => new NFloat(NativeType.Sinh(x._value)); 1212public static NFloat Tanh(NFloat x) => new NFloat(NativeType.Tanh(x._value)); 1219public static NFloat Log(NFloat x) => new NFloat(NativeType.Log(x._value)); 1222public static NFloat Log(NFloat x, NFloat newBase) => new NFloat(NativeType.Log(x._value, newBase._value)); 1225public static NFloat LogP1(NFloat x) => new NFloat(NativeType.LogP1(x._value)); 1228public static NFloat Log2P1(NFloat x) => new NFloat(NativeType.Log2P1(x._value)); 1231public static NFloat Log10(NFloat x) => new NFloat(NativeType.Log10(x._value)); 1234public static NFloat Log10P1(NFloat x) => new NFloat(NativeType.Log10P1(x._value)); 1241static NFloat IMultiplicativeIdentity<NFloat, NFloat>.MultiplicativeIdentity => new NFloat(NativeType.MultiplicativeIdentity); 1248public static NFloat Clamp(NFloat value, NFloat min, NFloat max) => new NFloat(NativeType.Clamp(value._value, min._value, max._value)); 1251public static NFloat ClampNative(NFloat value, NFloat min, NFloat max) => new NFloat(NativeType.ClampNative(value._value, min._value, max._value)); 1254public static NFloat CopySign(NFloat value, NFloat sign) => new NFloat(NativeType.CopySign(value._value, sign._value)); 1257public static NFloat Max(NFloat x, NFloat y) => new NFloat(NativeType.Max(x._value, y._value)); 1260public static NFloat MaxNative(NFloat x, NFloat y) => new NFloat(NativeType.MaxNative(x._value, y._value)); 1263public static NFloat MaxNumber(NFloat x, NFloat y) => new NFloat(NativeType.MaxNumber(x._value, y._value)); 1266public static NFloat Min(NFloat x, NFloat y) => new NFloat(NativeType.Min(x._value, y._value)); 1269public static NFloat MinNative(NFloat x, NFloat y) => new NFloat(NativeType.MinNative(x._value, y._value)); 1272public static NFloat MinNumber(NFloat x, NFloat y) => new NFloat(NativeType.MinNumber(x._value, y._value)); 1275public static int Sign(NFloat value) => NativeType.Sign(value._value); 1282static NFloat INumberBase<NFloat>.One => new NFloat(NativeType.One); 1288static NFloat INumberBase<NFloat>.Zero => new NFloat(NativeType.Zero); 1291public static NFloat Abs(NFloat value) => new NFloat(NativeType.Abs(value._value)); 1357public static bool IsEvenInteger(NFloat value) => NativeType.IsEvenInteger(value._value); 1363public static bool IsInteger(NFloat value) => NativeType.IsInteger(value._value); 1366public static bool IsOddInteger(NFloat value) => NativeType.IsOddInteger(value._value); 1369public static bool IsPositive(NFloat value) => NativeType.IsPositive(value._value); 1372public static bool IsRealNumber(NFloat value) => NativeType.IsRealNumber(value._value); 1378public static NFloat MaxMagnitude(NFloat x, NFloat y) => new NFloat(NativeType.MaxMagnitude(x._value, y._value)); 1381public static NFloat MaxMagnitudeNumber(NFloat x, NFloat y) => new NFloat(NativeType.MaxMagnitudeNumber(x._value, y._value)); 1384public static NFloat MinMagnitude(NFloat x, NFloat y) => new NFloat(NativeType.MinMagnitude(x._value, y._value)); 1387public static NFloat MinMagnitudeNumber(NFloat x, NFloat y) => new NFloat(NativeType.MinMagnitudeNumber(x._value, y._value)); 1390public static NFloat MultiplyAddEstimate(NFloat left, NFloat right, NFloat addend) => new NFloat(NativeType.MultiplyAddEstimate(left._value, right._value, addend._value)); 1801public static NFloat Pow(NFloat x, NFloat y) => new NFloat(NativeType.Pow(x._value, y._value)); 1808public static NFloat Cbrt(NFloat x) => new NFloat(NativeType.Cbrt(x._value)); 1811public static NFloat Hypot(NFloat x, NFloat y) => new NFloat(NativeType.Hypot(x._value, y._value)); 1814public static NFloat RootN(NFloat x, int n) => new NFloat(NativeType.RootN(x._value, n)); 1817public static NFloat Sqrt(NFloat x) => new NFloat(NativeType.Sqrt(x._value)); 1824static NFloat ISignedNumber<NFloat>.NegativeOne => new NFloat(NativeType.NegativeOne); 1841public static NFloat Acos(NFloat x) => new NFloat(NativeType.Acos(x._value)); 1844public static NFloat AcosPi(NFloat x) => new NFloat(NativeType.AcosPi(x._value)); 1847public static NFloat Asin(NFloat x) => new NFloat(NativeType.Asin(x._value)); 1850public static NFloat AsinPi(NFloat x) => new NFloat(NativeType.AsinPi(x._value)); 1853public static NFloat Atan(NFloat x) => new NFloat(NativeType.Atan(x._value)); 1856public static NFloat AtanPi(NFloat x) => new NFloat(NativeType.AtanPi(x._value)); 1859public static NFloat Cos(NFloat x) => new NFloat(NativeType.Cos(x._value)); 1862public static NFloat CosPi(NFloat x) => new NFloat(NativeType.CosPi(x._value)); 1870return new NFloat(NativeType.DegreesToRadians(degrees._value)); 1879return new NFloat(NativeType.RadiansToDegrees(radians._value)); 1883public static NFloat Sin(NFloat x) => new NFloat(NativeType.Sin(x._value)); 1888var (sin, cos) = NativeType.SinCos(x._value); 1895var (sinPi, cosPi) = NativeType.SinCosPi(x._value); 1900public static NFloat SinPi(NFloat x) => new NFloat(NativeType.SinPi(x._value)); 1903public static NFloat Tan(NFloat x) => new NFloat(NativeType.Tan(x._value)); 1906public static NFloat TanPi(NFloat x) => new NFloat(NativeType.TanPi(x._value)); 1915var result = NativeType.Parse(utf8Text, style, provider); 1923return NativeType.TryParse(utf8Text, style, provider, out Unsafe.As<NFloat, NativeType>(ref result));
System.Private.DataContractSerialization (3)
System\Xml\XmlDictionaryReader.cs (3)
1704throw XmlExceptionHelper.CreateConversionException(nameof(Double), exception); 1708throw XmlExceptionHelper.CreateConversionException(nameof(Double), exception); 1712throw XmlExceptionHelper.CreateConversionException(nameof(Double), exception);
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
175[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Double))]
System.Windows.Controls.Ribbon (10)
Microsoft\Windows\Controls\KeyTipAdorner.cs (2)
70Size childConstraint = new Size(Double.PositiveInfinity, Double.PositiveInfinity);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGalleryCategoriesPanel.cs (1)
444layoutSlotSize.Height = Double.PositiveInfinity;
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarOverflowPanel.cs (1)
27Size infinity = new Size(Double.PositiveInfinity, availableSize.Height);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarPanel.cs (1)
201Size infinity = new Size(Double.PositiveInfinity, availableSize.Height);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonScrollButtonVisibilityConverter.cs (1)
70target = Double.Parse(parameterString, NumberFormatInfo.InvariantInfo);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonTabHeadersPanel.cs (3)
131ribbonTabHeader.Measure(new Size(Double.MaxValue, childConstraint.Height)); 480return Double.MaxValue; 786if (Double.IsInfinity(viewportWidth))
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (1)
1165return (double.IsNaN(v)) || (v >= 0.0d && !Double.IsPositiveInfinity(v));
UIAutomationClient (2)
MS\Internal\Automation\ClickablePoint.cs (2)
97Double size = rect.Width * rect.Height; 128Double size = rect.Width * rect.Height;
UIAutomationClientSideProviders (5)
MS\Internal\AutomationProxies\WindowsIPAddress.cs (2)
425return Double.NaN; 433return Double.NaN;
MS\Internal\AutomationProxies\WindowsProgressbar.cs (2)
126return Double.NaN; 134return Double.NaN;
MS\Internal\AutomationProxies\WindowsUpDown.cs (1)
274return Double.NaN;
Wasm.Performance.ConsoleHost (1)
Scenarios\ComponentRenderingScenarioBase.cs (1)
37var durationPerCycle = (duration / numCycles).TotalMilliseconds;
WindowsFormsIntegration (2)
System\Windows\Integration\ElementHost.cs (2)
108if (constraints.Width == Int32.MaxValue) { constraints.Width = Double.PositiveInfinity; } 109if (constraints.Height == Int32.MaxValue) { constraints.Height = Double.PositiveInfinity; }
xunit.assert (16)
EqualityAsserts.cs (16)
346 var expectedRounded = Math.Round(expected, precision); 347 var actualRounded = Math.Round(actual, precision); 372 var expectedRounded = Math.Round(expected, precision, rounding); 373 var actualRounded = Math.Round(actual, precision, rounding); 418 var expectedRounded = Math.Round(expected, precision); 419 var actualRounded = Math.Round(actual, precision); 444 var expectedRounded = Math.Round(expected, precision, rounding); 445 var actualRounded = Math.Round(actual, precision, rounding); 827 var expectedRounded = Math.Round(expected, precision); 828 var actualRounded = Math.Round(actual, precision); 853 var expectedRounded = Math.Round(expected, precision, rounding); 854 var actualRounded = Math.Round(actual, precision, rounding); 899 var expectedRounded = Math.Round(expected, precision); 900 var actualRounded = Math.Round(actual, precision); 925 var expectedRounded = Math.Round(expected, precision, rounding); 926 var actualRounded = Math.Round(actual, precision, rounding);