Skip to content

Commit

Permalink
Replace CoinAbs by std::abs
Browse files Browse the repository at this point in the history
  • Loading branch information
a-andre authored and svigerske committed Aug 16, 2024
1 parent ea38a51 commit ecfbe38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/CoinDenseVector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class CoinDenseVector {
{
T norm = 0;
for (int i = 0; i < nElements_; i++)
norm += CoinAbs(elements_[i]);
norm += std::abs(elements_[i]);
return norm;
}
/// 2-norm of vector
Expand All @@ -145,7 +145,7 @@ class CoinDenseVector {
{
T norm = 0;
for (int i = 0; i < nElements_; i++)
norm = std::max(norm, CoinAbs(elements_[i]));
norm = std::max(norm, std::abs(elements_[i]));
return norm;
}
/// sum of vector elements
Expand Down
4 changes: 2 additions & 2 deletions src/CoinPackedMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3649,15 +3649,15 @@ int CoinPackedMatrix::verifyMtx(int verbosity, bool zeroesAreError) const
errs++;
}
double aij = coeffs[ii];
if (CoinIsnan(aij) || CoinAbs(aij) > largeCoeff) {
if (CoinIsnan(aij) || std::abs(aij) > largeCoeff) {
if (verbosity >= 1) {
std::cout
<< " (" << ii << ") a<" << majndx << "," << minndx << "> = "
<< aij << " appears bogus." << std::endl;
}
errs++;
}
if (CoinAbs(aij) < smallCoeff) {
if (std::abs(aij) < smallCoeff) {
if (verbosity >= 4 || zeroesAreError) {
std::cout
<< " (" << ii << ") a<" << majndx << "," << minndx << "> = "
Expand Down

0 comments on commit ecfbe38

Please sign in to comment.