Skip to content

Commit

Permalink
PERF: Remove unnecessary IdentityTransform::m_ZeroJacobian
Browse files Browse the repository at this point in the history
`m_ZeroJacobian` appeared to be used only as a source object to copy to
a `jacobian` parameter. As an `Array2D`, it was using dynamically
allocated memory.
  • Loading branch information
N-Dekker authored and hjmjohnson committed Sep 15, 2021
1 parent cd3f05e commit eec9fe6
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions Modules/Core/Transform/include/itkIdentityTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class ITK_TEMPLATE_EXPORT IdentityTransform : public Transform<TParametersValueT
void
ComputeJacobianWithRespectToParameters(const InputPointType &, JacobianType & jacobian) const override
{
jacobian = this->m_ZeroJacobian;
jacobian.SetSize(NDimensions, 0);
}


Expand Down Expand Up @@ -242,17 +242,9 @@ class ITK_TEMPLATE_EXPORT IdentityTransform : public Transform<TParametersValueT
protected:
IdentityTransform()
: Transform<TParametersValueType, NDimensions, NDimensions>(0)
, m_ZeroJacobian(NDimensions, 0)
{
// The Jacobian is constant, therefore it can be initialized in the
// constructor.
this->m_ZeroJacobian.Fill(0.0);
}
{}

~IdentityTransform() override = default;

private:
JacobianType m_ZeroJacobian;
};
} // end namespace itk

Expand Down

0 comments on commit eec9fe6

Please sign in to comment.