1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
20 template<typename T
, typename tRes
>
23 const double mInitVal
;
25 Op_(double InitVal
, T aOp
):
26 mInitVal(InitVal
), maOp(std::move(aOp
))
29 void operator()(tRes
& rAccum
, double fVal
) const
35 using Op
= Op_
<std::function
<void(double&, double)>, double>;
36 using kOp
= Op_
<std::function
<void(KahanSum
&, double)>, KahanSum
>;
38 void fkOpSum(KahanSum
& rAccum
, double fVal
);
39 void fkOpSumSquare(KahanSum
& rAccum
, double fVal
);
42 extern kOp kOpSumSquare
;
43 extern std::vector
<kOp
> kOpSumAndSumSquare
;
47 static const double InitVal
;
48 void operator()(KahanSum
& rAccum
, double fVal
) const;
53 static const double InitVal
;
54 void operator()(KahanSum
& rAccum
, double fVal
) const;
59 static const double InitVal
;
60 void operator()(double& rAccum
, double fVal
) const;
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */