Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/Common/Auxiliary/SizeExtensions.cs @ 12503

Last change on this file since 12503 was 12503, checked in by aballeit, 9 years ago

#2283 added GUI and charts; fixed MCTS

File size: 578 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows;
6
7namespace Microsoft.Research.DynamicDataDisplay.Common.Auxiliary
8{
9  internal static class SizeExtensions
10  {
11    private const double sizeRatio = 1e-7;
12    public static bool EqualsApproximately(this Size size1, Size size2)
13    {
14      bool widthEquals = Math.Abs(size1.Width - size2.Width) / size1.Width < sizeRatio;
15      bool heightEquals = Math.Abs(size1.Height - size2.Height) / size1.Height < sizeRatio;
16
17      return widthEquals && heightEquals;
18    }
19  }
20}
Note: See TracBrowser for help on using the repository browser.