Fixed cppcheck issues

This commit is contained in:
Konstantin Sidorov
2017-08-02 09:35:20 +03:00
parent 7f61e2a14f
commit df640f62f8
6 changed files with 7 additions and 7 deletions
@@ -66,7 +66,7 @@ double EpanechnikovKernel::GradientForSquaredDistance(const double
if (distanceSquared < bandwidthSquared)
{
return -1 * inverseBandwidthSquared;
}
}
else if (distanceSquared > bandwidthSquared &&
distanceSquared >= 0)
{
@@ -149,4 +149,4 @@ const void AddTask::Binarize(const arma::field<arma::vec>& input,
} // namespace augmented
} // namespace ann
} // namespace mlpack
#endif
#endif
@@ -70,7 +70,7 @@ class CopyTask
arma::field<arma::mat>& labels,
const size_t batchSize,
bool fixedLength = false);
/**
* Generate dataset of a given size and store it in
* arma::mat object.
@@ -27,7 +27,7 @@ CopyTask::CopyTask(const size_t maxLength,
nRepeats(nRepeats),
addSeparator(addSeparator)
{
if (maxLength <= 1)
if (maxLength <= 1)
{
std::ostringstream oss;
oss << "CopyTask::CopyTask(): maximum sequence length ("
@@ -58,7 +58,7 @@ const void CopyTask::Generate(arma::field<arma::mat>& input,
for (size_t i = 0; i < batchSize; ++i)
{
if (!fixedLength)
{
{
arma::vec weights(maxLength - 1);
// We have two binary numbers with exactly two digits (10 and 11).
// Increasing length by 1 double the number of valid numbers.
@@ -35,7 +35,7 @@ const double SequencePrecision(arma::field<MatType> trueOutputs,
<< "of ground-truth sequences ("
<< trueOutputs.n_elem << ")"
<< std::endl;
throw std::invalid_argument(oss.str());
throw std::invalid_argument(oss.str());
}
for (size_t i = 0; i < testSize; i++)
+1 -1
View File
@@ -44,7 +44,7 @@ BOOST_AUTO_TEST_CASE(DiscreteUniformRandomTest)
BOOST_REQUIRE_SMALL(
1.0 / (hiExclusive - lo) - count[i] * 1.0 / iterations, 1e-2);
}
}
}
// Here we also test RandInt(hiExclusive) overload.
for (std::pair<int, int> range : ranges)