c++ - Eigen Library Speed Up Matrix Initialization -
is there way speed running time of following code?
matrix<double, 10, dynamic> a(10,n); << a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;
here, n known @ runtime, , a1, a2, , on vectors of length n. i've tried approximate max size of matrix , use double, 10, dynamic, 0, 10, 10000 did not give increase in speed.
if use rowmajor matrix a, copies faster better cache coherence , vectorization:
matrix<double,10,dynamic,rowmajor> a(10,n);
however, might slow down other operations.
finally, make sure compiled optimizations on (e.g., -o2 gcc), , might faster avoid comma initializer syntax with:
a.row(i) = a_i;
(not sure because depends on compiler, that's worth trying if copy bottleneck)
Comments
Post a Comment