Matrix linesP0
is 3xN. I want to subtract it from vector planeP0
which is 3x1. Is there any smarter and faster way to do this?
Now I'm using a for loop. Sample code below:
MatrixXf temp(linesP0.rows(), linesP0.cols());
for (int i = 0; i < linesP0.cols(); i++)
{
temp.col(i) = planeP0 - linesP0.block<3, 1>(0, i);
}
I tried to use colwise()
but didn't work.