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 #ifndef INCLUDED_SC_SOURCE_CORE_OPENCL_OP_MATH_HXX
11 #define INCLUDED_SC_SOURCE_CORE_OPENCL_OP_MATH_HXX
15 namespace sc
{ namespace opencl
{
17 class OpCos
: public Normal
20 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
21 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
23 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Cos"; }
25 class OpSec
: public Normal
28 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
29 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
31 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Sec"; }
33 class OpSecH
: public Normal
36 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
37 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
39 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "SecH"; }
41 class OpMROUND
: public Normal
44 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
45 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
47 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "MROUND"; }
50 class OpCsc
: public Normal
53 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
54 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
55 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Csc"; }
57 class OpSumIfs
: public CheckVariables
60 OpSumIfs(): CheckVariables(), mNeedReductionKernel(false) {}
61 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
62 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
63 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "SumIfs"; }
64 bool NeedReductionKernel() const { return mNeedReductionKernel
; }
66 bool mNeedReductionKernel
;
68 class OpCosh
: public Normal
71 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
72 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
73 virtual void BinInlineFun(std::set
<std::string
>& ,std::set
<std::string
>& ) SAL_OVERRIDE
;
74 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Cosh"; }
76 class OpSinh
: public Normal
79 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
80 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
81 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Sinh"; }
83 class OpSin
: public Normal
86 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
87 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
88 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Sin"; }
90 class OpAbs
:public Normal
{
92 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
93 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
94 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
95 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScAbs"; }
97 class OpArcCos
:public Normal
{
99 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
100 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
101 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
102 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScACos"; }
103 virtual void BinInlineFun(std::set
<std::string
>& ,std::set
<std::string
>&) SAL_OVERRIDE
;
105 class OpArcCosHyp
:public Normal
{
107 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
108 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
109 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "1.0"; }
110 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScACosH"; }
112 class OpTan
: public Normal
115 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
116 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
118 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Tan"; }
120 class OpTanH
: public Normal
123 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
124 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
126 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "TanH"; }
128 class OpSqrt
: public Normal
131 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
132 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
134 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Sqrt"; }
136 class OpArcCot
:public Normal
{
138 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
139 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
140 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
141 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScACot"; }
143 class OpArcCotHyp
:public Normal
{
145 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
146 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
147 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "2.0"; }
148 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScACotH"; }
150 class OpArcSin
:public Normal
{
152 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
153 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
154 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
155 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScASin"; }
156 virtual void BinInlineFun(std::set
<std::string
>& ,std::set
<std::string
>&) SAL_OVERRIDE
;
158 class OpArcSinHyp
:public Normal
{
160 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
161 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
162 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
163 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScASinH"; }
165 class OpTrunc
: public Normal
168 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
169 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
171 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Trunc"; }
173 class OpArcTan2
:public Normal
{
175 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
176 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
177 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
178 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScATan2"; }
179 virtual void BinInlineFun(std::set
<std::string
>& ,std::set
<std::string
>&) SAL_OVERRIDE
;
181 class OpArcTan
:public Normal
{
183 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
184 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
185 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
186 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScATan"; }
188 class OpArcTanH
:public Normal
{
190 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
191 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
192 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
193 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScATanH"; }
195 class OpBitAnd
:public Normal
{
197 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
198 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
199 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
200 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScBitAnd"; }
202 class OpBitOr
:public Normal
{
204 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
205 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
206 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
207 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScBitOr"; }
209 class OpBitXor
:public Normal
{
211 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
212 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
213 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
214 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScBitXor"; }
216 class OpBitLshift
:public Normal
{
218 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
219 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
220 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
221 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScBitLshift"; }
223 class OpBitRshift
:public Normal
{
225 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
226 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
227 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
228 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScBitRshift"; }
230 class OpLn
: public CheckVariables
233 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
234 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
235 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Ln"; }
237 class OpRound
: public CheckVariables
240 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
241 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
242 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Round"; }
244 class OpRoundUp
: public CheckVariables
247 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
248 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
249 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "RoundUp"; }
251 class OpRoundDown
: public CheckVariables
254 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
255 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
256 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "RoundDown"; }
258 class OpInt
: public CheckVariables
261 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
262 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
263 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Int"; }
265 class OpRadians
: public CheckVariables
268 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
269 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
270 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Radians"; }
272 class OpIsEven
: public CheckVariables
275 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
276 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
277 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "IsEven"; }
279 class OpIsOdd
: public CheckVariables
282 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
283 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
284 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "IsOdd"; }
286 class OpCot
: public Normal
289 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
290 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
292 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Cot"; }
294 class OpSumSQ
: public Normal
297 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
298 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
300 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "SumSQ"; }
302 class OpCoth
: public Normal
305 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
306 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
307 virtual void BinInlineFun(std::set
<std::string
>& ,
308 std::set
<std::string
>& ) SAL_OVERRIDE
;
309 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Coth"; }
311 class OpPower
: public Normal
314 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
315 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
316 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Power"; }
318 class OpOdd
: public Normal
321 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
322 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
323 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Odd"; }
325 class OpFloor
: public Normal
328 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
329 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
330 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Floor"; }
332 class OpCscH
: public Normal
335 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
336 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
337 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "CscH"; }
339 class OpCeil
:public Normal
{
341 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
342 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
343 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
344 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScCeil"; }
346 class OpExp
: public Normal
349 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
350 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
351 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Exp"; }
353 class OpLog10
: public Normal
356 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
357 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
358 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Log10"; }
360 class OpConvert
: public Normal
363 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
364 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
365 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Convert"; }
366 virtual bool takeString() const SAL_OVERRIDE
{ return true; }
369 class OpEven
: public Normal
372 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
373 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
375 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Even"; }
377 class OpAverageIfs
: public CheckVariables
380 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
381 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
382 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "AverageIfs"; }
384 class OpCountIfs
: public CheckVariables
387 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
388 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
389 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "CountIfs"; }
391 class OpMod
: public Normal
394 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
395 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
397 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Mod"; }
399 class OpProduct
: public Normal
402 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
403 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
404 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Product"; }
406 class OpSqrtPi
: public Normal
409 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
410 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
412 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "SqrtPi"; }
415 class OpCombinA
: public Normal
418 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
419 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
421 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Combina"; }
422 virtual void BinInlineFun(std::set
<std::string
>& ,std::set
<std::string
>& ) SAL_OVERRIDE
;
424 class OpLog
: public Normal
427 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
428 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
430 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Log"; }
432 class OpCombin
: public Normal
{
434 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
435 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
436 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
437 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "ScCombin"; }
439 class OpAverageIf
: public CheckVariables
442 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
443 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
445 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "AverageIf"; }
447 class OpDeg
: public Normal
450 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
451 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
452 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Degrees"; }
454 class OpCountIf
: public Normal
457 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
458 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
459 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Countif"; }
461 class OpFact
: public Normal
{
463 virtual void GenSlidingWindowFunction(std::stringstream
& ss
,
464 const std::string
&sSymName
, SubArguments
& vSubArguments
) SAL_OVERRIDE
;
465 virtual std::string
GetBottom() SAL_OVERRIDE
{ return "0.0"; }
466 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Fact"; }
468 class OpSeriesSum
: public Normal
471 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
472 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
473 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "SeriesSum"; }
475 class OpSumIf
: public Normal
478 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
479 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
480 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "SumIf"; }
482 class OpQuotient
: public Normal
485 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
486 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
487 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "Quotient"; }
489 class OpNegSub
: public CheckVariables
492 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
493 const std::string
&sSymName
, SubArguments
&vSubArguments
) SAL_OVERRIDE
;
494 virtual std::string
BinFuncName() const SAL_OVERRIDE
{ return "NegSub"; }
501 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */