eigen :: llt<eigen :: matrixxd>具有不完整的类型
Eigen::LLT< Eigen::MatrixXd > has incomplete type
查看此代码。在Ubuntu上编译...
MatrixXd A(3,3);
A << 4,-1,2, -1,6,0, 2,0,5;
cout << "The matrix A is" << endl << A << endl;
LLT<MatrixXd> lltOfA(A); // compute the Cholesky decomposition of A
这是一个医生案例:
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include <doctest/doctest.h>
#include <Eigen/Core>
TEST_CASE("llt")
{
Eigen::MatrixXd A(3,3);
A<<1,2,3,4,5,6,7,8,9;
Eigen::LLT<Eigen::MatrixXd> lltof(A);
}
汇编失败了:
/src/test/test-proto.cc:40:38: error: variable ‘Eigen::LLT<Eigen::Matrix<double, -1, -1>, 1> lltof’ has initializer but incomplete type
Eigen::LLT<Eigen::MatrixXd> lltof(A);
什么给?从我的代码中缩小了这一点,以完全表示文档。
糟糕。测试案例应为:
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include <doctest/doctest.h>
#include "proto.h"
#include <Eigen/Dense> //NOT Eigen/Core
TEST_CASE("llt")
{
Eigen::MatrixXd A(3,3);
A<<1,2,3,4,5,6,7,8,9;
Eigen::LLT<Eigen::MatrixXd> lltof(A);
}
请注意#include
的更改。
愚蠢的错误,但我将其留给我未来的自我/Google。
引用此链接的示例
struct Y {};
template<const Y& b> struct Z {};
Y y;
Z<y> z; // ok: no conversion
您最好理解模板非类型的参数。
相关文章:
- ArduinoJson 6.15.2:JsonObject没有命名类型
- 防止主数据类型C++的隐式转换
- 大量序列中核苷酸类型的快速计数
- 如何从C++中的依赖类型中获得它所依赖的类型
- 将 Eigen::MatrixXd 矩阵转换为 cgal 容器类型
- C++/Eigen:获取为 MatrixBase 编写的模板的矩阵参数类型
- Eigen:返回类型 1-a.array()
- eigen :: llt&lt;eigen :: matrixxd&gt;具有不完整的类型
- 命名空间'Eigen'中的'Index'不命名类型
- eigen:模板函数中矩阵的默认类型
- 将PCL点类型XYZ转换为EIGEN VECTOR 4F
- Eigen MatrixXd作为返回类型
- 在 odeint 中使用 std::vector<Eigen::Vector3d> 作为状态类型
- 将memcpy与Eigen类型的向量一起使用安全吗
- 使用 Eigen::Map<Eigen::MatrixXd> 作为 Eigen::MatrixXd 类型的函数参数
- 将特征类型与 boost::bind 一起使用是否会自动违反 Eigen 的"only pass by reference"规则?
- 将Eigen::VectorXd类型转换为std::vector
- 对Eigen::Vector类型使用Boost累加器
- 对齐数据类型Eigen::矩阵的数组或向量声明
- 在 EIGEN 中单独声明和初始化映射类型矩阵