[Insight-developers] Why is VariableLengthVector::GetSquaredNorm so slow?

David Doria daviddoria at gmail.com
Wed Sep 14 09:01:33 EDT 2011


I have noticed that if I loop over the elements of two
VariableLengthVectors to compute the squared norm of their difference,
it is about 3x faster than if I use the GetSquaredNorm() function. I
have attached a demo which uses itkTimeProbe to show this. Can anyone
explain the difference? My ManualDifference2 seems to me to be
identical to GetSquaredNorm.

Thanks,

David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GetSquaredNormSpeedTest.cxx
Type: text/x-c++src
Size: 4190 bytes
Desc: not available
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110914/5905f479/attachment.cxx>


More information about the Insight-developers mailing list