I think it's easier to understand if you look at @RigidBodyManipulator/bodyKin.m. I've documented P there but didn't see any documentation the C version of the other methods so I didn't include any there. Do you want me to just add the matlab documentation in the cpp file (javadoc style)? Here is the explanation of P.

% @retval P the gradient, dxdpts - useful when computing forces
[...]
%  and P will be a ((3xm)x(3xm)) matrix, with [P1;P2;...] where Pi = dxidpts