LibreOffice Module sc (master)  1
matrixoperators.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  */
9 
10 #ifndef INCLUDED_SC_INC_MATRIXOPERATORS_HXX
11 #define INCLUDED_SC_INC_MATRIXOPERATORS_HXX
12 
13 
14 #include <functional>
15 
16 namespace sc::op {
17 
18 
19 template<typename T>
20 struct Op_
21 {
22  const double mInitVal;
23  const T maOp;
24  Op_(double InitVal, T aOp):
25  mInitVal(InitVal), maOp(aOp)
26  {
27  }
28  void operator()(double& rAccum, double fVal) const
29  {
30  maOp(rAccum, fVal);
31  }
32 };
33 
35 
36 struct Sum
37 {
38  static const double InitVal;
39  void operator()(double& rAccum, double fVal) const;
40 };
41 
42 struct SumSquare
43 {
44  static const double InitVal;
45  void operator()(double& rAccum, double fVal) const;
46 };
47 
48 struct Product
49 {
50  static const double InitVal;
51  void operator()(double& rAccum, double fVal) const;
52 };
53 
54 }
55 
56 
57 
58 #endif
59 
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static const double InitVal
Op_(double InitVal, T aOp)
static const double InitVal
void operator()(double &rAccum, double fVal) const
void operator()(double &rAccum, double fVal) const
static const double InitVal
void operator()(double &rAccum, double fVal) const
const double mInitVal
void operator()(double &rAccum, double fVal) const