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/.
10 #include <matrixoperators.hxx>
14 /* Simple operators */
16 void Sum::operator()(KahanSum
& rAccum
, double fVal
) const { rAccum
+= fVal
; }
18 const double Sum::InitVal
= 0.0;
20 void SumSquare::operator()(KahanSum
& rAccum
, double fVal
) const { rAccum
+= fVal
* fVal
; }
22 const double SumSquare::InitVal
= 0.0;
24 void Product::operator()(double& rAccum
, double fVal
) const { rAccum
*= fVal
; }
26 const double Product::InitVal
= 1.0;
30 void fkOpSum(KahanSum
& rAccum
, double fVal
) { rAccum
+= fVal
; }
32 kOp
kOpSum(0.0, fkOpSum
);
34 void fkOpSumSquare(KahanSum
& rAccum
, double fVal
) { rAccum
+= fVal
* fVal
; }
36 kOp
kOpSumSquare(0.0, fkOpSumSquare
);
38 std::vector
<kOp
> kOpSumAndSumSquare
= { kOpSum
, kOpSumSquare
};
41 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */