@@ -101,8 +101,8 @@ vector<int>* lgap, vector<int>* ugap){ //checks upper and lower gap constraints
101101
102102 for (int att = 0 ; att < (*lgap).size (); att++){
103103 // Original MPP repo uses zero to indicate non-presence of constraints. When (*lgap)[att] == 0, we skip over the constraint.
104- // Here we enable the case when lower bound of gap constraint is 0. If lower bound is not a number , we skip over the constraint.
105- if (isnan (( *lgap)[att]))
104+ // Here we enable the case when lower bound of gap constraint is 0. If lower bound is NaN (Not-A-Number) value , we skip over the constraint.
105+ if (isnan (static_cast < double >(( *lgap)[att]) ))
106106 continue ;
107107 // Original MPP repo uses abs(att[i] - att[i-1]) as the gap value. Here we remove abs().
108108 if ((*attrs)[(*lgapi)[att]].at (i).at (endp - 1 ) - (*attrs)[(*lgapi)[att]].at (i).at (strp - 1 ) < (*lgap)[att])
@@ -111,8 +111,8 @@ vector<int>* lgap, vector<int>* ugap){ //checks upper and lower gap constraints
111111
112112 for (int att = 0 ; att < (*ugap).size (); att++){
113113 // Original MPP repo uses zero to indicate non-presence of constraints. When (*ugap)[att] == 0, we skip over the constraint.
114- // Here we enable the case when upper bound of gap constraint is 0. If upper bound is not a number , we skip over the constraint.
115- if (isnan (( *ugap)[att]))
114+ // Here we enable the case when upper bound of gap constraint is 0. If upper bound is NaN (Not-A-Number) value , we skip over the constraint.
115+ if (isnan (static_cast < double >(( *ugap)[att]) ))
116116 continue ;
117117 // Original MPP repo uses abs(att[i] - att[i-1]) as the gap value. Here we remove abs().
118118 if ((*attrs)[(*ugapi)[att]].at (i).at (endp - 1 ) - (*attrs)[(*ugapi)[att]].at (i).at (strp - 1 ) > (*ugap)[att])
0 commit comments