Skip to content

Commit

Permalink
STYLE: Modified Optimizer classes to avoid printing non-self member v…
Browse files Browse the repository at this point in the history
…ariables
  • Loading branch information
krupalbhat authored and dzenanz committed Jan 23, 2025
1 parent 524df2a commit 5a6d1e9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,8 @@ GradientDescentOptimizer::PrintSelf(std::ostream & os, Indent indent) const
os << indent << "Maximize: " << m_Maximize << std::endl;
os << indent << "CurrentIteration: " << m_CurrentIteration;
os << indent << "Value: " << m_Value;
if (m_CostFunction)
{
os << indent << "CostFunction: " << m_CostFunction;
}
os << indent << "StopCondition: " << m_StopCondition;
os << std::endl;
os << indent << "Gradient: " << m_Gradient;
os << std::endl;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,6 @@ RegularStepGradientDescentBaseOptimizer::PrintSelf(std::ostream & os, Indent ind
os << indent << "CurrentIteration: " << m_CurrentIteration << std::endl;
os << indent << "Value: " << m_Value << std::endl;
os << indent << "Maximize: " << m_Maximize << std::endl;
if (m_CostFunction)
{
os << indent << "CostFunction: " << &m_CostFunction << std::endl;
}
else
{
os << indent << "CostFunction: "
<< "(None)" << std::endl;
}
os << indent << "CurrentStepLength: " << m_CurrentStepLength << std::endl;
os << indent << "StopCondition: " << m_StopCondition << std::endl;
os << indent << "Gradient: " << m_Gradient << std::endl;
Expand Down
12 changes: 0 additions & 12 deletions Modules/Numerics/Optimizersv4/src/itkLBFGSBOptimizerv4.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,8 @@ LBFGSBOptimizerv4::PrintSelf(std::ostream & os, Indent indent) const
os << indent << "UpperBound: " << m_UpperBound << std::endl;
os << indent << "BoundSelection: " << m_BoundSelection << std::endl;

os << indent << "CostFunctionConvergenceFactor: " << m_CostFunctionConvergenceFactor << std::endl;

os << indent << "MaximumNumberOfEvaluations: " << m_MaximumNumberOfFunctionEvaluations << std::endl;

os << indent << "MaximumNumberOfCorrections: " << m_MaximumNumberOfCorrections << std::endl;

os << indent << "Value: " << this->GetValue() << std::endl;

os << indent << "InfinityNormOfProjectedGradient: " << this->m_InfinityNormOfProjectedGradient << std::endl;

if (this->m_VnlOptimizer)
{
os << indent << "Vnl LBFGSB Failure Code: " << this->m_VnlOptimizer->get_failure_code() << std::endl;
}
}

void
Expand Down
4 changes: 0 additions & 4 deletions Modules/Numerics/Optimizersv4/src/itkLBFGSOptimizerv4.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ LBFGSOptimizerv4::PrintSelf(std::ostream & os, Indent indent) const
os << indent << "LineSearchAccuracy: " << m_LineSearchAccuracy << std::endl;
os << indent << "DefaultStepLength: " << m_DefaultStepLength << std::endl;

if (this->m_VnlOptimizer)
{
os << indent << "Vnl LBFGS Failure Code: " << this->m_VnlOptimizer->get_failure_code() << std::endl;
}
}

void
Expand Down

0 comments on commit 5a6d1e9

Please sign in to comment.