Skip to content
Snippets Groups Projects
Commit 3b71f712 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Divide vector instead of matrix saves time

Now for homogeneous
parent e0fe051d
No related branches found
No related tags found
1 merge request!101Visual SLAM starts to work.
......@@ -60,11 +60,11 @@ bool LocalParametrizationHomogeneous::computeJacobian(const Eigen::Map<const Eig
assert(_h.size() == global_size_ && "Wrong size of input quaternion.");
assert(_jacobian.rows() == global_size_ && _jacobian.cols() == local_size_ && "Wrong size of Jacobian matrix.");
_jacobian << _h(3), _h(2), -_h(1),
-_h(2), _h(3), _h(0),
_h(1), -_h(0), _h(3),
-_h(0), -_h(1), -_h(2) ;
_jacobian /= 2;
Eigen::Vector4s hh = _h/2;
_jacobian << hh(3), hh(2), -hh(1),
-hh(2), hh(3), hh(0),
hh(1), -hh(0), hh(3),
-hh(0), -hh(1), -hh(2) ;
return true;
}
......
  • Developer

    @jsola In the same spirit multiplying by 0.5 in faster than dividing by 2 ;)

  • Author Owner

    Isn't the compiler taking care of these smallities?

  • Developer

    Only if optimization is enabled (-Ox) modern compilers will do :thumbsup: . Was just a side note.

  • Author Owner

    OK

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