Fixed-size Eigen matrices in CppAD

248 Views Asked by At

If I try to run the following code in CppAD using eigen:

  Eigen::Matrix<CppAD::AD<double>, Eigen::Dynamic, 1> position(3);
  CppAD::Independent(position);

This runs fine. However, if I try to execute:

  Eigen::Matrix<CppAD::AD<double>, 3, 1> position;
  CppAD::Independent(position);

The following assertion is raised:

cppad-20180000.0 error from a known source:
default construtor result does not have size zero
Error detected by false result for
    d.size() == 0
at line 143 in the file 
    /usr/include/cppad/utility/check_simple_vector.hpp
cpp_adgen_tests: /usr/include/cppad/utility/error_handler.hpp:206: static void CppAD::ErrorHandler::Default(bool, int, const char*, const char*, const char*): Assertion `false' failed.

How can I use fixed (non-Dynamic) sized Eigen vectors in CppAD?

0

There are 0 best solutions below