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

David Doria daviddoria at gmail.com
Wed Sep 14 09:25:22 EDT 2011


On Wed, Sep 14, 2011 at 9:21 AM, Bradley Lowekamp
<blowekamp at mail.nih.gov> wrote:
> Hello David,
> It looks like you have factored the GetSize() method out side of the loop.
> This likely removes branching and exceptions from the loop making it
> suitable for SIMD/SEE vectorization.
> Brad

At line 365 in itkVariableLengthVector.hxx:

for ( unsigned int i = 0; i < this->m_NumElements; i++ )

it looks like the GetSize() call is not used at all since the size is
stored as a member variable, right?

David


More information about the Insight-developers mailing list