7fd59977 |
1 | // File: IntTools_Compare.cxx |
2 | // Created: Mon May 22 17:02:11 2000 |
3 | // Author: Peter KURNEV |
4 | // <pkv@irinox> |
5 | |
6 | |
7 | #include <IntTools_Compare.ixx> |
8 | //======================================================================= |
9 | //function :IntTools_Compare::IntTools_Compare |
10 | //purpose : |
11 | //======================================================================= |
12 | IntTools_Compare::IntTools_Compare() :myTol(1.e-12) {} |
13 | |
14 | //======================================================================= |
15 | //function :IntTools_Compare::IntTools_Compare |
16 | //purpose : |
17 | //======================================================================= |
18 | IntTools_Compare::IntTools_Compare(const Standard_Real aTol) |
19 | { |
20 | myTol=aTol; |
21 | } |
22 | |
23 | //======================================================================= |
24 | //function :IsLower |
25 | //purpose : |
26 | //======================================================================= |
27 | Standard_Boolean IntTools_Compare::IsLower(const IntTools_Root& aLeft, |
28 | const IntTools_Root& aRight)const |
29 | { |
30 | return aLeft.Root()<aRight.Root(); |
31 | } |
32 | |
33 | //======================================================================= |
34 | //function :IsGreater |
35 | //purpose : |
36 | //======================================================================= |
37 | Standard_Boolean IntTools_Compare::IsGreater(const IntTools_Root& aLeft, |
38 | const IntTools_Root& aRight)const |
39 | { |
40 | return !IsLower(aLeft,aRight); |
41 | } |
42 | |
43 | //======================================================================= |
44 | //function :IsEqual |
45 | //purpose : |
46 | //======================================================================= |
47 | Standard_Boolean IntTools_Compare::IsEqual(const IntTools_Root& aLeft, |
48 | const IntTools_Root& aRight)const |
49 | { |
50 | Standard_Real a, b; |
51 | a=aLeft.Root(); |
52 | b=aRight.Root(); |
53 | return fabs(a-b) < myTol; |
54 | } |
55 | |
56 | |
57 | |
58 | |
59 | |
60 | |