mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
Fix clang warning -Wabsolute-value (#4616)
This commit is contained in:
@@ -182,7 +182,7 @@ void testMae() {
|
||||
TEST_ASSERT(nmol->hasProp("s_m_entry_name"));
|
||||
TEST_ASSERT(nmol->getProp<std::string>("s_m_entry_name") == "NCI_aids_few.1");
|
||||
TEST_ASSERT(nmol->hasProp("r_f3d_dummy"));
|
||||
TEST_ASSERT(abs(nmol->getProp<double>("r_f3d_dummy") - 42.123) < 0.0001);
|
||||
TEST_ASSERT(std::abs(nmol->getProp<double>("r_f3d_dummy") - 42.123) < 0.0001);
|
||||
|
||||
//! Test atom properties
|
||||
TEST_ASSERT(nmol->getNumAtoms() == 19);
|
||||
@@ -204,7 +204,7 @@ void testMae() {
|
||||
//! The real property is only defined for i >= 10
|
||||
if (i >= 10) {
|
||||
TEST_ASSERT(atom->hasProp("r_f3d_dummy"));
|
||||
TEST_ASSERT(abs(atom->getProp<double>("r_f3d_dummy") - (19.1 - i)) <
|
||||
TEST_ASSERT(std::abs(atom->getProp<double>("r_f3d_dummy") - (19.1 - i)) <
|
||||
0.0001);
|
||||
} else {
|
||||
TEST_ASSERT(!atom->hasProp("r_f3d_dummy"));
|
||||
|
||||
6
External/GA/ga/LinkedPopLinearSel.h
vendored
6
External/GA/ga/LinkedPopLinearSel.h
vendored
@@ -138,7 +138,7 @@ LinkedPopLinearSel<Chromosome, PopulationPolicy>::LinkedPopLinearSel(
|
||||
<< " predictTotalScaledFitness "
|
||||
<< predictTotalScaledFitness;
|
||||
#endif
|
||||
assert(abs(totalScaledFitness - predictTotalScaledFitness) < 1.0e-5);
|
||||
assert(std::abs(totalScaledFitness - predictTotalScaledFitness) < 1.0e-5);
|
||||
|
||||
double predictEndFitness = SELECT_START + (popsize - 1.0) * scaledFitnessStep;
|
||||
(void)predictEndFitness; // suppress warnings when building with
|
||||
@@ -147,7 +147,7 @@ LinkedPopLinearSel<Chromosome, PopulationPolicy>::LinkedPopLinearSel(
|
||||
REPORT(Reporter::TRACE) << "endFitness " << endFitness
|
||||
<< " predictEndFitness " << predictEndFitness;
|
||||
#endif
|
||||
assert(abs(endFitness - predictEndFitness) < 1.0e-10);
|
||||
assert(std::abs(endFitness - predictEndFitness) < 1.0e-10);
|
||||
|
||||
freeChromosomes.reserve(10);
|
||||
}
|
||||
@@ -206,7 +206,7 @@ LinkedPopLinearSel<Chromosome, PopulationPolicy>::selectParent() {
|
||||
++iterator;
|
||||
}
|
||||
// may get here because of numeric errors
|
||||
assert(abs(sum - totalScaledFitness) < (0.000001 * scaledFitnessStep));
|
||||
assert(std::abs(sum - totalScaledFitness) < (0.000001 * scaledFitnessStep));
|
||||
iterator = population.end();
|
||||
--iterator;
|
||||
return iterator->second;
|
||||
|
||||
Reference in New Issue
Block a user