Skip to content

Commit fa32c76

Browse files
committed
Edit
1 parent 0405439 commit fa32c76

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

math/mathcore/inc/TMath.h

+17-14
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,12 @@ struct Limits {
517517
template <typename Iterator> Double_t Mean(Iterator first, Iterator last);
518518
template <typename Iterator, typename WeightIterator> Double_t Mean(Iterator first, Iterator last, WeightIterator wfirst);
519519

520-
template <typename T> T *MovMedian(const Long64_t n, T *a, const Long64_t k, Double_t *w = nullptr, Long64_t *work = nullptr);
521-
template <typename T> T *MovMean(const Long64_t n, T *a, const Long64_t k, Double_t *w = nullptr);
522-
template <typename T> Double_t Mode(const Long64_t n, T *a);
520+
template <typename T>
521+
T *MovMedian(const Long64_t n, T *a, const Long64_t k, Double_t *w = nullptr, Long64_t *work = nullptr);
522+
template <typename T>
523+
T *MovMean(const Long64_t n, T *a, const Long64_t k, Double_t *w = nullptr);
524+
template <typename T>
525+
Double_t Mode(const Long64_t n, T *a);
523526

524527
template <typename T> Double_t GeomMean(Long64_t n, const T *a);
525528
template <typename Iterator> Double_t GeomMean(Iterator first, Iterator last);
@@ -1121,7 +1124,7 @@ class Moving {
11211124
Long64_t n0;
11221125

11231126
virtual Double_t GetValue(const Long64_t n, T *a, Double_t *w = nullptr, Long64_t *work = nullptr) = 0;
1124-
virtual ~Moving() {};
1127+
virtual ~Moving(){};
11251128

11261129
Moving(const Long64_t n, T *a, const Long64_t k, Double_t *w = nullptr, Long64_t *work = nullptr)
11271130
{
@@ -1178,9 +1181,9 @@ class Moving {
11781181

11791182
for (Long64_t i = 0; i != n0; i++) {
11801183
kl = (i < k0 / 2 and i > 0) ? i : k0 / 2;
1181-
if (i + kr > n0 - 1) {
1182-
kr--;
1183-
}
1184+
if (i + kr > n0 - 1) {
1185+
kr--;
1186+
}
11841187

11851188
if (i == 0) {
11861189
if (k0 > 2) {
@@ -1205,7 +1208,7 @@ class MovingMean : public Moving<T> {
12051208

12061209
Double_t GetValue(const Long64_t n, T *a, Double_t *w = nullptr, Long64_t *work = nullptr)
12071210
{
1208-
(void) work;
1211+
(void)work;
12091212
Double_t mean = TMath::Mean(n, a, w);
12101213
return mean;
12111214
}
@@ -1214,9 +1217,9 @@ class MovingMean : public Moving<T> {
12141217
template <typename T>
12151218
T *TMath::MovMean(const Long64_t n, T *a, const Long64_t k, Double_t *w)
12161219
{
1217-
if(!a) {
1220+
if (!a) {
12181221
Fatal("MovMean", "the array is empty");
1219-
}
1222+
}
12201223
if (n <= 1) {
12211224
Fatal("MovMean", "the length of the array must be >1");
12221225
}
@@ -1262,7 +1265,7 @@ class MovingMedian : public Moving<T> {
12621265
template <typename T>
12631266
T *TMath::MovMedian(const Long64_t n, T *a, const Long64_t k, Double_t *w, Long64_t *work)
12641267
{
1265-
if(!a) {
1268+
if (!a) {
12661269
Fatal("MovMedian", "the array is empty");
12671270
}
12681271
if (n <= 1) {
@@ -1291,10 +1294,10 @@ T *TMath::MovMedian(const Long64_t n, T *a, const Long64_t k, Double_t *w, Long6
12911294
template <typename T>
12921295
Double_t TMath::Mode(const Long64_t n, T *a)
12931296
{
1294-
if(!a) {
1297+
if (!a) {
12951298
Fatal("Mode", "the array is empty");
1296-
}
1297-
if (n < 1) {
1299+
}
1300+
if (n < 1) {
12981301
Fatal("Mode", "the length of the array must be >0");
12991302
}
13001303

0 commit comments

Comments
 (0)