为什么对ColMajor MappedParseMatrix调用.row()方法失败
Why does calling .row() method on ColMajor MappedSparseMatrix fail?
这是我的代码:
#include <iostream>
#include <Eigen/Sparse>
using namespace Eigen;
int main()
{
int n_rows=4, n_cols=3, nnz=5;
int outer_index[] = {0,1,3,5};
int inner_index[] = {0,2,3,1,2};
double values[] = {1,1,1,1,1};
MappedSparseMatrix<double> u2i(n_rows, n_cols, nnz, outer_index, inner_index, values);
std::cout << u2i << std::endl;
std::cout << u2i.col(1) << std::endl; // works fine
//std::cout << u2i.row(1) << std::endl; // fails
return 0;
}
这是我尝试std::cout << u2i.row(1) << std::endl;
时收到的错误消息
my_exec:/usr/include/Egengin/src/Core/util/XprHelper.h:53:特征::internal::variable_if_dynamic::variable_idf_dynomic(T)[withT=int;int Value=1]:断言"v==T(Value)"失败。中止(堆芯转储)
问题似乎是在ColMajor矩阵上调用.row()
;然而,我不明白为什么这会导致错误,或者为什么.row()
方法是允许的?
如果我在实现中没有遗漏任何内容,那么这里发生了什么?
我使用的是特征3.2.2。
编辑:
显然,这在SparseMatrix
中也失败了。
#include <Eigen/Sparse>
#include <Eigen/Dense>
#include <iostream>
int main()
{
using namespace Eigen;
Matrix<int64_t, Dynamic, Dynamic> temp(6, 5);
temp << 0, 1, 0, 3, 4,
0, 1, 0, 0, 0,
0, 0, 0, 0, 0,
2, 1, 0, 0, 3,
0, 2, 0, 0, 1,
1, 0, 0, 1, 0;
SparseMatrix<int64_t> temp_sparse = temp.sparseView();
std::cout << temp_sparse.row(5) << std::endl;
return 0;
}
错误消息(相同):
test_calc_top_actions.exe:/usr/include/igen3/Eigen/src/Core/util/XprHelper.h:53:特征::internal::variable_if_dynamic::variable_idf_dynomic(T)[withT=int;int Value=1]:断言"v==T(Value)"失败。中止
此代码在最新版本(3.2.4)的运行时仍然失败。此处报告了错误,上游已经有修复程序(但尚未发布)。
相关文章:
- CMake + Qt,moc 编译失败,无法实现 QMetaObject 方法(编译器找不到基本 ui 对象的标头?
- 指示 Qi 变换属性失败的适当方法是什么?
- 模板的模板的模板推演失败(中间有继承),有没有更好的方法.
- 有没有一种很好的方法来实现具有默认失败情况的条件类型?
- 从类方法调用命名空间中名为 Same 的函数时,重载解析失败
- 检查 istream::read 和 istream::seekg 失败的最佳方法
- 使用方法失败更改constexpr对象成员
- 将C 方法参数转换为模板参数会因编译错误而失败
- 模拟简单的c ++方法在使用googletest时失败
- NSIS系统::调用-调用方法失败
- 我的复制构造函数导致使用我的类的方法失败.有人能看一眼,告诉我我做错了什么吗
- 矢量擦除方法失败
- 自动键入到自动方法失败.为什么
- 为什么对ColMajor MappedParseMatrix调用.row()方法失败
- 当inotify的IN_DELETE事件发生时,select方法失败
- 如果CImage::Load方法失败会发生什么?
- 基于jobobject调用Java方法失败(无效引用?)
- 在libjvm中定位JNI_GetCreatedJavaVMs方法失败.dylib (Mac OS)
- Tizen Construct() Button 方法失败
- 为什么传递一个char*给这个方法失败?