From c0b753a7e89aa149ac0c38624d72d9d1e125e838 Mon Sep 17 00:00:00 2001 From: Chris Beall Date: Fri, 16 Aug 2013 15:18:44 +0000 Subject: [PATCH] ugly fixes for bug in Clang 3.1 on Mac relating to ambiguous = operator when assigning to vector segment in templated function. https://dev.lsstcorp.org/trac/ticket/1907 http://llvm.org/bugs/show_bug.cgi?id=13103 --- gtsam/linear/linearAlgorithms-inst.h | 5 +++-- gtsam/nonlinear/ISAM2-inl.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gtsam/linear/linearAlgorithms-inst.h b/gtsam/linear/linearAlgorithms-inst.h index 4ec8c9a07..181d8028a 100644 --- a/gtsam/linear/linearAlgorithms-inst.h +++ b/gtsam/linear/linearAlgorithms-inst.h @@ -77,8 +77,9 @@ namespace gtsam xS.resize(dim); DenseIndex vectorPos = 0; BOOST_FOREACH(const VectorValues::const_iterator& parentPointer, parentPointers) { - xS.segment(vectorPos, parentPointer->second.size()) = parentPointer->second; - vectorPos += parentPointer->second.size(); + const Vector& parentVector = parentPointer->second; + xS.block(vectorPos,0,parentVector.size(),1) = parentVector.block(0,0,parentVector.size(),1); + vectorPos += parentVector.size(); } } xS = c.getb() - c.get_S() * xS; diff --git a/gtsam/nonlinear/ISAM2-inl.h b/gtsam/nonlinear/ISAM2-inl.h index d41100ea2..0d33308fb 100644 --- a/gtsam/nonlinear/ISAM2-inl.h +++ b/gtsam/nonlinear/ISAM2-inl.h @@ -183,8 +183,9 @@ bool optimizeWildfireNode(const boost::shared_ptr& clique, double thresh xS.resize(dim); DenseIndex vectorPos = 0; BOOST_FOREACH(const VectorValues::const_iterator& parentPointer, parentPointers) { - xS.segment(vectorPos, parentPointer->second.size()) = parentPointer->second; - vectorPos += parentPointer->second.size(); + const Vector& parentVector = parentPointer->second; + xS.block(vectorPos,0,parentVector.size(),1) = parentVector.block(0,0,parentVector.size(),1); + vectorPos += parentVector.size(); } } xS = c.getb() - c.get_S() * xS;