blob: e64596836c2a5dfe9c8756e485fc1c87d53d3fab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef SC_FORMULAGROUP_HXX
#define SC_FORMULAGROUP_HXX
#include "address.hxx"
#include "types.hxx"
#include <boost/noncopyable.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
class ScDocument;
class ScTokenArray;
namespace sc {
struct FormulaGroupContext : boost::noncopyable
{
typedef std::vector<double> DoubleArrayType;
typedef boost::ptr_vector<DoubleArrayType> ArrayStoreType;
ArrayStoreType maArrays;
};
/**
* Abstract base class for vectorised formula group interpreters,
* plus a global instance factory.
*/
class SC_DLLPUBLIC FormulaGroupInterpreter
{
static FormulaGroupInterpreter *msInstance;
protected:
FormulaGroupInterpreter() {}
virtual ~FormulaGroupInterpreter() {}
public:
static FormulaGroupInterpreter *getStatic();
virtual ScMatrixRef inverseMatrix(const ScMatrix& rMat) = 0;
virtual bool interpret(ScDocument& rDoc, const ScAddress& rTopPos, const ScFormulaCellGroupRef& xGroup, ScTokenArray& rCode) = 0;
};
/// Inherit from this for alternate formula group calculation approaches.
class SC_DLLPUBLIC FormulaGroupInterpreterSoftware : public FormulaGroupInterpreter
{
public:
FormulaGroupInterpreterSoftware() :
FormulaGroupInterpreter() {}
virtual ~FormulaGroupInterpreterSoftware() {}
virtual ScMatrixRef inverseMatrix(const ScMatrix& rMat);
virtual bool interpret(ScDocument& rDoc, const ScAddress& rTopPos, const ScFormulaCellGroupRef& xGroup, ScTokenArray& rCode);
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|