144 references to Abs
Microsoft.Maui.Controls (1)
GradientStop.cs (1)
47 return Color == dest.Color && global::System.Math.Abs(Offset - dest.Offset) < 0.00001;
Microsoft.Maui.Graphics (24)
AbstractCanvas.cs (2)
160 var halfHeight = Math.Abs(height / 2); 164 var halfWidth = Math.Abs(width / 2);
ArcFlattener.cs (1)
36 _sweep = Math.Abs(endAngle - startAngle);
Color.cs (1)
157 if (Math.Abs(alpha - Alpha) < GeometryUtil.Epsilon)
GeometryUtil.cs (1)
214 if (Math.Abs(vAdjustedValue - vRange) < Epsilon)
GradientPaint.cs (1)
196 if (Math.Abs(currentOffset - offset) < GeometryUtil.Epsilon)
InsetsF.cs (8)
61 return Math.Abs(_top - value) < GeometryUtil.Epsilon && Math.Abs(_left - value) < GeometryUtil.Epsilon && Math.Abs(_right - value) < GeometryUtil.Epsilon && 62 Math.Abs(_bottom - value) < GeometryUtil.Epsilon; 69 return Math.Abs(vCompareTo.Top - Top) < GeometryUtil.Epsilon && Math.Abs(vCompareTo.Left - Left) < GeometryUtil.Epsilon && Math.Abs(vCompareTo.Bottom - Bottom) < GeometryUtil.Epsilon && 70 Math.Abs(vCompareTo.Right - Right) < GeometryUtil.Epsilon;
Matrix3x2Extensions.cs (4)
53 var sx = matrix.M12 == 0 ? Math.Abs(matrix.M11) : new Vector2(matrix.M11, matrix.M12).Length(); 54 var sy = matrix.M21 == 0 ? Math.Abs(matrix.M22) : new Vector2(matrix.M21, matrix.M22).Length(); 72 var sx = matrix.M12 == 0 ? Math.Abs(matrix.M11) : new Vector2(matrix.M11, matrix.M12).Length(); 73 var sy = matrix.M21 == 0 ? Math.Abs(matrix.M22) : new Vector2(matrix.M21, matrix.M22).Length();
PathF.cs (2)
1316 if (Math.Abs(arcAngle - compareTo.GetArcAngle(i)) > GeometryUtil.Epsilon) 1373 if (Math.Abs(arcAngle - compareTo.GetArcAngle(i)) > epsilon)
PointF.cs (2)
56 return Math.Abs(compareTo.X - X) < epsilon && Math.Abs(compareTo.Y - Y) < epsilon;
ScalingCanvas.cs (2)
215 _scaleX *= Math.Abs(sx); 216 _scaleY *= Math.Abs(sy);
Microsoft.Maui.Graphics.Skia (2)
SkiaCanvas.cs (2)
764 CurrentState.SetScale(Math.Abs(xFactor), Math.Abs(yFactor));
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (7)
src\Graphics\src\Graphics\Platforms\Windows\PlatformCanvas.cs (4)
178 var absRotation = Math.Abs(rotation); 566 var absRotation = Math.Abs(rotation); 855 _rect.Width = Math.Abs(width); 856 _rect.Height = Math.Abs(height);
src\Graphics\src\Graphics\Platforms\Windows\PlatformCanvasState.cs (1)
445 public float ActualShadowBlur => ShadowBlur * Math.Abs(_scale);
src\Graphics\src\Graphics\Platforms\Windows\PlatformImage.cs (2)
140 canvas.DrawImage(this, dirtyRect.Left, dirtyRect.Top, Math.Abs(dirtyRect.Width), Math.Abs(dirtyRect.Height));
Microsoft.ML.AutoML.Tests (5)
SweeperTests.cs (5)
119double metric = -200 * (Math.Abs(100 - x1) + 120Math.Abs(300 - x2) + 121Math.Abs(500 - x3) + 122Math.Abs(700 - x4)); 169double metric = ((5 - Math.Abs(4 - foo)) * 200) + (1001 - Math.Abs(33 - bar)) + rand.Next(1, 20);
Microsoft.ML.Core (5)
Utilities\BinFinder.cs (2)
454return Math.Abs(_accum[i] - ideal) < Math.Abs(_accum[j] - ideal);
Utilities\MathUtils.cs (3)
288float absDiff = Math.Abs(a - b); 291float maxAbs = Math.Max(Math.Abs(a), Math.Abs(b));
Microsoft.ML.Core.Tests (7)
UnitTests\TestVBuffer.cs (7)
97float l1 = a.Items().Sum(iv => Math.Abs(iv.Value)); 101float infNorm = a.GetValues().Length == 0 ? 0 : a.Items().Max(iv => Math.Abs(iv.Value)); 830var l1Dist = a.Items(all: true).Zip(b.Items(all: true), (av, bv) => Math.Abs(av.Value - bv.Value)).Sum(); 1050if (FloatUtils.GetBits(i) == FloatUtils.GetBits(j) || Math.Abs(i - j) == 0) 1053float comp = Math.Abs(i - j) / (Math.Abs(i) + Math.Abs(j));
Microsoft.ML.CpuMath (16)
AvxIntrinsics.cs (2)
1556*pDst2Current = Math.Abs(dst1) > threshold ? (dst1 > 0 ? dst1 - threshold : dst1 + threshold) : 0; 1615pdst2[index] = Math.Abs(dst1) > threshold ? (dst1 > 0 ? dst1 - threshold : dst1 + threshold) : 0;
CpuMathUtils.netcoreapp.cs (5)
307sum += Math.Abs(source[i] - mean); 336float abs = Math.Abs(source[i]); 370float abs = Math.Abs(source[i] - mean); 545w[i] = Math.Abs(value) > threshold ? (value > 0 ? value - threshold : value + threshold) : 0; 588w[index] = Math.Abs(value) > threshold ? (value > 0 ? value - threshold : value + threshold) : 0;
EigenUtils.cs (7)
43x = Math.Abs(x); 44y = Math.Abs(y); 63float xx = Math.Abs(x); 134scale += Math.Abs(d[k]); 358tst1 = Math.Abs(d[m]) + Math.Abs(d[m + 1]); 359tst2 = tst1 + Math.Abs(e[m]);
SseIntrinsics.cs (2)
1235*pDst2Current = Math.Abs(dst1) > threshold ? (dst1 > 0 ? dst1 - threshold : dst1 + threshold) : 0; 1280pdst2[index] = Math.Abs(dst1) > threshold ? (dst1 > 0 ? dst1 - threshold : dst1 + threshold) : 0;
Microsoft.ML.CpuMath.UnitTests (8)
UnitTests.cs (8)
711expected += Math.Abs(src[i]); 737expected += Math.Abs(src[i] - defaultScale); 761float abs = Math.Abs(src[i]); 790float abs = Math.Abs(src[i] - defaultScale); 944expected[i] = Math.Abs(value) > defaultScale ? (value > 0 ? value - defaultScale : value + defaultScale) : 0; 977expected[index] = Math.Abs(value) > defaultScale ? (value > 0 ? value - defaultScale : value + defaultScale) : 0; 1006return Math.Abs(a - b) < 1e-5f; 1019return Math.Abs(a - b) < 1e-3f;
Microsoft.ML.Data (5)
Deprecated\Vector\VectorUtils.cs (1)
139var absValue = Math.Abs(value);
Transforms\NormalizeColumnSng.cs (2)
1599scale = 1 / Math.Max(Math.Abs(max), Math.Abs(min));
Utils\LossFunctions.cs (2)
262return maxNumThreads >= 2 && Math.Abs(fullUpdate) > Threshold ? fullUpdate / maxNumThreads : fullUpdate; 386return maxNumThreads >= 2 && Math.Abs(fullUpdate) > Threshold ? fullUpdate / maxNumThreads : fullUpdate;
Microsoft.ML.Ensemble (1)
Selector\DiversityMeasure\RegressionDisagreementDiversityMeasure.cs (1)
20return Math.Abs(valueX - valueY);
Microsoft.ML.StandardTrainers (21)
Optimizer\DifferentiableFunction.cs (4)
228float normDiff = Math.Abs(1 - numDeriv / dirDeriv); 275float normDiff = Math.Abs(1 - numDeriv / dirDeriv); 314float normDiff = Math.Abs(1 - numDeriv / dirDeriv); 348float normDiff = Math.Abs(1 - numDeriv / dirDeriv);
Optimizer\OptimizationMonitor.cs (3)
252float val = avgImprovement / Math.Abs(value); 327float val = (value - _bestBoundOnMin) / Math.Abs(value); 381float val = norm / Math.Abs(state.Value);
Optimizer\Optimizer.cs (2)
434else if (Math.Abs(curr.D) <= -c2) 514else if (Math.Abs(curr.D) <= -c2)
Standard\LinearPredictorUtils.cs (2)
211.Where(weight => Math.Abs(weight.Value) >= Epsilon) 212.OrderByDescending(kv => Math.Abs(kv.Value));
Standard\LogisticRegression\MulticlassLogisticRegression.cs (1)
850var orderedWeights = Weights[classNumber].Items().OrderByDescending(kv => Math.Abs(kv.Value));
Standard\Online\AveragedLinear.cs (1)
255PendingMultipliers += Math.Abs(biasUpdate);
Standard\Online\LinearSvm.cs (1)
243float normalizer = 1 / (MathUtils.Sqrt(_lambda) * VectorUtils.Norm(Weights) * Math.Abs(WeightsScale));
Standard\Online\OnlineLinear.cs (2)
195float absWeightsScale = Math.Abs(WeightsScale); 298float maxNorm = Math.Max(VectorUtils.MaxNorm(in state.Weights), Math.Abs(state.Bias));
Standard\SdcaBinary.cs (2)
873biasReg[0] = Math.Abs(l1IntermediateBias[0]) - l1Threshold > 0.0 996Double l1Regularizer = l1Threshold * l2Const * (VectorUtils.L1Norm(in weights[0]) + Math.Abs(biasReg[0]));
Standard\SdcaMulticlass.cs (3)
291biasReg[iClass] = Math.Abs(l1IntermediateBias[iClass]) - l1Threshold > 0.0 321biasReg[label] = Math.Abs(intermediateBias) - l1Threshold > 0.0 421weightsL1Norm += VectorUtils.L1Norm(in weights[iClass]) + Math.Abs(biasReg[iClass]);
Microsoft.ML.TestFramework (1)
DataPipe\TestDataPipeBase.cs (1)
997return FloatUtils.GetBits(x) == FloatUtils.GetBits(y) || Math.Abs(x - y) < SingleEps;
Microsoft.ML.Tests (1)
Scenarios\Api\TestApi.cs (1)
244Assert.True(Math.Abs(retrievedFloat - valueFloat) < .000001);
Microsoft.ML.TimeSeries (11)
AdaptiveSingularSpectrumSequenceModeler.cs (3)
714error += Math.Abs(series[j] - temp); 809error += Math.Abs(series[j] - temp); 855_info.ExponentialTrendFactor = Math.Abs(_alpha[0]);
EigenUtils.cs (7)
45x = Math.Abs(x); 46y = Math.Abs(y); 65float xx = Math.Abs(x); 136scale += Math.Abs(d[k]); 360tst1 = Math.Abs(d[m]) + Math.Abs(d[m + 1]); 361tst2 = tst1 + Math.Abs(e[m]);
SrCnnAnomalyDetectionBase.cs (1)
293return (float)(Math.Abs(mag - avgMag) / safeDivisor);
Microsoft.ML.Transforms (4)
Expression\BuiltinFunctions.cs (1)
165FunctionProviderUtils.Fn<R4, R4>(Math.Abs),
LearnerFeatureSelection.cs (3)
147var score = Math.Abs(scoresValues[i]); 163score = Math.Abs(scoresValues[i]); 238var score = Math.Abs(scores[i]);
Microsoft.ML.Vision (1)
ImageClassificationTrainer.cs (1)
253MinDelta = Math.Abs(minDelta);
PresentationCore (11)
MS\Internal\AnimatedTypeHelpers.cs (5)
387return Math.Abs(to.ScA - from.ScA) 388+ Math.Abs(to.ScR - from.ScR) 389+ Math.Abs(to.ScG - from.ScG) 390+ Math.Abs(to.ScB - from.ScB); 475return Math.Abs(to - from);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\FloatUtil.cs (6)
33float eps = ((float)Math.Abs(a) + (float)Math.Abs(b) + 10.0f) * FLT_EPSILON; 44return (float)Math.Abs(a - 1.0f) < 10.0f * FLT_EPSILON; 52return (float)Math.Abs(a) < 10.0f * FLT_EPSILON; 61return Math.Abs(denominator) <= Math.Abs(numerator) * INVERSE_FLT_MAX_PRECISION;
System.Private.CoreLib (2)
src\libraries\System.Private.CoreLib\src\System\MathF.cs (1)
49return Math.Abs(x);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Scalar.cs (1)
194return (T)(object)Math.Abs((float)(object)value);
System.Windows.Forms (6)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (5)
695Debug.Assert(Math.Abs(weightSum - weightSumDbg) < 1.0F); 862Debug.Assert(Math.Abs(weightSum - weightSumDbg) < 1.0F); 1197Debug.Assert(Math.Abs(weightSum - weightSumDbg) < 1.0F); 1221weightDiscrepancy = Math.Abs(dataGridViewColumn.UsedFillWeight - dataGridViewColumn.FillWeight) / dataGridViewColumn.FillWeight; 1256Debug.Assert(Math.Abs(dataGridViewColumnTmp.UsedFillWeight * _availableWidthForFillColumns - weightSum * dataGridViewColumnTmp.Width) / weightSum / dataGridViewColumnTmp.Width <= 1.25F / dataGridViewColumnTmp.Width);
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
646if (Math.Abs(tabOffset) < tabDistance)
System.Windows.Input.Manipulations (3)
System\Windows\Input\Manipulations\ManipulationSequence.cs (3)
1165float delta = Math.Abs(baseValue - value); 1166if (Math.Abs(baseValue - value2) < delta) 1170else if (Math.Abs(baseValue - value3) < delta)
xunit.assert (2)
EqualityAsserts.cs (2)
470 if (!(object.Equals(expected, actual) || Math.Abs(expected - actual) <= tolerance)) 951 if (object.Equals(expected, actual) || Math.Abs(expected - actual) <= tolerance)