Skip to content

Commit

Permalink
Remove 'using namespace std;'
Browse files Browse the repository at this point in the history
  • Loading branch information
a-andre committed Jul 31, 2024
1 parent ba29b57 commit 3710e25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/Osi/OsiChooseVariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "CoinSort.hpp"
#include "CoinFinite.hpp"
#include "OsiChooseVariable.hpp"
using namespace std;

OsiChooseVariable::OsiChooseVariable()
: goodObjectiveValue_(COIN_DBL_MAX)
Expand Down
22 changes: 10 additions & 12 deletions src/Osi/OsiFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#include <cmath>
#include "OsiFeatures.hpp"

using namespace std;

int OsiFeatures::n = OFCount;

bool dbl_equal( const double v1, const double v2 ) {
Expand All @@ -25,7 +23,7 @@ bool intVal( const double val ) {
typedef set<double> uSetD;
#else
#include <unordered_set>
typedef unordered_set<double> uSetD;
typedef std::unordered_set<double> uSetD;
#endif

// store at most this number of different values
Expand All @@ -34,10 +32,10 @@ typedef unordered_set<double> uSetD;
class Summary {
public:
Summary() :
minV( numeric_limits<double>::max() ),
maxV( numeric_limits<double>::min() ),
minAbsV( numeric_limits<double>::max() ),
maxAbsV( numeric_limits<double>::min() ),
minV( std::numeric_limits<double>::max() ),
maxV( std::numeric_limits<double>::min() ),
minAbsV( std::numeric_limits<double>::max() ),
maxAbsV(std:: numeric_limits<double>::min() ),
avg(0.0),
ratioLSA(0.0),
percIntEl(0.0),
Expand All @@ -53,12 +51,12 @@ class Summary {
{ }

void add( double val ) {
this->minV = min(val, minV);
this->maxV = max(val, maxV);
double absv = abs(val);
this->minV = std::min(val, minV);
this->maxV = std::max(val, maxV);
double absv = std::abs(val);
if (absv >= 1e-16) {
this->minAbsV = min(absv, minAbsV);
this->maxAbsV = max(absv, maxAbsV);
this->minAbsV = std::min(absv, minAbsV);
this->maxAbsV = std::max(absv, maxAbsV);
}
this->summV += val;
if (intVal(val)) {
Expand Down

0 comments on commit 3710e25

Please sign in to comment.