From 55e414cbddeadb18adad22274c881ffbfb4cc7aa Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Wed, 20 Jan 2010 03:25:55 +0000 Subject: [PATCH] Tried noalias() for collect(), but no real improvement --- cpp/Matrix.cpp | 2 +- cpp/timeMatrix.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cpp/Matrix.cpp b/cpp/Matrix.cpp index b68f97712..fcba2ebce 100644 --- a/cpp/Matrix.cpp +++ b/cpp/Matrix.cpp @@ -513,7 +513,7 @@ Matrix collect(const std::vector& matrices, size_t m, size_t n) // BOOST_FOREACH(const Matrix* M, matrices) { // ublas::matrix_range mr(A, ublas::range(0, dimA1), // ublas::range(hindex, hindex+M->size2())); -// mr = *M; +// noalias(mr) = *M; // hindex += M->size2(); // } diff --git a/cpp/timeMatrix.cpp b/cpp/timeMatrix.cpp index db89f2605..e028d55b6 100644 --- a/cpp/timeMatrix.cpp +++ b/cpp/timeMatrix.cpp @@ -14,8 +14,9 @@ using namespace gtsam; /* * Results: * Alex's Machine: - * - (1st pass of simple changes) no pass: 0.184 sec , pass: 0.181 sec - * - (1st rev memcpy) no pass: 0.181 sec , pass: 0.180 sec + * - (1st pass of simple changes) no pass: 0.184 sec , pass: 0.181 sec + * - (1st rev memcpy) no pass: 0.181 sec , pass: 0.180 sec + * - (1st rev matrix_range) no pass: 0.186 sec , pass: 0.184 sec */ double timeCollect(size_t p, size_t m, size_t n, bool passDims, size_t reps) { // create a large number of matrices