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/.
21 template<typename T
, typename tRes
>
24 const double mInitVal
;
26 Op_(double InitVal
, T aOp
):
27 mInitVal(InitVal
), maOp(std::move(aOp
))
30 void operator()(tRes
& rAccum
, double fVal
) const
36 using Op
= Op_
<std::function
<void(double&, double)>, double>;
37 using kOp
= Op_
<std::function
<void(KahanSum
&, double)>, KahanSum
>;
39 void fkOpSum(KahanSum
& rAccum
, double fVal
);
40 void fkOpSumSquare(KahanSum
& rAccum
, double fVal
);
43 extern kOp kOpSumSquare
;
44 extern std::vector
<kOp
> kOpSumAndSumSquare
;
48 static const double InitVal
;
49 void operator()(KahanSum
& rAccum
, double fVal
) const;
54 static const double InitVal
;
55 void operator()(KahanSum
& rAccum
, double fVal
) const;
60 static const double InitVal
;
61 void operator()(double& rAccum
, double fVal
) const;
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */