5 instantiations of Double
PresentationCore (4)
PresentationFramework (1)
3744 references to Double
AnalyzerRunner (2)
Aspire.Dashboard (9)
Aspire.Dashboard.Tests (1)
CodeGenerator (3)
dotnet-svcutil-lib (40)
HeaderPropagationSample (1)
InMemory.FunctionalTests (1)
Microsoft.Analyzers.Local (2)
Microsoft.AspNetCore.Components (4)
Microsoft.AspNetCore.Components.Server (2)
Microsoft.AspNetCore.Components.Tests (2)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
Microsoft.AspNetCore.ConcurrencyLimiter (1)
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (1)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (4)
Microsoft.AspNetCore.Hosting.Tests (1)
Microsoft.AspNetCore.HttpLogging.Tests (7)
Microsoft.AspNetCore.Identity.FunctionalTests (3)
Microsoft.AspNetCore.Mvc.Core (1)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (2)
Microsoft.AspNetCore.Mvc.TagHelpers (1)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
Microsoft.AspNetCore.OpenApi (1)
Microsoft.AspNetCore.ResponseCompression (1)
Microsoft.AspNetCore.Routing (9)
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
Microsoft.AspNetCore.SignalR.Tests (1)
Microsoft.Build (6)
Microsoft.Build.Engine.UnitTests (1)
Microsoft.Build.Tasks.Core (3)
Microsoft.Build.Utilities.Core (1)
Microsoft.Build.Utilities.UnitTests (2)
Microsoft.CodeAnalysis (5)
Microsoft.CodeAnalysis.CodeStyle (2)
Microsoft.CodeAnalysis.CSharp (1)
Microsoft.CodeAnalysis.CSharp.Features (1)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (13)
Microsoft.CodeAnalysis.EditorFeatures (15)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (13)
Microsoft.CodeAnalysis.Remote.ServiceHub (4)
Microsoft.CodeAnalysis.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces (9)
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
Microsoft.Data.Analysis (104)
Microsoft.DotNet.Helix.Sdk (1)
Microsoft.Extensions.Caching.Hybrid.Tests (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (25)
Microsoft.Extensions.Diagnostics.Testing.Tests (1)
Microsoft.Extensions.Http.Diagnostics (1)
Microsoft.Extensions.Http.Resilience (4)
Microsoft.Extensions.TimeProvider.Testing.Tests (1)
Microsoft.Maui (54)
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;
Microsoft.Maui.Controls (59)
Microsoft.Maui.Controls.Build.Tasks (4)
Microsoft.Maui.Controls.DesignTools (2)
Microsoft.Maui.Controls.Foldable (12)
Microsoft.Maui.Controls.Xaml (2)
Microsoft.Maui.Essentials (10)
Microsoft.Maui.Graphics (13)
Microsoft.Maui.Graphics.Skia (1)
Microsoft.Maui.Maps (6)
Microsoft.Maui.Resizetizer (6)
Microsoft.ML.AutoML (84)
Microsoft.ML.AutoML.Samples (1)
Microsoft.ML.AutoML.SourceGenerator (2)
Microsoft.ML.AutoML.Tests (25)
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)
Microsoft.ML.Core (183)
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\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;
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);
Microsoft.ML.CpuMath (12)
Microsoft.ML.Data (885)
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);
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\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;
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\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) =>
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)
Microsoft.ML.EntryPoints (4)
Microsoft.ML.Fairlearn (1)
Microsoft.ML.FastTree (154)
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)
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))
Microsoft.ML.GenAI.Core (3)
Microsoft.ML.GenAI.Phi (1)
Microsoft.ML.ImageAnalytics (1)
Microsoft.ML.IntegrationTests (6)
Microsoft.ML.KMeansClustering (11)
Microsoft.ML.LightGbm (1)
Microsoft.ML.Mkl.Components (48)
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)
Microsoft.ML.Parquet (6)
Microsoft.ML.PCA (3)
Microsoft.ML.Predictor.Tests (8)
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)
Microsoft.ML.Samples (6)
Microsoft.ML.SearchSpace (12)
Microsoft.ML.StandardTrainers (62)
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;
Microsoft.ML.Sweeper (35)
Microsoft.ML.TensorFlow (1)
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 });
Microsoft.ML.Tests (33)
Microsoft.ML.TimeSeries (178)
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>
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);
Microsoft.ML.TorchSharp (2)
Microsoft.ML.TorchSharp.Tests (2)
Microsoft.ML.Transforms (239)
Microsoft.ML.Vision (1)
Microsoft.Net.Http.Headers (8)
Microsoft.Net.Http.Headers.Tests (2)
Microsoft.VisualBasic.Core (2)
Microsoft.VisualStudio.LanguageServices (3)
MSBuild (2)
mscorlib (1)
netstandard (1)
PresentationBuildTasks (5)
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)
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);
PresentationFramework (401)
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); }
PresentationFramework.Aero (6)
PresentationFramework.Aero2 (6)
PresentationFramework.AeroLite (6)
PresentationFramework.Classic (6)
PresentationFramework.Luna (6)
PresentationFramework.Royale (6)
ReachFramework (23)
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))
Roslyn.VisualStudio.Next.UnitTests (1)
RunTests (1)
Stress.ApiService (1)
System.Linq.Expressions (3)
System.Private.CoreLib (152)
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.Runtime (1)
System.Windows.Controls.Ribbon (10)
UIAutomationClient (2)
UIAutomationClientSideProviders (5)
Wasm.Performance.ConsoleHost (1)
WindowsFormsIntegration (2)
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);