BTW, eigen3 requires 
matrix.rowwise()  OP vector
or
matrix.colwise()   OP vector.
You cannot reverse the order such as  (at least currently I do not know how to do it)
vector OP matrix.colwise()
or
vector OP matrix.rowwise()