如果我尝试使用 eigen 在 CppAD 中运行以下代码:
Eigen::Matrix<CppAD::AD<double>, Eigen::Dynamic, 1> position(3);
CppAD::Independent(position);
这运行良好。但是,如果我尝试执行:
Eigen::Matrix<CppAD::AD<double>, 3, 1> position;
CppAD::Independent(position);
提出以下断言:
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.
如何在 CppAD 中使用固定(非动态)大小的特征向量?