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
release/4.3a0
Chris Beall 2013-08-16 15:18:44 +00:00
parent 14fef517d8
commit c0b753a7e8
2 changed files with 6 additions and 4 deletions

View File

@ -77,8 +77,9 @@ namespace gtsam
xS.resize(dim); xS.resize(dim);
DenseIndex vectorPos = 0; DenseIndex vectorPos = 0;
BOOST_FOREACH(const VectorValues::const_iterator& parentPointer, parentPointers) { BOOST_FOREACH(const VectorValues::const_iterator& parentPointer, parentPointers) {
xS.segment(vectorPos, parentPointer->second.size()) = parentPointer->second; const Vector& parentVector = parentPointer->second;
vectorPos += parentPointer->second.size(); xS.block(vectorPos,0,parentVector.size(),1) = parentVector.block(0,0,parentVector.size(),1);
vectorPos += parentVector.size();
} }
} }
xS = c.getb() - c.get_S() * xS; xS = c.getb() - c.get_S() * xS;

View File

@ -183,8 +183,9 @@ bool optimizeWildfireNode(const boost::shared_ptr<CLIQUE>& clique, double thresh
xS.resize(dim); xS.resize(dim);
DenseIndex vectorPos = 0; DenseIndex vectorPos = 0;
BOOST_FOREACH(const VectorValues::const_iterator& parentPointer, parentPointers) { BOOST_FOREACH(const VectorValues::const_iterator& parentPointer, parentPointers) {
xS.segment(vectorPos, parentPointer->second.size()) = parentPointer->second; const Vector& parentVector = parentPointer->second;
vectorPos += parentPointer->second.size(); xS.block(vectorPos,0,parentVector.size(),1) = parentVector.block(0,0,parentVector.size(),1);
vectorPos += parentVector.size();
} }
} }
xS = c.getb() - c.get_S() * xS; xS = c.getb() - c.get_S() * xS;