roboptim / roboptim-core

RobOptim Core Layer: interface and basic mathematical tools
http://www.roboptim.net
GNU Lesser General Public License v3.0
64 stars 35 forks source link

Fix compilation for both ColMajor/RowMajor + provide a define. #89

Closed bchretien closed 9 years ago

bchretien commented 9 years ago

Users can use the CMake option "STORAGE_ORDER" to change the storage order used by RobOptim. It defaults to ColMajor (Eigen's default), and RowMajor can be used for hypothetical increased performance in some scenarios (e.g. when mostly using impl_gradient to fill the Jacobian matrices).

Details

In RobOptim, gradient_t describes a row of the Jacobian matrix, but until now, it was defined as a column vector. A new rowVector_t is now available (vector_t is still a column vector), and in the dense case, gradient_t is just a rowVector_t. The sparse case is a bit different, since vector_t/rowVector_t are dense vectors but gradient_t is a sparse vector (now a RowMajor sparse vector for consistency with the dense traits).

Also, I encountered the following Eigen bug: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=980 This will be fixed in the next Eigen release.

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-0.01%) to 92.41% when pulling 5597f65ad582b27ff09bb581b9fbcd7aae22470f on bchretien:master into 039e21f892da3601f197854235fa151b89f028ae on roboptim:master.

bchretien commented 9 years ago

Note: plugins need to be tested before merging this.

bchretien commented 9 years ago

Things seem to be working as expected. The Ipopt plugin and the Python bindings needed a quick fix.

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-0.01%) to 92.41% when pulling a4dcac74c0b4d082b54572e122b7528ca56022ce on bchretien:master into 039e21f892da3601f197854235fa151b89f028ae on roboptim:master.

bchretien commented 9 years ago

I added an extra type, derivative_t, which is merely a typedef to a column vector. It should be used instead of gradient_t (row vector) for NTimesDerivableFunction (i.e. in roboptim-trajectory).