Skip to content

Commit 3710e25

Browse files
committed
Remove 'using namespace std;'
1 parent ba29b57 commit 3710e25

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

src/Osi/OsiChooseVariable.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "CoinSort.hpp"
1717
#include "CoinFinite.hpp"
1818
#include "OsiChooseVariable.hpp"
19-
using namespace std;
2019

2120
OsiChooseVariable::OsiChooseVariable()
2221
: goodObjectiveValue_(COIN_DBL_MAX)

src/Osi/OsiFeatures.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#include <cmath>
55
#include "OsiFeatures.hpp"
66

7-
using namespace std;
8-
97
int OsiFeatures::n = OFCount;
108

119
bool dbl_equal( const double v1, const double v2 ) {
@@ -25,7 +23,7 @@ bool intVal( const double val ) {
2523
typedef set<double> uSetD;
2624
#else
2725
#include <unordered_set>
28-
typedef unordered_set<double> uSetD;
26+
typedef std::unordered_set<double> uSetD;
2927
#endif
3028

3129
// store at most this number of different values
@@ -34,10 +32,10 @@ typedef unordered_set<double> uSetD;
3432
class Summary {
3533
public:
3634
Summary() :
37-
minV( numeric_limits<double>::max() ),
38-
maxV( numeric_limits<double>::min() ),
39-
minAbsV( numeric_limits<double>::max() ),
40-
maxAbsV( numeric_limits<double>::min() ),
35+
minV( std::numeric_limits<double>::max() ),
36+
maxV( std::numeric_limits<double>::min() ),
37+
minAbsV( std::numeric_limits<double>::max() ),
38+
maxAbsV(std:: numeric_limits<double>::min() ),
4139
avg(0.0),
4240
ratioLSA(0.0),
4341
percIntEl(0.0),
@@ -53,12 +51,12 @@ class Summary {
5351
{ }
5452

5553
void add( double val ) {
56-
this->minV = min(val, minV);
57-
this->maxV = max(val, maxV);
58-
double absv = abs(val);
54+
this->minV = std::min(val, minV);
55+
this->maxV = std::max(val, maxV);
56+
double absv = std::abs(val);
5957
if (absv >= 1e-16) {
60-
this->minAbsV = min(absv, minAbsV);
61-
this->maxAbsV = max(absv, maxAbsV);
58+
this->minAbsV = std::min(absv, minAbsV);
59+
this->maxAbsV = std::max(absv, maxAbsV);
6260
}
6361
this->summV += val;
6462
if (intVal(val)) {

0 commit comments

Comments
 (0)