Skip to content

Commit d4ef0f1

Browse files
committed
[hist] Don't replace shortcuts with TMath functions if not needed
Some of the shortcuts represent the same `cmath` functions that are used to implement TMath anyway. This also makes it easier to support different mathematical types with the TFormula, like `std::experimental::simd`, because then these types will just work as long as the provide `<cmath>` overloads.
1 parent 9c4a8d2 commit d4ef0f1

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

hist/hist/src/TFormula.cxx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -931,17 +931,8 @@ void TFormula::FillDefaults()
931931
// const pair<TString,Double_t> defconsts[] = { {"pi",TMath::Pi()}, {"sqrt2",TMath::Sqrt2()},
932932
// {"infinity",TMath::Infinity()}, {"ln10",TMath::Ln10()},
933933
// {"loge",TMath::LogE()}, {"true",1},{"false",0} };
934-
const pair<TString,TString> funShortcuts[] =
935-
{ {"sin","TMath::Sin" },
936-
{"cos","TMath::Cos" }, {"exp","TMath::Exp"}, {"log","TMath::Log"}, {"log10","TMath::Log10"},
937-
{"tan","TMath::Tan"}, {"sinh","TMath::SinH"}, {"cosh","TMath::CosH"},
938-
{"tanh","TMath::TanH"}, {"asin","TMath::ASin"}, {"acos","TMath::ACos"},
939-
{"atan","TMath::ATan"}, {"atan2","TMath::ATan2"}, {"sqrt","TMath::Sqrt"},
940-
{"ceil","TMath::Ceil"}, {"floor","TMath::Floor"}, {"pow","TMath::Power"},
941-
{"binomial","TMath::Binomial"},{"abs","TMath::Abs"},
942-
{"min","TMath::Min"},{"max","TMath::Max"},{"sign","TMath::Sign" },
943-
{"sq","TMath::Sq"}
944-
};
934+
const std::pair<TString, TString> funShortcuts[] = {
935+
{"sign", "TMath::Sign"}, {"binomial", "TMath::Binomial"}, {"sq", "TMath::Sq"}};
945936

946937
std::vector<TString> defvars2(10);
947938
for (int i = 0; i < 9; ++i)

0 commit comments

Comments
 (0)