jjzjj

eigentest

全部标签

C++ eigen3 线性代数库,奇怪的性能结果

我在C++中使用eigen3线性代数库有一段时间了,而且我一直试图利用向量化的性能优势。今天,我决定测试矢量化到底能在多大程度上加快我的程序速度。因此,我编写了以下测试程序:---特征测试.cpp---#includeusingnamespaceEigen;#includeintmain(){Matrix4daccumulator=Matrix4d::Zero();Matrix4drandMat=Matrix4d::Random();Matrix4dconstMat=Matrix4d::Constant(2);for(inti=0;i然后我在用不同的编译器选项编译后运行这个程序:(结果