Skip to content

Commit

Permalink
BUG: Incorrect loop dimensions in untested code
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hjmjohnson committed Dec 8, 2020
1 parent 1401fdb commit 43a3c6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Modules/Core/Common/include/itkHexahedronCell.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ HexahedronCell<TCellInterface>::EvaluatePosition(CoordRepType * x,
for (unsigned int i = 0; i < Self::NumberOfPoints; ++i)
{
pt = points->GetElement(m_PointIds[i]);
for (unsigned int j = 0; j < Self::CellDimension; ++j)
for (unsigned int j = 0; j < PointType::Dimension; ++j)
{
fcol[j] += pt[j] * weights[i];
rcol[j] += pt[j] * derivs[i];
Expand Down Expand Up @@ -581,9 +581,9 @@ HexahedronCell<TCellInterface>::EvaluateLocation(int & itkNo
std::fill_n(x, Self::CellDimension, 0.0);
for (unsigned int i = 0; i < Self::NumberOfPoints; i++)
{
PointType pt = points->GetElement(m_PointIds[i]);
const PointType pt{ points->GetElement(m_PointIds[i]) };

for (unsigned int j = 0; j < Self::CellDimension; j++)
for (unsigned int j = 0; j < PointType::Dimension; j++)
{
const CoordRepType t = pt[j] * weights[i];
x[j] += t;
Expand Down

0 comments on commit 43a3c6a

Please sign in to comment.