参考
官网教程
Reshape
- 用法:DenseBase::reshaped(NRowsType,NColsType)
- 默认按照列优先进行元素重排;
- 通过RowMajor设置按照行优先;
- 通过AutoOrder设置按照存储顺序重排;
- PlainObjectBase::resize(Index,Index)也可以实现重排;
void demo_26()
{
MatrixXi m = Matrix4i::Random();
m = m - m / 10 * 10;
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is m.reshaped(2, 8):" << endl << m.reshaped(2, 8) << endl;
m.resize(2,8);
cout << "Here is the matrix m after m.resize(2,8):" << endl << m << endl;
cout << "Here is m.reshaped().transpose():" << endl << m.reshaped().transpose() << endl;
cout << "Here is m.reshaped<RowMajor>().tr
最后
以上就是幸福柠檬最近收集整理的关于Eigen学习10:Reshape的全部内容,更多相关Eigen学习10内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复