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 #pragma once
11 
12 
13 #include <functional>
14 
15 namespace sc::op {
16 
17 
18 template<typename T>
19 struct Op_
20 {
21  const double mInitVal;
22  const T maOp;
23  Op_(double InitVal, T aOp):
24  mInitVal(InitVal), maOp(aOp)
25  {
26  }
27  void operator()(double& rAccum, double fVal) const
28  {
29  maOp(rAccum, fVal);
30  }
31 };
32 
34 
35 struct Sum
36 {
37  static const double InitVal;
38  void operator()(double& rAccum, double fVal) const;
39 };
40 
41 struct SumSquare
42 {
43  static const double InitVal;
44  void operator()(double& rAccum, double fVal) const;
45 };
46 
47 struct Product
48 {
49  static const double InitVal;
50  void operator()(double& rAccum, double fVal) const;
51 };
52 
53 }
54 
55 
56 
57 /* 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