Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Minuit2] Slim down public interface #17913

Merged
merged 2 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions math/minuit2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ if(CMAKE_PROJECT_NAME STREQUAL ROOT)
Minuit2/GradientCalculator.h
Minuit2/HessianGradientCalculator.h
Minuit2/InitialGradientCalculator.h
Minuit2/MPIProcess.h
Minuit2/MinimumBuilder.h
Minuit2/MinimumError.h
Minuit2/MinimumErrorUpdator.h
Expand Down Expand Up @@ -91,7 +90,6 @@ if(CMAKE_PROJECT_NAME STREQUAL ROOT)
Minuit2/MnUserParameterState.h
Minuit2/MnUserParameters.h
Minuit2/MnUserTransformation.h
Minuit2/MnVectorTransform.h
Minuit2/ModularFunctionMinimizer.h
Minuit2/NegativeG2LineSearch.h
Minuit2/Numerical2PGradientCalculator.h
Expand Down
2 changes: 0 additions & 2 deletions math/minuit2/inc/Minuit2/MnUserFcn.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class MnUserFcn : public MnFcn {
{
}

~MnUserFcn() override {}

double operator()(const MnAlgebraicVector &) const override;

// Access the parameter transformations.
Expand Down
45 changes: 0 additions & 45 deletions math/minuit2/inc/Minuit2/MnVectorTransform.h

This file was deleted.

2 changes: 0 additions & 2 deletions math/minuit2/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ set(MINUIT2_HEADERS
GradientCalculator.h
HessianGradientCalculator.h
InitialGradientCalculator.h
MPIProcess.h
MinimumBuilder.h
MinimumError.h
MinimumErrorUpdator.h
Expand Down Expand Up @@ -81,7 +80,6 @@ set(MINUIT2_HEADERS
MnUserParameterState.h
MnUserParameters.h
MnUserTransformation.h
MnVectorTransform.h
ModularFunctionMinimizer.h
NegativeG2LineSearch.h
Numerical2PGradientCalculator.h
Expand Down
3 changes: 2 additions & 1 deletion math/minuit2/src/HessianGradientCalculator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
#include "Minuit2/FunctionGradient.h"
#include "Minuit2/MnStrategy.h"
#include "Minuit2/MnPrint.h"
#include "Minuit2/MPIProcess.h"

#include "./MPIProcess.h"

#include <cmath>
#include <cassert>
Expand Down
2 changes: 1 addition & 1 deletion math/minuit2/src/MPIProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Copyright: (C) 2008 by Universita' and INFN, Milan *
***************************************************************************/

#include "Minuit2/MPIProcess.h"
#include "./MPIProcess.h"

#include <iostream>

Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions math/minuit2/src/MnFcn.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include "Minuit2/MnFcn.h"
#include "Minuit2/FCNBase.h"
#include "Minuit2/MnVectorTransform.h"

namespace ROOT {

Expand All @@ -24,7 +23,7 @@ double MnFcn::operator()(const MnAlgebraicVector &v) const
{
// evaluate FCN converting from from MnAlgebraicVector to std::vector
fNumCall++;
return fFCN(MnVectorTransform()(v));
return fFCN(std::vector<double>{v.Data(), v.Data() + v.size()});
}

// double MnFcn::operator()(const std::vector<double>& par) const {
Expand Down
2 changes: 1 addition & 1 deletion math/minuit2/src/MnHesse.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include "Minuit2/VariableMetricEDMEstimator.h"
#include "Minuit2/FunctionMinimum.h"
#include "Minuit2/MnPrint.h"
#include "Minuit2/MPIProcess.h"

#include "./MPIProcess.h"
#include "./MnFcnCaller.h"

namespace ROOT {
Expand Down
7 changes: 3 additions & 4 deletions math/minuit2/src/Numerical2PGradientCalculator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#include "Minuit2/MnStrategy.h"
#include "Minuit2/MnPrint.h"

#include "./MPIProcess.h"
#include "./MnFcnCaller.h"

#ifdef _OPENMP
#include <omp.h>
#endif
Expand All @@ -25,10 +28,6 @@
#include <cassert>
#include <iomanip>

#include "Minuit2/MPIProcess.h"

#include "./MnFcnCaller.h"

namespace ROOT {

namespace Minuit2 {
Expand Down
4 changes: 1 addition & 3 deletions math/minuit2/src/ParametricFunction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "Minuit2/MnUserParameterState.h"
#include "Minuit2/Numerical2PGradientCalculator.h"
#include "Minuit2/FunctionGradient.h"
#include "Minuit2/MnVectorTransform.h"
#include "Minuit2/MinimumParameters.h"

namespace ROOT {
Expand All @@ -40,9 +39,8 @@ std::vector<double> ParametricFunction::GetGradient(std::vector<double> const &x
FunctionGradient g = gc(MinimumParameters{xVec, mfcn(xVec)});
const MnAlgebraicVector &grad = g.Vec();
assert(grad.size() == x.size());
MnVectorTransform vt;
// std::cout << "Param Function Gradient " << grad << std::endl;
return vt(grad);
return {grad.Data(), grad.Data() + grad.size()};
}

} // namespace Minuit2
Expand Down
Loading