@@ -11,10 +11,10 @@ class NumericRange
11
11
double ub = 0 ;
12
12
bool ub_inclusive = true ;
13
13
14
- NumericRange (const double _lb, const bool _lb_inclusive,
15
- const double _ub, const bool _ub_inclusive) :
16
- lb (_lb), lb_inclusive(_lb_inclusive),
17
- ub (_ub), ub_inclusive(_ub_inclusive)
14
+ NumericRange (const double _lb, const bool _lb_inclusive,
15
+ const double _ub, const bool _ub_inclusive) :
16
+ lb (_lb), lb_inclusive(_lb_inclusive),
17
+ ub (_ub), ub_inclusive(_ub_inclusive)
18
18
{
19
19
if (lb > ub)
20
20
{
@@ -26,17 +26,17 @@ class NumericRange
26
26
}
27
27
}
28
28
29
- explicit NumericRange (double _scalar) :
30
- lb(_scalar), lb_inclusive(true ),
31
- ub(_scalar), ub_inclusive(true )
29
+ explicit NumericRange (double _scalar) :
30
+ lb(_scalar), lb_inclusive(true ),
31
+ ub(_scalar), ub_inclusive(true )
32
32
{}
33
33
};
34
34
35
35
// Is LHS < RHS?
36
36
class NumericRangeComparator
37
37
{
38
38
public:
39
- bool operator ()(const NumericRange& lhs, const NumericRange& rhs) const
39
+ bool operator () (const NumericRange & lhs, const NumericRange & rhs) const
40
40
{
41
41
const bool lhs_is_scalar = (lhs.lb == lhs.ub );
42
42
const bool rhs_is_scalar = (rhs.lb == rhs.ub );
@@ -56,21 +56,24 @@ class NumericRangeComparator
56
56
else
57
57
{
58
58
if (lhs.lb == rhs.lb && lhs.lb_inclusive == rhs.lb_inclusive
59
- && lhs.ub == rhs.ub && lhs.ub_inclusive == rhs.ub_inclusive )
59
+ && lhs.ub == rhs.ub && lhs.ub_inclusive == rhs.ub_inclusive )
60
60
{
61
61
return false ;
62
62
}
63
- else if ((lhs.ub < rhs.lb ) || (lhs.ub == rhs.lb && !(lhs.ub_inclusive && rhs.lb_inclusive )))
63
+ else if ((lhs.ub < rhs.lb ) ||
64
+ (lhs.ub == rhs.lb && !(lhs.ub_inclusive && rhs.lb_inclusive )))
64
65
{
65
66
return true ;
66
67
}
67
- else if ((lhs.lb > rhs.ub ) || (lhs.lb == rhs.ub && !(lhs.lb_inclusive && rhs.ub_inclusive )))
68
+ else if ((lhs.lb > rhs.ub ) ||
69
+ (lhs.lb == rhs.ub && !(lhs.lb_inclusive && rhs.ub_inclusive )))
68
70
{
69
71
return false ;
70
72
}
71
73
else
72
74
{
73
- throw std::runtime_error (" Invalid comparison between overlapping ranges" );
75
+ throw std::runtime_error (
76
+ " Invalid comparison between overlapping ranges" );
74
77
}
75
78
}
76
79
} // bool operator()
0 commit comments