[mlpack-git] master: don't let the compiler infer matrix result types (eb1cb35)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Tue Jan 6 16:18:41 EST 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/9147fd3ee8072669c18422de4ea6fbe8f964b423...7f1ac617dd14ce526aa3476e0a001a72e2ce37a9

>---------------------------------------------------------------

commit eb1cb35bb569db733a2407fefc42c711e6f408ed
Author: Stephen Tu <tu.stephenl at gmail.com>
Date:   Tue Jan 6 12:25:32 2015 -0800

    don't let the compiler infer matrix result types
    
    we need to be explicit about types, otherwise we run into
    strange memory issues with optimized code


>---------------------------------------------------------------

eb1cb35bb569db733a2407fefc42c711e6f408ed
 src/mlpack/tests/lrsdp_test.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mlpack/tests/lrsdp_test.cpp b/src/mlpack/tests/lrsdp_test.cpp
index 843a870..4e4b473 100644
--- a/src/mlpack/tests/lrsdp_test.cpp
+++ b/src/mlpack/tests/lrsdp_test.cpp
@@ -227,7 +227,7 @@ BOOST_AUTO_TEST_CASE(GaussianMatrixSensingSDP)
   arma::vec b(p);
   for (size_t i = 0; i < p; ++i)
   {
-    const auto Ai = arma::reshape(A.row(i), n, m);
+    const arma::mat Ai = arma::reshape(A.row(i), n, m);
     b(i) = arma::dot(trans(Ai), Xorig);
   }
 
@@ -247,7 +247,7 @@ BOOST_AUTO_TEST_CASE(GaussianMatrixSensingSDP)
 
   for (size_t i = 0; i < p; ++i)
   {
-    const auto Ai = arma::reshape(A.row(i), n, m);
+    const arma::mat Ai = arma::reshape(A.row(i), n, m);
     sensing.DenseA()[i].zeros(m + n, m + n);
     sensing.DenseA()[i](block_rows, block_cols) = trans(Ai);
     sensing.DenseA()[i](block_cols, block_rows) = Ai;
@@ -259,7 +259,7 @@ BOOST_AUTO_TEST_CASE(GaussianMatrixSensingSDP)
   const arma::mat rrt = coordinates * trans(coordinates);
   for (size_t i = 0; i < p; ++i)
   {
-    const auto Ai = arma::reshape(A.row(i), n, m);
+    const arma::mat Ai = arma::reshape(A.row(i), n, m);
     const double measurement =
       arma::dot(trans(Ai), rrt(block_rows, block_cols));
     BOOST_REQUIRE_CLOSE(measurement, b(i), 1e-3);



More information about the mlpack-git mailing list