Skip to content

Commit 43a3c6a

Browse files
committed
BUG: Incorrect loop dimensions in untested code
The loop bounds were incorrect in untested code due to assumed copy-n-paste errors. Python wrapping with agressive IPO optimization identified the container size mis-matches in the HeahedronCell implementation.
1 parent 1401fdb commit 43a3c6a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Modules/Core/Common/include/itkHexahedronCell.hxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ HexahedronCell<TCellInterface>::EvaluatePosition(CoordRepType * x,
356356
for (unsigned int i = 0; i < Self::NumberOfPoints; ++i)
357357
{
358358
pt = points->GetElement(m_PointIds[i]);
359-
for (unsigned int j = 0; j < Self::CellDimension; ++j)
359+
for (unsigned int j = 0; j < PointType::Dimension; ++j)
360360
{
361361
fcol[j] += pt[j] * weights[i];
362362
rcol[j] += pt[j] * derivs[i];
@@ -581,9 +581,9 @@ HexahedronCell<TCellInterface>::EvaluateLocation(int & itkNo
581581
std::fill_n(x, Self::CellDimension, 0.0);
582582
for (unsigned int i = 0; i < Self::NumberOfPoints; i++)
583583
{
584-
PointType pt = points->GetElement(m_PointIds[i]);
584+
const PointType pt{ points->GetElement(m_PointIds[i]) };
585585

586-
for (unsigned int j = 0; j < Self::CellDimension; j++)
586+
for (unsigned int j = 0; j < PointType::Dimension; j++)
587587
{
588588
const CoordRepType t = pt[j] * weights[i];
589589
x[j] += t;

0 commit comments

Comments
 (0)