`trnorm` performance warnings
serges147 opened this issue · comments
Sergei commented
There are two issuses:
- No preallocation:
if ndims(T) == 3
% recurse for transform sequence
nd = size(T, 3);
r = zeros(4,4,nd);
for i=1:nd
TR(:,:,i) = trnorm(T(:,:,i));
end
return
end
TR
is not preallocated as it intended to be (by previous r = zeros(4,4,nd);
).
- Value unused (
n
at line 63):
n = T(1:3,1); o = T(1:3,2); a = T(1:3,3);
n = cross(o, a); % N = O x A
Peter Corke commented
Thanks for pointing this out, now fixed. Sadly, there is a long list of performance warnings that need attending to. Help and pull requests needed.