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 SC_OPENCL_OP_MATH_HXX
11 #define SC_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
);
23 virtual std::string
BinFuncName(void) const { return "Cos"; }
25 class OpSec
: public Normal
28 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
29 const std::string sSymName
, SubArguments
&vSubArguments
);
31 virtual std::string
BinFuncName(void) const { return "Sec"; }
33 class OpSecH
: public Normal
36 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
37 const std::string sSymName
, SubArguments
&vSubArguments
);
39 virtual std::string
BinFuncName(void) const { return "SecH"; }
41 class OpMROUND
: public Normal
44 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
45 const std::string sSymName
, SubArguments
&vSubArguments
);
47 virtual std::string
BinFuncName(void) const { return "MROUND"; }
51 class OpCsc
: public Normal
54 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
55 const std::string sSymName
, SubArguments
&vSubArguments
);
56 virtual std::string
BinFuncName(void) const { return "Csc"; }
58 class OpSumIfs
: public CheckVariables
61 OpSumIfs(void): CheckVariables(), mNeedReductionKernel(false) {}
62 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
63 const std::string sSymName
, SubArguments
&vSubArguments
);
64 virtual std::string
BinFuncName(void) const { return "SumIfs"; }
65 bool NeedReductionKernel(void) const { return mNeedReductionKernel
; }
67 bool mNeedReductionKernel
;
69 class OpCosh
: public Normal
72 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
73 const std::string sSymName
, SubArguments
&vSubArguments
);
74 virtual void BinInlineFun(std::set
<std::string
>& ,std::set
<std::string
>& );
75 virtual std::string
BinFuncName(void) const { return "Cosh"; }
77 class OpSinh
: public Normal
80 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
81 const std::string sSymName
, SubArguments
&vSubArguments
);
82 virtual std::string
BinFuncName(void) const { return "Sinh"; }
84 class OpSin
: public Normal
87 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
88 const std::string sSymName
, SubArguments
&vSubArguments
);
89 virtual std::string
BinFuncName(void) const { return "Sin"; }
91 class OpAbs
:public Normal
{
93 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
94 const std::string sSymName
, SubArguments
&vSubArguments
);
95 virtual std::string
GetBottom(void) { return "0.0"; }
96 virtual std::string
BinFuncName(void) const { return "ScAbs"; }
98 class OpArcCos
:public Normal
{
100 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
101 const std::string sSymName
, SubArguments
&vSubArguments
);
102 virtual std::string
GetBottom(void) { return "0.0"; }
103 virtual std::string
BinFuncName(void) const { return "ScACos"; }
104 virtual void BinInlineFun(std::set
<std::string
>& ,std::set
<std::string
>&);
106 class OpArcCosHyp
:public Normal
{
108 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
109 const std::string sSymName
, SubArguments
&vSubArguments
);
110 virtual std::string
GetBottom(void) { return "1.0"; }
111 virtual std::string
BinFuncName(void) const { return "ScACosH"; }
113 class OpTan
: public Normal
116 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
117 const std::string sSymName
, SubArguments
&vSubArguments
);
119 virtual std::string
BinFuncName(void) const { return "Tan"; }
121 class OpTanH
: public Normal
124 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
125 const std::string sSymName
, SubArguments
&vSubArguments
);
127 virtual std::string
BinFuncName(void) const { return "TanH"; }
129 class OpSqrt
: public Normal
132 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
133 const std::string sSymName
, SubArguments
&vSubArguments
);
135 virtual std::string
BinFuncName(void) const { return "Sqrt"; }
137 class OpArcCot
:public Normal
{
139 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
140 const std::string sSymName
, SubArguments
&vSubArguments
);
141 virtual std::string
GetBottom(void) { return "0.0"; }
142 virtual std::string
BinFuncName(void) const { return "ScACot"; }
144 class OpArcCotHyp
:public Normal
{
146 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
147 const std::string sSymName
, SubArguments
&vSubArguments
);
148 virtual std::string
GetBottom(void) { return "2.0"; }
149 virtual std::string
BinFuncName(void) const { return "ScACotH"; }
151 class OpArcSin
:public Normal
{
153 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
154 const std::string sSymName
, SubArguments
&vSubArguments
);
155 virtual std::string
GetBottom(void) { return "0.0"; }
156 virtual std::string
BinFuncName(void) const { return "ScASin"; }
157 virtual void BinInlineFun(std::set
<std::string
>& ,std::set
<std::string
>&);
159 class OpArcSinHyp
:public Normal
{
161 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
162 const std::string sSymName
, SubArguments
&vSubArguments
);
163 virtual std::string
GetBottom(void) { return "0.0"; }
164 virtual std::string
BinFuncName(void) const { return "ScASinH"; }
166 class OpTrunc
: public Normal
169 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
170 const std::string sSymName
, SubArguments
&vSubArguments
);
172 virtual std::string
BinFuncName(void) const { return "Trunc"; }
174 class OpArcTan2
:public Normal
{
176 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
177 const std::string sSymName
, SubArguments
&vSubArguments
);
178 virtual std::string
GetBottom(void) { return "0.0"; }
179 virtual std::string
BinFuncName(void) const { return "ScATan2"; }
180 virtual void BinInlineFun(std::set
<std::string
>& ,std::set
<std::string
>&);
182 class OpArcTan
:public Normal
{
184 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
185 const std::string sSymName
, SubArguments
&vSubArguments
);
186 virtual std::string
GetBottom(void) { return "0.0"; }
187 virtual std::string
BinFuncName(void) const { return "ScATan"; }
189 class OpArcTanH
:public Normal
{
191 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
192 const std::string sSymName
, SubArguments
&vSubArguments
);
193 virtual std::string
GetBottom(void) { return "0.0"; }
194 virtual std::string
BinFuncName(void) const { return "ScATanH"; }
196 class OpBitAnd
:public Normal
{
198 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
199 const std::string sSymName
, SubArguments
&vSubArguments
);
200 virtual std::string
GetBottom(void) { return "0.0"; }
201 virtual std::string
BinFuncName(void) const { return "ScBitAnd"; }
203 class OpBitOr
:public Normal
{
205 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
206 const std::string sSymName
, SubArguments
&vSubArguments
);
207 virtual std::string
GetBottom(void) { return "0.0"; }
208 virtual std::string
BinFuncName(void) const { return "ScBitOr"; }
210 class OpBitXor
:public Normal
{
212 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
213 const std::string sSymName
, SubArguments
&vSubArguments
);
214 virtual std::string
GetBottom(void) { return "0.0"; }
215 virtual std::string
BinFuncName(void) const { return "ScBitXor"; }
217 class OpBitLshift
:public Normal
{
219 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
220 const std::string sSymName
, SubArguments
&vSubArguments
);
221 virtual std::string
GetBottom(void) { return "0.0"; }
222 virtual std::string
BinFuncName(void) const { return "ScBitLshift"; }
224 class OpBitRshift
:public Normal
{
226 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
227 const std::string sSymName
, SubArguments
&vSubArguments
);
228 virtual std::string
GetBottom(void) { return "0.0"; }
229 virtual std::string
BinFuncName(void) const { return "ScBitRshift"; }
231 class OpLn
: public CheckVariables
234 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
235 const std::string sSymName
, SubArguments
&vSubArguments
);
236 virtual std::string
BinFuncName(void) const { return "Ln"; }
238 class OpRound
: public CheckVariables
241 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
242 const std::string sSymName
, SubArguments
&vSubArguments
);
243 virtual std::string
BinFuncName(void) const { return "Round"; }
245 class OpRoundUp
: public CheckVariables
248 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
249 const std::string sSymName
, SubArguments
&vSubArguments
);
250 virtual std::string
BinFuncName(void) const { return "RoundUp"; }
252 class OpRoundDown
: public CheckVariables
255 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
256 const std::string sSymName
, SubArguments
&vSubArguments
);
257 virtual std::string
BinFuncName(void) const { return "RoundDown"; }
259 class OpInt
: public CheckVariables
262 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
263 const std::string sSymName
, SubArguments
&vSubArguments
);
264 virtual std::string
BinFuncName(void) const { return "Int"; }
266 class OpRadians
: public CheckVariables
269 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
270 const std::string sSymName
, SubArguments
&vSubArguments
);
271 virtual std::string
BinFuncName(void) const { return "Radians"; }
273 class OpIsEven
: public CheckVariables
276 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
277 const std::string sSymName
, SubArguments
&vSubArguments
);
278 virtual std::string
BinFuncName(void) const { return "IsEven"; }
280 class OpIsOdd
: public CheckVariables
283 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
284 const std::string sSymName
, SubArguments
&vSubArguments
);
285 virtual std::string
BinFuncName(void) const { return "IsOdd"; }
287 class OpCot
: public Normal
290 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
291 const std::string sSymName
, SubArguments
&vSubArguments
);
293 virtual std::string
BinFuncName(void) const { return "Cot"; }
295 class OpSumSQ
: public Normal
298 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
299 const std::string sSymName
, SubArguments
&vSubArguments
);
301 virtual std::string
BinFuncName(void) const { return "SumSQ"; }
303 class OpCoth
: public Normal
306 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
307 const std::string sSymName
, SubArguments
&vSubArguments
);
308 virtual void BinInlineFun(std::set
<std::string
>& ,
309 std::set
<std::string
>& );
310 virtual std::string
BinFuncName(void) const { return "Coth"; }
312 class OpPower
: public Normal
315 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
316 const std::string sSymName
, SubArguments
&vSubArguments
);
317 virtual std::string
BinFuncName(void) const { return "Power"; }
319 class OpOdd
: public Normal
322 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
323 const std::string sSymName
, SubArguments
&vSubArguments
);
324 virtual std::string
BinFuncName(void) const { return "Odd"; }
326 class OpFloor
: public Normal
329 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
330 const std::string sSymName
, SubArguments
&vSubArguments
);
331 virtual std::string
BinFuncName(void) const { return "Floor"; }
333 class OpCscH
: public Normal
336 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
337 const std::string sSymName
, SubArguments
&vSubArguments
);
338 virtual std::string
BinFuncName(void) const { return "CscH"; }
340 class OpCeil
:public Normal
{
342 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
343 const std::string sSymName
, SubArguments
&vSubArguments
);
344 virtual std::string
GetBottom(void) { return "0.0"; }
345 virtual std::string
BinFuncName(void) const { return "ScCeil"; }
347 class OpExp
: public Normal
350 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
351 const std::string sSymName
, SubArguments
&vSubArguments
);
352 virtual std::string
BinFuncName(void) const { return "Exp"; }
354 class OpLog10
: public Normal
357 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
358 const std::string sSymName
, SubArguments
&vSubArguments
);
359 virtual std::string
BinFuncName(void) const { return "Log10"; }
361 class OpConvert
: public Normal
364 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
365 const std::string sSymName
, SubArguments
&vSubArguments
);
366 virtual std::string
BinFuncName(void) const { return "Convert"; }
367 virtual bool takeString() const { return true; }
370 class OpEven
: public Normal
373 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
374 const std::string sSymName
, SubArguments
&vSubArguments
);
376 virtual std::string
BinFuncName(void) const { return "Even"; }
378 class OpAverageIfs
: public CheckVariables
381 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
382 const std::string sSymName
, SubArguments
&vSubArguments
);
383 virtual std::string
BinFuncName(void) const { return "AverageIfs"; }
385 class OpCountIfs
: public CheckVariables
388 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
389 const std::string sSymName
, SubArguments
&vSubArguments
);
390 virtual std::string
BinFuncName(void) const { return "CountIfs"; }
392 class OpMod
: public Normal
395 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
396 const std::string sSymName
, SubArguments
&vSubArguments
);
398 virtual std::string
BinFuncName(void) const { return "Mod"; }
400 class OpProduct
: public Normal
403 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
404 const std::string sSymName
, SubArguments
&vSubArguments
);
405 virtual std::string
BinFuncName(void) const { return "Product"; }
407 class OpSqrtPi
: public Normal
410 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
411 const std::string sSymName
, SubArguments
&vSubArguments
);
413 virtual std::string
BinFuncName(void) const { return "SqrtPi"; }
416 class OpCombina
: public Normal
419 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
420 const std::string sSymName
, SubArguments
&vSubArguments
);
422 virtual std::string
BinFuncName(void) const { return "Combina"; }
423 virtual void BinInlineFun(std::set
<std::string
>& ,std::set
<std::string
>& );
425 class OpLog
: public Normal
428 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
429 const std::string sSymName
, SubArguments
&vSubArguments
);
431 virtual std::string
BinFuncName(void) const { return "Log"; }
433 class OpKombin
: public Normal
{
435 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
436 const std::string sSymName
, SubArguments
&vSubArguments
);
437 virtual std::string
GetBottom(void) { return "0.0"; }
438 virtual std::string
BinFuncName(void) const { return "ScKombin"; }
440 class OpAverageIf
: public CheckVariables
443 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
444 const std::string sSymName
, SubArguments
&vSubArguments
);
446 virtual std::string
BinFuncName(void) const { return "AverageIf"; }
448 class OpDeg
: public Normal
451 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
452 const std::string sSymName
, SubArguments
&vSubArguments
);
453 virtual std::string
BinFuncName(void) const { return "Degrees"; }
455 class OpCountIf
: public Normal
458 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
459 const std::string sSymName
, SubArguments
&vSubArguments
);
460 virtual std::string
BinFuncName(void) const { return "Countif"; }
462 class OpFact
: public Normal
{
464 virtual void GenSlidingWindowFunction(std::stringstream
& ss
,
465 const std::string sSymName
, SubArguments
& vSubArguments
);
466 virtual std::string
GetBottom(void) { return "0.0"; }
467 virtual std::string
BinFuncName(void) const { return "Fact"; }
469 class OpSeriesSum
: public Normal
472 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
473 const std::string sSymName
, SubArguments
&vSubArguments
);
474 virtual std::string
BinFuncName(void) const { return "SeriesSum"; }
476 class OpSumIf
: public Normal
479 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
480 const std::string sSymName
, SubArguments
&vSubArguments
);
481 virtual std::string
BinFuncName(void) const { return "SumIf"; }
483 class OpQuotient
: public Normal
486 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
487 const std::string sSymName
, SubArguments
&vSubArguments
);
488 virtual std::string
BinFuncName(void) const { return "Quotient"; }
490 class OpNegSub
: public CheckVariables
493 virtual void GenSlidingWindowFunction(std::stringstream
&ss
,
494 const std::string sSymName
, SubArguments
&vSubArguments
);
495 virtual std::string
BinFuncName(void) const { return "NegSub"; }
502 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */