Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Remove now useless HAS_VECCORE guards
  • Loading branch information
xvallspl committed Jun 29, 2017
commit a230584e2e1ed527fa7aa426520a6283e005f7cf
14 changes: 0 additions & 14 deletions math/mathcore/inc/Fit/Chi2FCN.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,13 @@ class Chi2FCN : public BasicFCN<DerivFunType, ModelFunType, BinData> {
/// i-th chi-square residual
virtual double DataElement(const double *x, unsigned int i, double *g) const {
if (i==0) this->UpdateNCalls();
#ifdef R__HAS_VECCORE
return FitUtil::Evaluate<T>::EvalChi2Residual(BaseFCN::ModelFunction(), BaseFCN::Data(), x, i, g);
#else
return FitUtil::EvaluateChi2Residual(BaseFCN::ModelFunction(), BaseFCN::Data(), x, i, g);
#endif
}

// need to be virtual to be instantiated
virtual void Gradient(const double *x, double *g) const {
// evaluate the chi2 gradient
#ifdef R__HAS_VECCORE
FitUtil::Evaluate<T>::EvalChi2Gradient(BaseFCN::ModelFunction(), BaseFCN::Data(), x, g, fNEffPoints);
#else
FitUtil::EvaluateChi2Gradient(BaseFCN::ModelFunction(), BaseFCN::Data(), x, g, fNEffPoints);
#endif
}

/// get type of fit method function
Expand All @@ -154,15 +146,9 @@ class Chi2FCN : public BasicFCN<DerivFunType, ModelFunType, BinData> {
virtual double DoEval (const double * x) const {
this->UpdateNCalls();
if (BaseFCN::Data().HaveCoordErrors() || BaseFCN::Data().HaveAsymErrors())
#ifdef R__HAS_VECCORE
return FitUtil::Evaluate<T>::EvalChi2Effective(BaseFCN::ModelFunction(), BaseFCN::Data(), x, fNEffPoints);
else
return FitUtil::Evaluate<T>::EvalChi2(BaseFCN::ModelFunction(), BaseFCN::Data(), x, fNEffPoints, fExecutionPolicy);
#else
return FitUtil::EvaluateChi2Effective(BaseFCN::ModelFunction(), BaseFCN::Data(), x, fNEffPoints);
else
return FitUtil::EvaluateChi2(BaseFCN::ModelFunction(), BaseFCN::Data(), x, fNEffPoints, fExecutionPolicy);
#endif
}

// for derivatives
Expand Down
9 changes: 5 additions & 4 deletions math/mathcore/inc/Fit/FitUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ namespace FitUtil {

unsigned setAutomaticChunking(unsigned nEvents);

#ifdef R__HAS_VECCORE
template<class T>
struct Evaluate{
struct Evaluate {
#ifdef R__HAS_VECCORE
static double EvalChi2(const IModelFunctionTempl<T> &func, const BinData & data, const double * p, unsigned int &nPoints, const unsigned int &executionPolicy, unsigned nChunks = 0)
{
// evaluate the chi2 given a vectorized function reference , the data and returns the value and also in nPoints
Expand Down Expand Up @@ -808,6 +808,8 @@ static void EvalPoissonLogLGradient(const IModelFunctionTempl<T> &, const BinDat

template<>
struct Evaluate<double>{
#endif

static double EvalChi2(const IModelFunction & func, const BinData & data, const double * p, unsigned int &nPoints, const unsigned int &executionPolicy, unsigned nChunks = 0)
{
// evaluate the chi2 given a function reference, the data and returns the value and also in nPoints
Expand All @@ -816,7 +818,7 @@ static void EvalPoissonLogLGradient(const IModelFunctionTempl<T> &, const BinDat
// optionally the integral of function in the bin is used
return FitUtil::EvaluateChi2(func, data, p, nPoints, executionPolicy, nChunks);
}

static double EvalLogL(const IModelFunctionTempl<double> &func, const UnBinData & data, const double * p, int iWeight,
bool extended, unsigned int &nPoints, const unsigned int &executionPolicy, unsigned nChunks = 0)
{
Expand Down Expand Up @@ -852,7 +854,6 @@ static void EvalPoissonLogLGradient(const IModelFunctionTempl<double> &func, con
FitUtil::EvaluatePoissonLogLGradient(func, data, p, g);
}
};
#endif

} // end namespace FitUtil

Expand Down
5 changes: 0 additions & 5 deletions math/mathcore/inc/Fit/LogLikelihoodFCN.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,7 @@ class LogLikelihoodFCN : public BasicFCN<DerivFunType,ModelFunType,UnBinData> {
*/
virtual double DoEval (const double * x) const {
this->UpdateNCalls();

#ifdef R__HAS_VECCORE
return FitUtil::Evaluate<T>::EvalLogL(BaseFCN::ModelFunction(), BaseFCN::Data(), x, fWeight, fIsExtended, fNEffPoints, fExecutionPolicy);
#else
return FitUtil::EvaluateLogL(BaseFCN::ModelFunction(), BaseFCN::Data(), x, fWeight, fIsExtended, fNEffPoints, fExecutionPolicy);
#endif
}

// for derivatives
Expand Down
5 changes: 0 additions & 5 deletions math/mathcore/inc/Fit/PoissonLikelihoodFCN.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,8 @@ class PoissonLikelihoodFCN : public BasicFCN<DerivFunType,ModelFunType,BinData>
*/
virtual double DoEval (const double * x) const {
this->UpdateNCalls();
#ifdef R__HAS_VECCORE
return FitUtil::Evaluate<T>::EvalPoissonLogL(BaseFCN::ModelFunction(), BaseFCN::Data(), x, fWeight, fIsExtended,
fNEffPoints, fExecutionPolicy);
#else
return FitUtil::EvaluatePoissonLogL(BaseFCN::ModelFunction(), BaseFCN::Data(), x, fWeight, fIsExtended,
fNEffPoints, fExecutionPolicy);
#endif
}

// for derivatives
Expand Down