File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 11
22#include " CorrespondenceFunction.h"
33
4+ #include < Libs/Utils/PlatformUtils.h>
45#include < math.h>
56
67#include " Libs/Utils/Utils.h"
@@ -99,15 +100,14 @@ void CorrespondenceFunction::ComputeUpdates(const ParticleSystem* c) {
99100 if (m_InverseCovMatrix->rows () != num_dims || m_InverseCovMatrix->cols () != num_dims) {
100101 m_InverseCovMatrix->resize (num_dims, num_dims);
101102 }
102- TIME_START (" correspondence::covariance_multiply" );
103-
104- // instead of this:
105- // m_InverseCovMatrix->noalias() = lhs * rhs;
106-
107- // we now use the selfadjointView for better performance because the covariance matrix is symmetric
108- m_InverseCovMatrix->setZero (num_dims, num_dims);
109- m_InverseCovMatrix->selfadjointView <Eigen::Upper>().rankUpdate (lhs);
110103
104+ TIME_START (" correspondence::covariance_multiply" );
105+ if (PlatformUtils::is_macos ()) {
106+ // this is about 2x faster on MacOS, but slower on Linux
107+ m_InverseCovMatrix->selfadjointView <Eigen::Upper>().rankUpdate (lhs);
108+ } else {
109+ m_InverseCovMatrix->noalias () = lhs * rhs;
110+ }
111111 TIME_STOP (" correspondence::covariance_multiply" );
112112 }
113113
You can’t perform that action at this time.
0 commit comments