Registered Member
|
Is there something like unaryExpr,which allows for applying a custom functor on each colum/row vector of a matrix. Maybe something like:
I will illustrate my use case with the following example. Let me know if there is a better existing solution. Say, I have a functor which works on single Vector point.
Now I would like to reuse this functor and apply it on every columns of a matrix by writing something simple as :
In this special case, another option might be to make RayAABBIntersection operator() more generic by allowing to work on matrix types like:
However RayAABBIntersection2 is slower. For a matrix of size 3 X 10000000 applying RayAABBIntersection1 to each column takes 0.15s compared to 0.23s for RayAABBIntersection2 on my machine. Is this a useful feature request, or is there a better way to write RayAABBIntersection2? |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]