Skip to content
Snippets Groups Projects
Unverified Commit 77b25682 authored by corentinberge's avatar corentinberge Committed by GitHub
Browse files

Update signal-cast-registerer.cpp

Make the code easier to read by importing the matrix m in OS instead of importing elements 1 by 1
parent 3ccd0667
No related branches found
No related tags found
No related merge requests found
...@@ -88,31 +88,13 @@ struct EigenCastRegisterer_M : public dynamicgraph::SignalCastRegisterer ...@@ -88,31 +88,13 @@ struct EigenCastRegisterer_M : public dynamicgraph::SignalCastRegisterer
static void dispMatrix (const boost::any& object, std::ostream& os) static void dispMatrix (const boost::any& object, std::ostream& os)
{ {
const bnuMatrix& m = boost::any_cast<bnuMatrix> (object); const bnuMatrix& m = boost::any_cast<bnuMatrix> (object);
os << "[ "; os << m << std::endl;
for (int i = 0; i < m.rows(); ++i){
os << "[ ";
for (int j = 0; j < m.cols(); ++j) {
os << m(i, j) << " ";
}
if (i != m.rows()-1){
os << "]; ";
}
else{
os << "] ";
}
}
os << " ];" << std::endl;
} }
static void traceMatrix (const boost::any& object, std::ostream& os) static void traceMatrix (const boost::any& object, std::ostream& os)
{ {
const bnuMatrix& m = boost::any_cast<bnuMatrix> (object); const bnuMatrix& m = boost::any_cast<bnuMatrix> (object);
for (int i = 0; i < m.rows(); ++i){ os << m << std::endl;
for (int j = 0; j < m.cols(); ++j){
os << m(i,j) << " ";
}
}
os << std::endl;
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment