[mlpack-svn] r15426 - mlpack/trunk/src/mlpack/tests
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Sat Jul 6 00:19:01 EDT 2013
Author: pram
Date: Sat Jul 6 00:19:00 2013
New Revision: 15426
Log:
metric_test.cpp -- arma::sum changed to arma::accu; LINFMetricTest corrected.
Modified:
mlpack/trunk/src/mlpack/tests/metric_test.cpp
Modified: mlpack/trunk/src/mlpack/tests/metric_test.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/tests/metric_test.cpp (original)
+++ mlpack/trunk/src/mlpack/tests/metric_test.cpp Sat Jul 6 00:19:00 2013
@@ -29,10 +29,10 @@
ManhattanDistance lMetric;
- BOOST_REQUIRE_CLOSE((double) arma::sum(arma::abs(a1 - b1)),
+ BOOST_REQUIRE_CLOSE((double) arma::accu(arma::abs(a1 - b1)),
lMetric.Evaluate(a1, b1), 1e-5);
- BOOST_REQUIRE_CLOSE((double) arma::sum(arma::abs(a2 - b2)),
+ BOOST_REQUIRE_CLOSE((double) arma::accu(arma::abs(a2 - b2)),
lMetric.Evaluate(a2, b2), 1e-5);
}
@@ -52,10 +52,10 @@
EuclideanDistance lMetric;
- BOOST_REQUIRE_CLOSE((double) sqrt(arma::sum(arma::square(a1 - b1))),
+ BOOST_REQUIRE_CLOSE((double) sqrt(arma::accu(arma::square(a1 - b1))),
lMetric.Evaluate(a1, b1), 1e-5);
- BOOST_REQUIRE_CLOSE((double) sqrt(arma::sum(arma::square(a2 - b2))),
+ BOOST_REQUIRE_CLOSE((double) sqrt(arma::accu(arma::square(a2 - b2))),
lMetric.Evaluate(a2, b2), 1e-5);
}
@@ -73,7 +73,7 @@
arma::Col<size_t> b2(5);
b2 << 2 << 5 << 2 << 0 << 1;
- EuclideanDistance lMetric;
+ ChebyshevDistance lMetric;
BOOST_REQUIRE_CLOSE((double) arma::max(arma::abs(a1 - b1)),
lMetric.Evaluate(a1, b1), 1e-5);
More information about the mlpack-svn
mailing list