Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
b81d1306
Kaydet (Commit)
b81d1306
authored
Tem 02, 2013
tarafından
Michael Meeks
Kaydeden (comit)
Kohei Yoshida
Tem 03, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Dummy formula group interpreter for testing.
üst
1eb0aac3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
4 deletions
+52
-4
formulagroup.hxx
sc/inc/formulagroup.hxx
+2
-3
formulagroup.cxx
sc/source/core/tool/formulagroup.cxx
+50
-1
No files found.
sc/inc/formulagroup.hxx
Dosyayı görüntüle @
b81d1306
...
@@ -30,9 +30,8 @@ struct FormulaGroupContext : boost::noncopyable
...
@@ -30,9 +30,8 @@ struct FormulaGroupContext : boost::noncopyable
};
};
/**
/**
* All the vectorized formula calculation code should be collected here.
* Abstract base class for vectorised formula group interpreters,
*
* plus a global instance factory.
* Abstract base class for formula group interpreters, and a factory.
*/
*/
class
SC_DLLPUBLIC
FormulaGroupInterpreter
class
SC_DLLPUBLIC
FormulaGroupInterpreter
{
{
...
...
sc/source/core/tool/formulagroup.cxx
Dosyayı görüntüle @
b81d1306
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
#include <vector>
#include <vector>
#define USE_DUMMY_INTERPRETER 1
namespace
sc
{
namespace
sc
{
ScMatrixRef
FormulaGroupInterpreterSoftware
::
inverseMatrix
(
const
ScMatrix
&
/*rMat*/
)
ScMatrixRef
FormulaGroupInterpreterSoftware
::
inverseMatrix
(
const
ScMatrix
&
/*rMat*/
)
...
@@ -108,14 +110,61 @@ bool FormulaGroupInterpreterSoftware::interpret(ScDocument& rDoc, const ScAddres
...
@@ -108,14 +110,61 @@ bool FormulaGroupInterpreterSoftware::interpret(ScDocument& rDoc, const ScAddres
namespace
opencl
{
namespace
opencl
{
extern
sc
::
FormulaGroupInterpreter
*
createFormulaGroupInterpreter
();
extern
sc
::
FormulaGroupInterpreter
*
createFormulaGroupInterpreter
();
}
}
FormulaGroupInterpreter
*
FormulaGroupInterpreter
::
msInstance
=
NULL
;
FormulaGroupInterpreter
*
FormulaGroupInterpreter
::
msInstance
=
NULL
;
#if USE_DUMMY_INTERPRETER
class
FormulaGroupInterpreterDummy
:
public
FormulaGroupInterpreter
{
enum
Mode
{
WRITE_OUTPUT
=
0
};
Mode
meMode
;
public
:
FormulaGroupInterpreterDummy
()
{
const
char
*
pValue
=
getenv
(
"FORMULA_GROUP_DUMMY"
);
meMode
=
static_cast
<
Mode
>
(
OString
(
pValue
,
strlen
(
pValue
)).
toInt32
());
fprintf
(
stderr
,
"Using Dummy Formula Group interpreter mode %d
\n
"
,
(
int
)
meMode
);
}
virtual
ScMatrixRef
inverseMatrix
(
const
ScMatrix
&
/*rMat*/
)
{
return
ScMatrixRef
();
}
virtual
bool
interpret
(
ScDocument
&
rDoc
,
const
ScAddress
&
rTopPos
,
const
ScFormulaCellGroupRef
&
xGroup
,
ScTokenArray
&
rCode
)
{
(
void
)
rCode
;
// Write simple data back into the sheet
if
(
meMode
==
WRITE_OUTPUT
)
{
double
*
pDoubles
=
new
double
[
xGroup
->
mnLength
];
for
(
sal_Int32
i
=
0
;
i
<
xGroup
->
mnLength
;
i
++
)
pDoubles
[
i
]
=
42.0
+
i
;
rDoc
.
SetFormulaResults
(
rTopPos
,
pDoubles
,
xGroup
->
mnLength
);
delete
[]
pDoubles
;
}
return
true
;
}
};
#endif
/// load and/or configure the correct formula group interpreter
/// load and/or configure the correct formula group interpreter
FormulaGroupInterpreter
*
FormulaGroupInterpreter
::
getStatic
()
FormulaGroupInterpreter
*
FormulaGroupInterpreter
::
getStatic
()
{
{
static
bool
bOpenCLEnabled
=
false
;
static
bool
bOpenCLEnabled
=
false
;
#if USE_DUMMY_INTERPRETER
if
(
getenv
(
"FORMULA_GROUP_DUMMY"
))
{
delete
msInstance
;
return
msInstance
=
new
sc
::
FormulaGroupInterpreterDummy
();
}
#endif
if
(
msInstance
&&
if
(
msInstance
&&
bOpenCLEnabled
!=
ScInterpreter
::
GetGlobalConfig
().
mbOpenCLEnabled
)
bOpenCLEnabled
!=
ScInterpreter
::
GetGlobalConfig
().
mbOpenCLEnabled
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment