LibreOffice Module sc (master) 1
interpre.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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <rtl/math.hxx>
23#include <rtl/ustring.hxx>
27#include <types.hxx>
28#include <externalrefmgr.hxx>
29#include <calcconfig.hxx>
30#include <token.hxx>
31#include <math.hxx>
32#include <kahan.hxx>
33#include "parclass.hxx"
34
35#include <map>
36#include <memory>
37#include <vector>
38#include <limits>
39#include <ostream>
40
41namespace sfx2 { class LinkManager; }
42
43class ScDocument;
44class SbxVariable;
45class ScFormulaCell;
46class ScDBRangeBase;
47struct ScQueryParam;
49struct ScQueryEntry;
50
51struct ScSingleRefData;
52struct ScComplexRefData;
54
55class ScJumpMatrix;
56struct ScRefCellValue;
57
58namespace sc {
59
60struct CompareOptions;
61
63{
65 double mfCount = 0.0;
66 double mfMin = std::numeric_limits<double>::max();
67 double mfMax = std::numeric_limits<double>::lowest();
68};
69
70template<typename charT, typename traits>
71inline std::basic_ostream<charT, traits> & operator <<(std::basic_ostream<charT, traits> & stream, const ParamIfsResult& rRes)
72{
73 stream << "{" <<
74 "sum=" << rRes.mfSum.get() << "," <<
75 "count=" << rRes.mfCount << "," <<
76 "min=" << rRes.mfMin << "," <<
77 "max=" << rRes.mfMax << "," <<
78 "}";
79
80 return stream;
81}
82
83}
84
85namespace svl {
86
87class SharedStringPool;
88
89}
90
92constexpr sal_Int32 kScInterpreterMaxStrLen = SAL_MAX_INT32 / 8;
93
94constexpr size_t MAXSTACK = 512;
95
97{
98public:
100};
101
103 ifSUM, // Add up
104 ifSUMSQ, // Sums of squares
105 ifPRODUCT, // Product
106 ifAVERAGE, // Average
107 ifCOUNT, // Count Values
108 ifCOUNT2, // Count Values (not empty)
109 ifMIN, // Minimum
110 ifMAX // Maximum
112
114{
115 ifSUMIF, // Conditional sum
116 ifAVERAGEIF // Conditional average
118
120{
129
131{
133 { return r1.get() < r2.get(); }
134};
135typedef ::std::map< const formula::FormulaConstTokenRef, formula::FormulaConstTokenRef, FormulaTokenRef_less> ScTokenMatrixMap;
136
138{
139 // distribution function objects need the GetxxxDist methods
141 friend class ScBetaDistFunction;
142 friend class ScTDistFunction;
143 friend class ScFDistFunction;
144 friend class ScChiDistFunction;
146
147public:
148 static void SetGlobalConfig(const ScCalcConfig& rConfig);
149 static const ScCalcConfig& GetGlobalConfig();
150
151 static void GlobalExit(); // called by ScGlobal::Clear()
152
156 static utl::SearchParam::SearchType DetectSearchType(std::u16string_view rStr, const ScDocument& rDoc );
157
160 static inline double div( const double& fNumerator, const double& fDenominator );
161
162 ScMatrixRef GetNewMat(SCSIZE nC, SCSIZE nR, bool bEmpty = false);
163
164 ScMatrixRef GetNewMat(SCSIZE nC, SCSIZE nR, const std::vector<double>& rValues);
165
170 };
171
173
174private:
177
178 static thread_local std::unique_ptr<ScTokenStack> pGlobalStack;
179 static thread_local bool bGlobalStackInUse;
180
190 ScJumpMatrix* pJumpMatrix; // currently active array condition, if any
191 ScTokenMatrixMap maTokenMatrixMap; // map FormulaToken* to formula::FormulaTokenRef if in array condition
192 ScFormulaCell* pMyFormulaCell; // the cell of this formula expression
194
195 const formula::FormulaToken* pCur; // current token
196 ScTokenStack* pStackObj; // contains the stacks
197 const formula::FormulaToken ** pStack; // the current stack
198 FormulaError nGlobalError; // global (local to this formula expression) error
199 sal_uInt16 sp; // stack pointer
200 sal_uInt16 maxsp; // the maximal used stack pointer
201 sal_uInt32 nFuncFmtIndex; // NumberFormatIndex of a function
202 sal_uInt32 nCurFmtIndex; // current NumberFormatIndex
203 sal_uInt32 nRetFmtIndex; // NumberFormatIndex of an expression, if any
204 SvNumFormatType nFuncFmtType; // NumberFormatType of a function
205 SvNumFormatType nCurFmtType; // current NumberFormatType
206 SvNumFormatType nRetFmtType; // NumberFormatType of an expression
207 FormulaError mnStringNoValueError; // the error set in ConvertStringToValue() if no value
208 SubtotalFlags mnSubTotalFlags; // flags for subtotal and aggregate functions
209 sal_uInt8 cPar; // current count of parameters
210 bool bCalcAsShown; // precision as shown
211 bool bMatrixFormula; // formula cell is a matrix formula
212
214
215 void MakeMatNew(ScMatrixRef& rMat, SCSIZE nC, SCSIZE nR);
216
218 void MergeCalcConfig();
219
220 // nMust <= nAct <= nMax ? ok : PushError
221 inline bool MustHaveParamCount( short nAct, short nMust );
222 inline bool MustHaveParamCount( short nAct, short nMust, short nMax );
223 inline bool MustHaveParamCountMin( short nAct, short nMin );
224 inline bool MustHaveParamCountMinWithStackCheck( short nAct, short nMin );
227 void PushIllegalArgument();
228 void PushNoValue();
229 void PushNA();
230
231 // Functions for accessing a document
232
233 void ReplaceCell( ScAddress& ); // for TableOp
234 bool IsTableOpInRange( const ScRange& );
235 sal_uInt32 GetCellNumberFormat( const ScAddress& rPos, ScRefCellValue& rCell );
236 double ConvertStringToValue( const OUString& );
237public:
238 static double ScGetGCD(double fx, double fy);
241 double ConvertStringToValue( const OUString&, FormulaError& rError, SvNumFormatType& rCurFmtType );
242private:
243 double GetCellValue( const ScAddress&, ScRefCellValue& rCell );
244 double GetCellValueOrZero( const ScAddress&, ScRefCellValue& rCell );
245 double GetValueCellValue( const ScAddress&, double fOrig );
246 void GetCellString( svl::SharedString& rStr, ScRefCellValue& rCell );
247 static FormulaError GetCellErrCode( const ScRefCellValue& rCell );
248
249 bool CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
250 SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr);
251 bool CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
252 SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr);
253 bool CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
254 SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr);
255
256 // Stack operations
257
261 void Push( const formula::FormulaToken& r );
262
267
275
280
288
294 {
295 if (nGlobalError != FormulaError::NONE)
296 {
298 return true;
299 }
300 return false;
301 }
302
318 void PushCellResultToken( bool bDisplayEmptyAsString, const ScAddress & rAddress,
319 SvNumFormatType * pRetTypeExpr, sal_uInt32 * pRetIndexExpr, bool bFinalResult = false );
320
322 void Pop();
323 void PopError();
324 double PopDouble();
326 void ValidateRef( const ScSingleRefData & rRef );
327 void ValidateRef( const ScComplexRefData & rRef );
328 void ValidateRef( const ScRefList & rRefList );
329 void SingleRefToVars( const ScSingleRefData & rRef, SCCOL & rCol, SCROW & rRow, SCTAB & rTab );
330 void PopSingleRef( ScAddress& );
331 void PopSingleRef(SCCOL& rCol, SCROW &rRow, SCTAB& rTab);
332 void DoubleRefToRange( const ScComplexRefData&, ScRange&, bool bDontCheckForTableOp = false );
341 void PopDoubleRef( ScRange & rRange, short & rParam, size_t & rRefInList );
342 void PopDoubleRef( ScRange&, bool bDontCheckForTableOp = false );
344 SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1,
345 SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2 );
347 void PopDoubleRef(SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1,
348 SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2 );
349 // peek double ref data
350 const ScComplexRefData* GetStackDoubleRef(size_t rRefInList = 0);
351
352 void PopExternalSingleRef(sal_uInt16& rFileId, OUString& rTabName, ScSingleRefData& rRef);
353
356
358 void PopExternalSingleRef(sal_uInt16& rFileId, OUString& rTabName, ScSingleRefData& rRef,
360
361 void PopExternalDoubleRef(sal_uInt16& rFileId, OUString& rTabName, ScComplexRefData& rRef);
364 void GetExternalDoubleRef(sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& aData, ScExternalRefCache::TokenArrayRef& rArray);
368 // If MatrixFormula: convert svDoubleRef to svMatrix, create JumpMatrix.
369 // Else convert area reference parameters marked as ForceArray to array.
370 // Returns true if JumpMatrix created.
372 // If MatrixFormula: ConvertMatrixJumpConditionToMatrix()
373 inline void MatrixJumpConditionToMatrix();
374 // For MatrixFormula (preconditions already checked by
375 // MatrixJumpConditionToMatrix()): convert svDoubleRef to svMatrix, or if
376 // JumpMatrix currently in effect convert also other types to svMatrix so
377 // another JumpMatrix will be created by jump commands.
379 // If MatrixFormula or ForceArray: ConvertMatrixParameters()
380 inline bool MatrixParameterConversion();
381 // If MatrixFormula or ForceArray. Can be used within spreadsheet functions
382 // that do not depend on the formula cell's matrix size, for which only
383 // bMatrixFormula can be used.
384 inline bool IsInArrayContext() const;
387 void QueryMatrixType(const ScMatrixRef& xMat, SvNumFormatType& rRetTypeExpr, sal_uInt32& rRetIndexExpr);
388
389 formula::FormulaToken* CreateFormulaDoubleToken( double fVal, SvNumFormatType nFmt = SvNumFormatType::NUMBER );
391
392 void PushDouble(double nVal);
393 void PushInt( int nVal );
394 void PushStringBuffer( const sal_Unicode* pString );
395 void PushString( const OUString& rStr );
396 void PushString( const svl::SharedString& rString );
397 void PushSingleRef(SCCOL nCol, SCROW nRow, SCTAB nTab);
398 void PushDoubleRef(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
399 SCCOL nCol2, SCROW nRow2, SCTAB nTab2);
400 void PushExternalSingleRef(sal_uInt16 nFileId, const OUString& rTabName,
401 SCCOL nCol, SCROW nRow, SCTAB nTab);
402 void PushExternalDoubleRef(sal_uInt16 nFileId, const OUString& rTabName,
403 SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
404 SCCOL nCol2, SCROW nRow2, SCTAB nTab2);
405 void PushSingleRef( const ScRefAddress& rRef );
406 void PushDoubleRef( const ScRefAddress& rRef1, const ScRefAddress& rRef2 );
407 void PushMatrix( const sc::RangeMatrix& rMat );
408 void PushMatrix(const ScMatrixRef& pMat);
409 void PushError( FormulaError nError );
414 // peek StackType of Parameter, Parameter 1 == TOS, 2 == TOS-1, ...
416 sal_uInt8 GetByte() const { return cPar; }
417 // reverse order of stack
418 void ReverseStack( sal_uInt8 nParamCount );
419 // generates a position-dependent SingleRef out of a DoubleRef
420 bool DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& rAdr );
421 double GetDoubleFromMatrix(const ScMatrixRef& pMat);
422 double GetDouble();
423 double GetDoubleWithDefault(double nDefault);
424 bool IsMissing() const;
425 sal_Int32 double_to_int32(double fVal);
427 sal_Int32 GetInt32();
429 sal_Int32 GetInt32WithDefault( sal_Int32 nDefault );
431 sal_Int16 GetInt16();
433 sal_uInt32 GetUInt32();
434 bool GetBool() { return GetDouble() != 0.0; }
436 bool GetDoubleOrString( double& rValue, svl::SharedString& rString );
439 svl::SharedString GetStringFromDouble( const double fVal);
440 // pop matrix and obtain one element, upper left or according to jump matrix
443 SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
444 SCCOL nCol2, SCROW nRow2, SCTAB nTab2 );
447 ScMatrixRef GetMatrix( short & rParam, size_t & rInRefList );
449
450 void ScTableOp(); // repeated operations
451
452 // common helper functions
453
456
467 static inline bool CheckStringPositionArgument( double & fVal );
468
473 inline sal_Int32 GetStringPositionArgument();
474
475 // Check for String overflow of rResult+rAdd and set error and erase rResult
476 // if so. Return true if ok, false if overflow
477 inline bool CheckStringResultLen( OUString& rResult, sal_Int32 nIncrease );
478
479 // Check for String overflow of rResult+rAdd and set error and erase rResult
480 // if so. Return true if ok, false if overflow
481 inline bool CheckStringResultLen( OUStringBuffer& rResult, sal_Int32 nIncrease );
482
483 // Set error according to rVal, and set rVal to 0.0 if there was an error.
484 inline void TreatDoubleError( double& rVal );
485 // Lookup using ScLookupCache, @returns true if found and result address
486 bool LookupQueryWithCache( ScAddress & o_rResultPos,
487 const ScQueryParam & rParam, const ScComplexRefData* refData ) const;
488
489 void ScIfJump();
490 void ScIfError( bool bNAonly );
491 void ScChooseJump();
492
493 // Be sure to only call this if pStack[sp-nStackLevel] really contains a
494 // ScJumpMatrixToken, no further checks are applied!
495 // Returns true if last jump was executed and result matrix pushed.
496 bool JumpMatrix( short nStackLevel );
497
498 double Compare( ScQueryOp eOp );
502 sc::RangeMatrix CompareMat( ScQueryOp eOp, sc::CompareOptions* pOptions = nullptr );
503 ScMatrixRef QueryMat( const ScMatrixRef& pMat, sc::CompareOptions& rOptions );
504 void ScEqual();
505 void ScNotEqual();
506 void ScLess();
507 void ScGreater();
508 void ScLessEqual();
509 void ScGreaterEqual();
510 void ScAnd();
511 void ScOr();
512 void ScXor();
513 void ScNot();
514 void ScNeg();
515 void ScPercentSign();
516 void ScIntersect();
517 void ScRangeFunc();
518 void ScUnionFunc();
519 void ScPi();
520 void ScRandom();
521 void ScRandbetween();
522 void ScRandomImpl( const std::function<double( double fFirst, double fLast )>& RandomFunc,
523 double fFirst, double fLast );
524 void ScTrue();
525 void ScFalse();
526 void ScDeg();
527 void ScRad();
528 void ScSin();
529 void ScCos();
530 void ScTan();
531 void ScCot();
532 void ScArcSin();
533 void ScArcCos();
534 void ScArcTan();
535 void ScArcCot();
536 void ScSinHyp();
537 void ScCosHyp();
538 void ScTanHyp();
539 void ScCotHyp();
540 void ScArcSinHyp();
541 void ScArcCosHyp();
542 void ScArcTanHyp();
543 void ScArcCotHyp();
544 void ScCosecant();
545 void ScSecant();
546 void ScCosecantHyp();
547 void ScSecantHyp();
548 void ScExp();
549 void ScLn();
550 void ScLog10();
551 void ScSqrt();
552 void ScIsEmpty();
553 bool IsString();
554 void ScIsString();
555 void ScIsNonString();
556 void ScIsLogical();
557 void ScType();
558 void ScCell();
559 void ScCellExternal();
560 void ScIsRef();
561 void ScIsValue();
562 void ScIsFormula();
563 void ScFormula();
564 void ScRoman();
565 void ScArabic();
566 void ScIsNV();
567 void ScIsErr();
568 void ScIsError();
569 bool IsEven();
570 void ScIsEven();
571 void ScIsOdd();
572 void ScN();
573 void ScCode();
574 void ScTrim();
575 void ScUpper();
576 void ScProper();
577 void ScLower();
578 void ScLen();
579 void ScT();
580 void ScValue();
581 void ScNumberValue();
582 void ScClean();
583 void ScChar();
584 void ScJis();
585 void ScAsc();
586 void ScUnicode();
587 void ScUnichar();
588 void ScMin( bool bTextAsZero = false );
589 void ScMax( bool bTextAsZero = false );
592 size_t GetRefListArrayMaxSize( short nParamCount );
595 bool SwitchToArrayRefList( ScMatrixRef& xResMat, SCSIZE nMatRows, double fCurrent,
596 const std::function<void( SCSIZE i, double fCurrent )>& MatOpFunc, bool bDoMatOp );
597 void IterateParameters( ScIterFunc, bool bTextAsZero = false );
598 void ScSumSQ();
599 void ScSum();
600 void ScProduct();
601 void ScAverage( bool bTextAsZero = false );
602 void ScCount();
603 void ScCount2();
604 void GetStVarParams( bool bTextAsZero, double(*VarResult)( double fVal, size_t nValCount ) );
605 void ScVar( bool bTextAsZero = false );
606 void ScVarP( bool bTextAsZero = false );
607 void ScStDev( bool bTextAsZero = false );
608 void ScStDevP( bool bTextAsZero = false );
609 void ScRawSubtract();
610 void ScColumns();
611 void ScRows();
612 void ScSheets();
613 void ScColumn();
614 void ScRow();
615 void ScSheet();
616 void ScMatch();
618 void ScCountIf();
619 void ScSumIf();
620 void ScAverageIf();
621 void IterateParametersIfs( double(*ResultFunc)( const sc::ParamIfsResult& rRes ) );
622 void ScSumIfs();
623 void ScAverageIfs();
624 void ScCountIfs();
625 void ScCountEmptyCells();
626 void ScLookup();
627 void ScHLookup();
628 void ScVLookup();
629 void ScSubTotal();
630
631 // If upon call rMissingField==true then the database field parameter may be
632 // missing (Xcl DCOUNT() syntax), or may be faked as missing by having the
633 // value 0.0 or being exactly the entire database range reference (old SO
634 // compatibility). If this was the case then rMissingField is set to true upon
635 // return. If rMissingField==false upon call all "missing cases" are considered
636 // to be an error.
637 std::unique_ptr<ScDBQueryParamBase> GetDBParams( bool& rMissingField );
638
639 void DBIterator( ScIterFunc );
640 void ScDBSum();
641 void ScDBCount();
642 void ScDBCount2();
643 void ScDBAverage();
644 void ScDBGet();
645 void ScDBMax();
646 void ScDBMin();
647 void ScDBProduct();
648 void GetDBStVarParams( double& rVal, double& rValCount );
649 void ScDBStdDev();
650 void ScDBStdDevP();
651 void ScDBVar();
652 void ScDBVarP();
653 void ScIndirect();
654 void ScAddressFunc();
655 void ScOffset();
656 void ScIndex();
657 void ScMultiArea();
658 void ScAreas();
659 void ScCurrency();
660 void ScReplace();
661 void ScFixed();
662 void ScFind();
663 void ScExact();
664 void ScLeft();
665 void ScRight();
666 void ScSearch();
667 void ScMid();
668 void ScText();
669 void ScSubstitute();
670 void ScRept();
671 void ScRegex();
672 void ScConcat();
673 void ScConcat_MS();
674 void ScTextJoin_MS();
675 void ScIfs_MS();
676 void ScSwitch_MS();
677 void ScMinIfs_MS();
678 void ScMaxIfs_MS();
679 void ScExternal();
680 void ScMissing();
681 void ScMacro();
682 bool SetSbxVariable( SbxVariable* pVar, const ScAddress& );
684 void ScErrorType();
685 void ScErrorType_ODF();
686 void ScDBArea();
687 void ScColRowNameAuto();
688 void ScGetPivotData();
689 void ScHyperLink();
690 void ScBahtText();
691 void ScBitAnd();
692 void ScBitOr();
693 void ScBitXor();
694 void ScBitRshift();
695 void ScBitLshift();
696 void ScTTT();
697 void ScDebugVar();
698
709 double GetDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, bool bStrict );
710
711 void ScGetActDate();
712 void ScGetActTime();
713 void ScGetYear();
714 void ScGetMonth();
715 void ScGetDay();
716 void ScGetDayOfWeek();
717 void ScGetWeekOfYear();
718 void ScGetIsoWeekOfYear();
719 void ScWeeknumOOo();
720 void ScEasterSunday();
721 FormulaError GetWeekendAndHolidayMasks( const sal_uInt8 nParamCount, const sal_uInt32 nNullDate,
722 ::std::vector<double>& rSortArray, bool bWeekendMask[ 7 ] );
723 FormulaError GetWeekendAndHolidayMasks_MS( const sal_uInt8 nParamCount, const sal_uInt32 nNullDate,
724 ::std::vector<double>& rSortArray, bool bWeekendMask[ 7 ], bool bWorkdayFunction );
725 static inline sal_Int16 GetDayOfWeek( sal_Int32 n );
726 void ScNetWorkdays( bool bOOXML_Version );
727 void ScWorkday_MS();
728 void ScGetHour();
729 void ScGetMin();
730 void ScGetSec();
731 void ScPlusMinus();
732 void ScAbs();
733 void ScInt();
734 void ScEven();
735 void ScOdd();
736 void ScCeil( bool bODFF );
737 void ScCeil_MS();
738 void ScCeil_Precise();
739 void ScFloor( bool bODFF );
740 void ScFloor_MS();
741 void ScFloor_Precise();
742 void RoundNumber( rtl_math_RoundingMode eMode );
743 void ScRound();
744 void ScRoundUp();
745 void ScRoundDown();
746 void ScGetDateValue();
747 void ScGetTimeValue();
748 void ScArcTan2();
749 void ScLog();
750 void ScGetDate();
751 void ScGetTime();
752 void ScGetDiffDate();
753 void ScGetDiffDate360();
754 void ScGetDateDif();
755 void ScPower();
756 void ScAmpersand();
757 void ScAdd();
758 void ScSub();
759 void ScMul();
760 void ScDiv();
761 void ScPow();
762 void ScCurrent();
763 void ScStyle();
764 void ScDde();
765 void ScBase();
766 void ScDecimal();
767 void ScConvertOOo();
768 void ScEuroConvert();
769 void ScRoundSignificant();
770 static void RoundSignificant( double fX, double fDigits, double &fRes );
771
772 // financial functions
773 void ScNPV();
774 void ScIRR();
775 void ScMIRR();
776 void ScISPMT();
777
778 static double ScGetPV(double fRate, double fNper, double fPmt,
779 double fFv, bool bPayInAdvance);
780 void ScPV();
781 void ScSYD();
782 static double ScGetDDB(double fCost, double fSalvage, double fLife,
783 double fPeriod, double fFactor);
784 void ScDDB();
785 void ScDB();
786 static double ScInterVDB(double fCost, double fSalvage, double fLife, double fLife1,
787 double fPeriod, double fFactor);
788 void ScVDB();
789 void ScPDuration();
790 void ScSLN();
791 static double ScGetPMT(double fRate, double fNper, double fPv,
792 double fFv, bool bPayInAdvance);
793 void ScPMT();
794 void ScRRI();
795 static double ScGetFV(double fRate, double fNper, double fPmt,
796 double fPv, bool bPayInAdvance);
797 void ScFV();
798 void ScNper();
799 static bool RateIteration(double fNper, double fPayment, double fPv,
800 double fFv, bool bPayType, double& fGuess);
801 void ScRate();
802 double ScGetIpmt(double fRate, double fPer, double fNper, double fPv,
803 double fFv, bool bPayInAdvance, double& fPmt);
804 void ScIpmt();
805 void ScPpmt();
806 void ScCumIpmt();
807 void ScCumPrinc();
808 void ScEffect();
809 void ScNominal();
810 void ScMod();
811 void ScIntercept();
812 void ScGCD();
813 void ScLCM();
814
815 // matrix functions
816 void ScMatValue();
817 static void MEMat(const ScMatrixRef& mM, SCSIZE n);
818 void ScMatDet();
819 void ScMatInv();
820 void ScMatMult();
821 void ScMatTrans();
822 void ScEMat();
823 void ScMatRef();
824 ScMatrixRef MatConcat(const ScMatrixRef& pMat1, const ScMatrixRef& pMat2);
825 void ScSumProduct();
826 void ScSumX2MY2();
827 void ScSumX2DY2();
828 void ScSumXMY2();
829 void ScGrowth();
830 bool CalculateSkew(KahanSum& fSum, double& fCount, std::vector<double>& values);
831 void CalculateSkewOrSkewp( bool bSkewp );
832 void CalculateSlopeIntercept(bool bSlope);
833 void CalculateSmallLarge(bool bSmall);
834 void CalculatePearsonCovar( bool _bPearson, bool _bStexy, bool _bSample ); //fdo#70000 argument _bSample is ignored if _bPearson == true
835 bool CalculateTest( bool _bTemplin
836 ,const SCSIZE nC1, const SCSIZE nC2,const SCSIZE nR1,const SCSIZE nR2
837 ,const ScMatrixRef& pMat1,const ScMatrixRef& pMat2
838 ,double& fT,double& fF);
839 void CalculateLookup(bool bHLookup);
840 bool FillEntry(ScQueryEntry& rEntry);
841 void CalculateAddSub(bool _bSub);
842 void CalculateTrendGrowth(bool _bGrowth);
843 void CalculateRGPRKP(bool _bRKP);
844 void CalculateSumX2MY2SumX2DY2(bool _bSumX2DY2);
845 void CalculateMatrixValue(const ScMatrix* pMat,SCSIZE nC,SCSIZE nR);
846 bool CheckMatrix(bool _bLOG,sal_uInt8& nCase,SCSIZE& nCX,SCSIZE& nCY,SCSIZE& nRX,SCSIZE& nRY,SCSIZE& M,SCSIZE& N,ScMatrixRef& pMatX,ScMatrixRef& pMatY);
847 void ScLinest();
848 void ScLogest();
849 void ScForecast();
850 void ScForecast_Ets( ScETSType eETSType );
851 void ScFourier();
852 void ScNoName();
853 void ScBadName();
854 // Statistics:
855 static double taylor(const double* pPolynom, sal_uInt16 nMax, double x);
856 static double gauss(double x);
857
858public:
859 static double phi(double x);
860 static double integralPhi(double x);
861 static double gaussinv(double x);
862 static double GetPercentile( ::std::vector<double> & rArray, double fPercentile );
863
864
865private:
866 double GetBetaDist(double x, double alpha, double beta); //cumulative distribution function
867 double GetBetaDistPDF(double fX, double fA, double fB); //probability density function)
868 double GetChiDist(double fChi, double fDF); // for LEGACY.CHIDIST, returns right tail
869 double GetChiSqDistCDF(double fX, double fDF); // for CHISQDIST, returns left tail
870 static double GetChiSqDistPDF(double fX, double fDF); // probability density function
871 double GetFDist(double x, double fF1, double fF2);
872 double GetTDist( double T, double fDF, int nType );
873 double Fakultaet(double x);
874 static double BinomKoeff(double n, double k);
875 double GetGamma(double x);
876 static double GetLogGamma(double x);
877 double GetBeta(double fAlpha, double fBeta);
878 static double GetLogBeta(double fAlpha, double fBeta);
879 double GetBinomDistPMF(double x, double n, double p); //probability mass function
880 double GetHypGeomDist( double x, double n, double M, double N );
881 void ScLogGamma();
882 void ScGamma();
883 void ScPhi();
884 void ScGauss();
885 void ScStdNormDist();
886 void ScStdNormDist_MS();
887 void ScFisher();
888 void ScFisherInv();
889 void ScFact();
890 void ScNormDist( int nMinParamCount );
891 void ScGammaDist( bool bODFF );
892 void ScGammaInv();
893 void ScExpDist();
894 void ScBinomDist();
895 void ScPoissonDist( bool bODFF );
896 void ScCombin();
897 void ScCombinA();
898 void ScPermut();
899 void ScPermutationA();
900 void ScB();
901 void ScHypGeomDist( int nMinParamCount );
902 void ScLogNormDist( int nMinParamCount );
903 void ScLogNormInv();
904 void ScTDist();
905 void ScTDist_MS();
906 void ScTDist_T( int nTails );
907 void ScFDist();
908 void ScFDist_LT();
909 void ScChiDist( bool bODFF); // for LEGACY.CHIDIST, returns right tail
910 void ScChiSqDist(); // returns left tail or density
911 void ScChiSqDist_MS();
912 void ScChiSqInv(); // inverse to CHISQDIST
913 void ScWeibull();
914 void ScBetaDist();
915 void ScBetaDist_MS();
916 void ScFInv();
917 void ScFInv_LT();
918 void ScTInv( int nType );
919 void ScChiInv();
920 void ScBetaInv();
921 void ScCritBinom();
922 void ScNegBinomDist();
923 void ScNegBinomDist_MS();
924 void ScKurt();
925 void ScHarMean();
926 void ScGeoMean();
927 void ScStandard();
928 void ScSkew();
929 void ScSkewp();
930 void ScMedian();
931 double GetMedian( ::std::vector<double> & rArray );
932 double GetPercentileExclusive( ::std::vector<double> & rArray, double fPercentile );
933 std::vector<double> GetRankNumberArray( SCSIZE& rCol, SCSIZE& rRow );
934 void GetNumberSequenceArray( sal_uInt8 nParamCount, ::std::vector<double>& rArray, bool bConvertTextInArray );
935 void GetSortArray( sal_uInt8 nParamCount, ::std::vector<double>& rSortArray, ::std::vector<tools::Long>* pIndexOrder, bool bConvertTextInArray, bool bAllowEmptyArray );
936 static void QuickSort(::std::vector<double>& rSortArray, ::std::vector<tools::Long>* pIndexOrder);
937 void ScModalValue();
938 void ScModalValue_MS( bool bSingle );
939 void ScAveDev();
940 void ScAggregate();
941 void ScDevSq();
942 void ScZTest();
943 void ScTTest();
944 void ScFTest();
945 void ScChiTest();
946 void ScRank( bool bAverage );
947 void ScPercentile( bool bInclusive );
948 void ScPercentrank( bool bInclusive );
949 static double GetPercentrank( ::std::vector<double> & rArray, double fVal, bool bInclusive );
950 void ScLarge();
951 void ScSmall();
952 void ScFrequency();
953 void ScQuartile( bool bInclusive );
954 void ScNormInv();
955 void ScSNormInv();
956 void ScConfidence();
957 void ScConfidenceT();
958 void ScTrimMean();
959 void ScProbability();
960 void ScCorrel();
961 void ScCovarianceP();
962 void ScCovarianceS();
963 void ScPearson();
964 void ScRSQ();
965 void ScSTEYX();
966 void ScSlope();
967 void ScTrend();
968 void ScInfo();
969 void ScLenB();
970 void ScRightB();
971 void ScLeftB();
972 void ScMidB();
973 void ScReplaceB();
974 void ScFindB();
975 void ScSearchB();
976
977 void ScFilterXML();
978 void ScWebservice();
979 void ScEncodeURL();
980 void ScColor();
981 void ScErf();
982 void ScErfc();
983
984 static const double fMaxGammaArgument;
985
986 double GetGammaContFraction(double fA,double fX);
987 double GetGammaSeries(double fA,double fX);
988 double GetLowRegIGamma(double fA,double fX); // lower regularized incomplete gamma function, GAMMAQ
989 double GetUpRegIGamma(double fA,double fX); // upper regularized incomplete gamma function, GAMMAP
990 // probability density function; fLambda is "scale" parameter
991 double GetGammaDistPDF(double fX, double fAlpha, double fLambda);
992 // cumulative distribution function; fLambda is "scale" parameter
993 double GetGammaDist(double fX, double fAlpha, double fLambda);
994 double GetTInv( double fAlpha, double fSize, int nType );
995
996public:
998 const ScAddress&, ScTokenArray&, bool bForGroupThreading = false );
1000
1001 // Used only for threaded formula-groups.
1002 // Resets the interpreter object, allowing reuse of interpreter object for each cell
1003 // in the group.
1004 void Init( ScFormulaCell* pCell, const ScAddress& rPos, ScTokenArray& rTokArray );
1005
1007
1009 { if (nError != FormulaError::NONE && nGlobalError == FormulaError::NONE) nGlobalError = nError; }
1010 void AssertFormulaMatrix();
1011
1013 { mpLinkManager = pLinkMgr; }
1014
1016 formula::StackVar GetResultType() const { return xResult->GetType(); }
1017 const svl::SharedString & GetStringResult() const;
1018 double GetNumResult() const { return xResult->GetDouble(); }
1022};
1023
1025{
1026 return bMatrixFormula || pCur->IsInForceArray();
1027}
1028
1030{
1031 if (IsInArrayContext())
1033}
1034
1036{
1038 !pJumpMatrix && sp > 0 )
1039 return ConvertMatrixParameters();
1040 return false;
1041}
1042
1044{
1045 return maTokenMatrixMap;
1046}
1047
1048inline bool ScInterpreter::MustHaveParamCount( short nAct, short nMust )
1049{
1050 if ( nAct == nMust )
1051 return true;
1052 if ( nAct < nMust )
1054 else
1056 return false;
1057}
1058
1059inline bool ScInterpreter::MustHaveParamCount( short nAct, short nMust, short nMax )
1060{
1061 if ( nMust <= nAct && nAct <= nMax )
1062 return true;
1063 if ( nAct < nMust )
1065 else
1067 return false;
1068}
1069
1070inline bool ScInterpreter::MustHaveParamCountMin( short nAct, short nMin )
1071{
1072 if ( nAct >= nMin )
1073 return true;
1075 return false;
1076}
1077
1078inline bool ScInterpreter::MustHaveParamCountMinWithStackCheck( short nAct, short nMin )
1079{
1080 assert(sp >= nAct);
1081 if (sp < nAct)
1082 {
1083 PushError(FormulaError::UnknownStackVariable);
1084 return false;
1085 }
1086 return MustHaveParamCountMin( nAct, nMin);
1087}
1088
1090{
1091 if (!std::isfinite( fVal))
1092 {
1093 fVal = -1.0;
1094 return false;
1095 }
1096 else if (fVal < 0.0)
1097 {
1098 fVal = 0.0;
1099 return false;
1100 }
1101 else if (fVal > SAL_MAX_INT32)
1102 {
1103 fVal = static_cast<double>(SAL_MAX_INT32);
1104 return false;
1105 }
1106 return true;
1107}
1108
1110{
1111 double fVal = rtl::math::approxFloor( GetDouble());
1112 if (!CheckStringPositionArgument( fVal))
1113 {
1114 fVal = -1.0;
1115 SetError( FormulaError::IllegalArgument);
1116 }
1117 return static_cast<sal_Int32>(fVal);
1118}
1119
1120inline bool ScInterpreter::CheckStringResultLen( OUString& rResult, sal_Int32 nIncrease )
1121{
1122 if (nIncrease > kScInterpreterMaxStrLen - rResult.getLength())
1123 {
1124 SetError( FormulaError::StringOverflow );
1125 rResult.clear();
1126 return false;
1127 }
1128 return true;
1129}
1130
1131inline bool ScInterpreter::CheckStringResultLen( OUStringBuffer& rResult, sal_Int32 nIncrease )
1132{
1133 if (nIncrease > kScInterpreterMaxStrLen - rResult.getLength())
1134 {
1135 SetError( FormulaError::StringOverflow );
1136 rResult.setLength(0);
1137 return false;
1138 }
1139 return true;
1140}
1141
1142inline void ScInterpreter::TreatDoubleError( double& rVal )
1143{
1144 if ( !std::isfinite( rVal ) )
1145 {
1146 FormulaError nErr = GetDoubleErrorValue( rVal );
1147 if ( nErr != FormulaError::NONE )
1148 SetError( nErr );
1149 else
1150 SetError( FormulaError::NoValue );
1151 rVal = 0.0;
1152 }
1153}
1154
1155inline double ScInterpreter::div( const double& fNumerator, const double& fDenominator )
1156{
1157 return sc::div(fNumerator, fDenominator);
1158}
1159
1160inline sal_Int16 ScInterpreter::GetDayOfWeek( sal_Int32 n )
1161{ // monday = 0, ..., sunday = 6
1162 return static_cast< sal_Int16 >( ( n - 1 ) % 7 );
1163}
1164
1165/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
Definition: address.hxx:44
This class provides LO with Kahan summation algorithm About this algorithm: https://en....
Definition: kahan.hxx:26
double get() const
Returns the final sum.
Definition: kahan.hxx:211
Base class for abstracting range data backends for database functions.
Definition: doubleref.hxx:38
::formula::FormulaTokenRef TokenRef
std::shared_ptr< ScTokenArray > TokenArrayRef
formula::FormulaConstTokenRef PopToken()
Definition: interpr4.cxx:766
static void SetGlobalConfig(const ScCalcConfig &rConfig)
Definition: interpr4.cxx:3897
void ScDevSq()
Definition: interpr3.cxx:4462
void ScSumX2MY2()
Definition: interpr5.cxx:1732
void ScNormDist(int nMinParamCount)
Definition: interpr3.cxx:1546
sal_uInt32 nCurFmtIndex
Definition: interpre.hxx:202
void ScStDev(bool bTextAsZero=false)
Definition: interpr1.cxx:4242
sal_uLong GetRetFormatIndex() const
Definition: interpre.hxx:1021
void ScSubstitute()
Definition: interpr1.cxx:9931
void ScSumXMY2()
Definition: interpr5.cxx:1782
void SetError(FormulaError nError)
Definition: interpre.hxx:1008
void ScProduct()
Definition: interpr6.cxx:963
void ScAveDev()
Definition: interpr3.cxx:4304
void ScMatDet()
Definition: interpr5.cxx:905
void ScTableOp()
Definition: interpr4.cxx:3598
bool bMatrixFormula
Definition: interpre.hxx:211
void ScIsOdd()
Definition: interpr1.cxx:3181
double GetBetaDistPDF(double fX, double fA, double fB)
Definition: interpr3.cxx:862
double GetBinomDistPMF(double x, double n, double p)
Definition: interpr3.cxx:1232
double ConvertStringToValue(const OUString &)
Definition: interpr4.cxx:163
void ScLarge()
Definition: interpr3.cxx:3724
ScCalcConfig maCalcConfig
Definition: interpre.hxx:181
bool CalculateSkew(KahanSum &fSum, double &fCount, std::vector< double > &values)
Definition: interpr3.cxx:3211
formula::FormulaToken * CreateDoubleOrTypedToken(double fVal)
Definition: interpr4.cxx:1791
double GetDateSerial(sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, bool bStrict)
Obtain the date serial number for a given date.
Definition: interpr2.cxx:61
void ScFisherInv()
Definition: interpr3.cxx:1159
void ScCosecant()
Definition: interpr1.cxx:1945
void CalculateLookup(bool bHLookup)
Definition: interpr1.cxx:7385
svl::SharedString GetString()
Definition: interpr4.cxx:2334
static double ScGetPV(double fRate, double fNper, double fPmt, double fFv, bool bPayInAdvance)
Definition: interpr2.cxx:1661
void ScLookup()
Definition: interpr1.cxx:6721
static double gauss(double x)
Definition: interpr3.cxx:215
void ScGetDiffDate()
Definition: interpr2.cxx:662
void ScLogGamma()
Definition: interpr3.cxx:791
void ScRoman()
Definition: interpr2.cxx:3041
void ScExpDist()
Definition: interpr3.cxx:1615
void ScGetIsoWeekOfYear()
Definition: interpr2.cxx:294
void ScForecast()
Definition: interpr3.cxx:4747
bool IsInArrayContext() const
Definition: interpre.hxx:1024
void ScTanHyp()
Definition: interpr1.cxx:1903
void ScIsEven()
Definition: interpr1.cxx:3176
static bool RateIteration(double fNper, double fPayment, double fPv, double fFv, bool bPayType, double &fGuess)
Definition: interpr2.cxx:2037
void ScDBCount()
Definition: interpr1.cxx:8067
bool ConvertMatrixParameters()
Definition: interpr4.cxx:1457
void ScFloor_Precise()
Definition: interpr2.cxx:1237
static ScCalcConfig * mpGlobalConfig
Definition: interpre.hxx:176
void ScArcSin()
Definition: interpr1.cxx:1873
void ScGetPivotData()
Definition: interpr2.cxx:3550
void ScIsErr()
Definition: interpr1.cxx:2960
void ScLCM()
Definition: interpr5.cxx:189
void ScIsFormula()
Definition: interpr1.cxx:2756
void ScISPMT()
Definition: interpr2.cxx:1644
void ScColRowNameAuto()
Definition: interpr4.cxx:3705
FormulaError GetWeekendAndHolidayMasks(const sal_uInt8 nParamCount, const sal_uInt32 nNullDate, ::std::vector< double > &rSortArray, bool bWeekendMask[7])
Definition: interpr2.cxx:344
void ScSheets()
Definition: interpr1.cxx:4397
void ScGetDateDif()
Definition: interpr2.cxx:763
void ScCritBinom()
Definition: interpr3.cxx:1410
void ScPlusMinus()
Definition: interpr2.cxx:934
static bool CheckStringPositionArgument(double &fVal)
Check if a double is suitable as string position or length argument.
Definition: interpre.hxx:1089
void ScChiSqInv()
Definition: interpr3.cxx:2403
void ScSearch()
Definition: interpr1.cxx:9583
bool CheckMatrix(bool _bLOG, sal_uInt8 &nCase, SCSIZE &nCX, SCSIZE &nCY, SCSIZE &nRX, SCSIZE &nRY, SCSIZE &M, SCSIZE &N, ScMatrixRef &pMatX, ScMatrixRef &pMatY)
Definition: interpr5.cxx:2225
void ScMaxIfs_MS()
Definition: interpr1.cxx:6704
void ScNoName()
Definition: interpr3.cxx:180
bool IsString()
Definition: interpr1.cxx:2033
void ScSum()
Definition: interpr6.cxx:958
double GetChiDist(double fChi, double fDF)
You must ensure fDF>0.0.
Definition: interpr3.cxx:669
void ScExternal()
Definition: interpr4.cxx:2541
bool MustHaveParamCount(short nAct, short nMust)
Definition: interpre.hxx:1048
void ScErfc()
Definition: interpr7.cxx:505
void ScGamma()
Definition: interpr3.cxx:774
formula::FormulaTokenIterator aCode
Definition: interpre.hxx:182
formula::FormulaToken * CreateFormulaDoubleToken(double fVal, SvNumFormatType nFmt=SvNumFormatType::NUMBER)
Definition: interpr4.cxx:1766
void ScStdNormDist_MS()
Definition: interpr3.cxx:1601
ScMatrixRef PopMatrix()
Definition: interpr4.cxx:1642
void ScGetHour()
Definition: interpr2.cxx:161
void ScDBStdDev()
Definition: interpr1.cxx:8216
void DoubleRefToVars(const formula::FormulaToken *p, SCCOL &rCol1, SCROW &rRow1, SCTAB &rTab1, SCCOL &rCol2, SCROW &rRow2, SCTAB &rTab2)
Definition: interpr4.cxx:944
void ScHLookup()
Definition: interpr1.cxx:7380
void ScIntercept()
Definition: interpr3.cxx:4742
void PopExternalSingleRef(sal_uInt16 &rFileId, OUString &rTabName, ScSingleRefData &rRef)
Definition: interpr4.cxx:1141
bool MustHaveParamCountMin(short nAct, short nMin)
Definition: interpre.hxx:1070
sal_Int32 GetStringPositionArgument()
Obtain a sal_Int32 suitable as string position or length argument.
Definition: interpre.hxx:1109
ScAddress aPos
Definition: interpre.hxx:183
ScDocument & mrDoc
Definition: interpre.hxx:186
bool FillEntry(ScQueryEntry &rEntry)
Definition: interpr1.cxx:7650
static FormulaError GetCellErrCode(const ScRefCellValue &rCell)
Definition: interpr4.cxx:158
void ScErrorType_ODF()
Definition: interpr1.cxx:10107
void PushExternalDoubleRef(sal_uInt16 nFileId, const OUString &rTabName, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2)
Definition: interpr4.cxx:1869
SubtotalFlags mnSubTotalFlags
Definition: interpre.hxx:208
static const double fMaxGammaArgument
Definition: interpre.hxx:984
void ScPermutationA()
Definition: interpr3.cxx:1219
bool GetBool()
Definition: interpre.hxx:434
void ScDBMin()
Definition: interpr1.cxx:8165
void AssertFormulaMatrix()
Definition: interpr4.cxx:4809
ScDBRangeBase * PopDBDoubleRef()
Definition: interpr4.cxx:962
void ScColor()
Definition: interpr7.cxx:512
void ScDBAverage()
Definition: interpr1.cxx:8155
void CurFmtToFuncFmt()
Definition: interpre.hxx:454
void CalculateSkewOrSkewp(bool bSkewp)
Definition: interpr3.cxx:3316
void PushIllegalParameter()
Definition: interpr4.cxx:1938
void ScIsValue()
Definition: interpr1.cxx:2685
void ScRandom()
Definition: interpr1.cxx:1800
void ScArcCotHyp()
Definition: interpr1.cxx:1936
void ScIfs_MS()
Definition: interpr8.cxx:1830
bool JumpMatrix(short nStackLevel)
Definition: interpr1.cxx:545
sc::RangeMatrix CompareMat(ScQueryOp eOp, sc::CompareOptions *pOptions=nullptr)
Definition: interpr1.cxx:982
bool GetDoubleOrString(double &rValue, svl::SharedString &rString)
returns TRUE if double (or error, check nGlobalError), else FALSE
Definition: interpr4.cxx:2274
void ScCotHyp()
Definition: interpr1.cxx:1908
static ScCalcConfig & GetOrCreateGlobalConfig()
Definition: interpr4.cxx:3890
FormulaError nGlobalError
Definition: interpre.hxx:198
void PushIllegalArgument()
Definition: interpr4.cxx:1943
sal_Int16 GetInt16()
if GetDouble() not within int16 limits sets nGlobalError and returns SAL_MAX_INT16
Definition: interpr4.cxx:2229
void ScWebservice()
Definition: interpr7.cxx:274
void ScInt()
Definition: interpr2.cxx:950
bool CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8 *pCellArr)
Definition: interpr4.cxx:280
static thread_local bool bGlobalStackInUse
Definition: interpre.hxx:179
double GetGamma(double x)
You must ensure non integer arguments for fZ<1.
Definition: interpr3.cxx:585
void ScLogNormDist(int nMinParamCount)
Definition: interpr3.cxx:1566
formula::StackVar Interpret()
Definition: interpr4.cxx:3972
void ScRoundDown()
Definition: interpr2.cxx:1028
void ScMatch()
Definition: interpr1.cxx:4857
void ScLessEqual()
Definition: interpr1.cxx:1234
void ScTDist_T(int nTails)
Definition: interpr3.cxx:1656
void ScNumberValue()
Definition: interpr1.cxx:3414
static double taylor(const double *pPolynom, sal_uInt16 nMax, double x)
Definition: interpr3.cxx:205
void ScCount2()
Definition: interpr6.cxx:978
void ScSubTotal()
Definition: interpr1.cxx:7714
void DoubleRefToRange(const ScComplexRefData &, ScRange &, bool bDontCheckForTableOp=false)
Definition: interpr4.cxx:1026
void ScSearchB()
Definition: interpr1.cxx:9502
void ScCosHyp()
Definition: interpr1.cxx:1898
void ScMax(bool bTextAsZero=false)
Definition: interpr1.cxx:3842
void ScCeil_Precise()
Definition: interpr2.cxx:1146
void PushDoubleRef(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2)
Definition: interpr4.cxx:1846
void Push(const formula::FormulaToken &r)
Does substitute with formula::FormulaErrorToken in case nGlobalError is set and the token passed is n...
Definition: interpr4.cxx:600
void ScCountIf()
Definition: interpr1.cxx:5702
void ScLogNormInv()
Definition: interpr3.cxx:2143
void ScErf()
Definition: interpr7.cxx:498
static void RoundSignificant(double fX, double fDigits, double &fRes)
Definition: interpr2.cxx:1038
void PushExternalSingleRef(sal_uInt16 nFileId, const OUString &rTabName, SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: interpr4.cxx:1857
void CalculateMatrixValue(const ScMatrix *pMat, SCSIZE nC, SCSIZE nR)
Definition: interpr5.cxx:693
sal_uInt8 cPar
Definition: interpre.hxx:209
void ScGetDiffDate360()
Definition: interpr2.cxx:672
void ScIsRef()
Definition: interpr1.cxx:2633
formula::StackVar GetResultType() const
Definition: interpre.hxx:1016
void ReplaceCell(ScAddress &)
Definition: interpr4.cxx:88
const svl::SharedString & GetStringResult() const
Definition: interpr4.cxx:4814
void CalculateRGPRKP(bool _bRKP)
Definition: interpr5.cxx:2342
void ScGetActDate()
Definition: interpr2.cxx:101
bool SwitchToArrayRefList(ScMatrixRef &xResMat, SCSIZE nMatRows, double fCurrent, const std::function< void(SCSIZE i, double fCurrent)> &MatOpFunc, bool bDoMatOp)
Switch to array reference list if current TOS is one and create/init or update matrix and return true...
Definition: interpr1.cxx:3659
void ScModalValue()
Definition: interpr3.cxx:3505
void ScRank(bool bAverage)
Definition: interpr3.cxx:4237
formula::StackVar GetRawStackType()
Raw stack type without default replacements.
Definition: interpr4.cxx:1963
svl::SharedString GetStringFromDouble(const double fVal)
Definition: interpr4.cxx:2496
const formula::FormulaToken * pCur
Definition: interpre.hxx:195
ScInterpreterContext & mrContext
Definition: interpre.hxx:185
double ScGetIpmt(double fRate, double fPer, double fNper, double fPv, double fFv, bool bPayInAdvance, double &fPmt)
Definition: interpr2.cxx:2192
void ScEncodeURL()
Returns a string in which all non-alphanumeric characters except stroke and underscore (-_) have been...
Definition: interpr7.cxx:415
void ScRound()
Definition: interpr2.cxx:1023
void ScGetDate()
Definition: interpr2.cxx:629
SvNumFormatType nFuncFmtType
Definition: interpre.hxx:204
void ScGrowth()
Definition: interpr5.cxx:2861
void CalculateSmallLarge(bool bSmall)
Definition: interpr3.cxx:3635
void ScSNormInv()
Definition: interpr3.cxx:2132
void ScNegBinomDist()
Definition: interpr3.cxx:1500
bool DoubleRefToPosSingleRef(const ScRange &rRange, ScAddress &rAdr)
Definition: interpr4.cxx:2017
void ScLog10()
Definition: interpr2.cxx:1311
void ScProbability()
Definition: interpr3.cxx:4471
void ScIsEmpty()
Definition: interpr1.cxx:1979
void ScMatValue()
Definition: interpr5.cxx:615
sal_uInt32 GetUInt32()
if GetDouble() not within uint32 limits sets nGlobalError and returns SAL_MAX_UINT32
Definition: interpr4.cxx:2258
std::unique_ptr< ScDBQueryParamBase > GetDBParams(bool &rMissingField)
Definition: interpr1.cxx:7857
void ScEasterSunday()
Definition: interpr2.cxx:304
void ScDBSum()
Definition: interpr1.cxx:8062
void ScGetWeekOfYear()
Definition: interpr2.cxx:248
void ScReplaceB()
Definition: interpr1.cxx:9445
double GetValueCellValue(const ScAddress &, double fOrig)
Only ValueCell, formula cells already store the result rounded.
Definition: interpr4.cxx:148
void ScPower()
Definition: interpr5.cxx:1611
bool IsTableOpInRange(const ScRange &)
Definition: interpr4.cxx:107
static double integralPhi(double x)
Definition: interpr3.cxx:200
void ScDBProduct()
Definition: interpr1.cxx:8170
void ScGammaInv()
Definition: interpr3.cxx:2172
sal_uInt32 nRetFmtIndex
Definition: interpre.hxx:203
size_t GetRefListArrayMaxSize(short nParamCount)
Check for array of references to determine the maximum size of a return column vector if in array con...
Definition: interpr6.cxx:421
const svl::SharedString & PopString()
Definition: interpr4.cxx:813
const ScComplexRefData * GetStackDoubleRef(size_t rRefInList=0)
Definition: interpr4.cxx:1118
void GetCellString(svl::SharedString &rStr, ScRefCellValue &rCell)
Definition: interpr4.cxx:245
void ScCumPrinc()
Definition: interpr2.cxx:2294
void ScHarMean()
Definition: interpr3.cxx:2903
void ScBetaDist_MS()
Microsoft version has parameters in different order Also, upper and lowerbound are optional and have ...
Definition: interpr3.cxx:1100
void ScBitOr()
Definition: interpr1.cxx:1658
bool PopDoubleRefOrSingleRef(ScAddress &rAdr)
Definition: interpr4.cxx:1342
void ScTrend()
Definition: interpr5.cxx:2856
bool CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8 *pCellArr)
Definition: interpr4.cxx:363
void ScTextJoin_MS()
Definition: interpr8.cxx:1507
void ValidateRef(const ScSingleRefData &rRef)
Definition: interpr4.cxx:841
void ScGreaterEqual()
Definition: interpr1.cxx:1251
void ScWeibull()
Definition: interpr3.cxx:1763
VolatileType meVolatileType
Definition: interpre.hxx:213
void ScSmall()
Definition: interpr3.cxx:3729
void GetExternalDoubleRef(sal_uInt16 nFileId, const OUString &rTabName, const ScComplexRefData &aData, ScExternalRefCache::TokenArrayRef &rArray)
Definition: interpr4.cxx:1284
double GetCellValueOrZero(const ScAddress &, ScRefCellValue &rCell)
Definition: interpr4.cxx:188
void PushError(FormulaError nError)
Definition: interpr4.cxx:1927
void PopRefListPushMatrixOrRef()
Definition: interpr4.cxx:1378
sal_uInt8 GetByte() const
Definition: interpre.hxx:416
ScMatrixRef QueryMat(const ScMatrixRef &pMat, sc::CompareOptions &rOptions)
Definition: interpr1.cxx:1144
void ScGetActTime()
Definition: interpr2.cxx:109
double GetDoubleFromMatrix(const ScMatrixRef &pMat)
Definition: interpr4.cxx:2056
const formula::FormulaConstTokenRef & GetResultToken() const
Definition: interpre.hxx:1019
FormulaError GetWeekendAndHolidayMasks_MS(const sal_uInt8 nParamCount, const sal_uInt32 nNullDate, ::std::vector< double > &rSortArray, bool bWeekendMask[7], bool bWorkdayFunction)
Definition: interpr2.cxx:384
static const ScCalcConfig & GetGlobalConfig()
Definition: interpr4.cxx:3902
sal_Int32 GetInt32WithDefault(sal_Int32 nDefault)
if GetDoubleWithDefault() not within int32 limits sets nGlobalError and returns SAL_MAX_INT32
Definition: interpr4.cxx:2220
void ScGCD()
Definition: interpr5.cxx:115
void ScPercentSign()
Definition: interpr1.cxx:1599
void PushWithoutError(const formula::FormulaToken &r)
Does not substitute with formula::FormulaErrorToken in case nGlobalError is set.
Definition: interpr4.cxx:584
void ScUnionFunc()
Definition: interpr2.cxx:2557
void ScForecast_Ets(ScETSType eETSType)
Definition: interpr8.cxx:1175
void CalculatePearsonCovar(bool _bPearson, bool _bStexy, bool _bSample)
Definition: interpr3.cxx:4553
void ScEffect()
Definition: interpr2.cxx:2333
bool CheckStringResultLen(OUString &rResult, sal_Int32 nIncrease)
Definition: interpre.hxx:1120
void Init(ScFormulaCell *pCell, const ScAddress &rPos, ScTokenArray &rTokArray)
Definition: interpr4.cxx:3866
void ScMultiArea()
Definition: interpr1.cxx:8998
double GetBeta(double fAlpha, double fBeta)
Definition: interpr3.cxx:800
std::vector< double > GetRankNumberArray(SCSIZE &rCol, SCSIZE &rRow)
Definition: interpr3.cxx:3858
void ScModalValue_MS(bool bSingle)
Definition: interpr3.cxx:3549
void ScWeeknumOOo()
Definition: interpr2.cxx:236
ScMatrixRef GetNewMat(SCSIZE nC, SCSIZE nR, bool bEmpty=false)
Definition: interpr5.cxx:284
void ScCovarianceS()
Definition: interpr3.cxx:4543
void ScMedian()
Definition: interpr3.cxx:3390
void PopDoubleRefPushMatrix()
Definition: interpr4.cxx:1364
bool MustHaveParamCountMinWithStackCheck(short nAct, short nMin)
Definition: interpre.hxx:1078
static double ScGetPMT(double fRate, double fNper, double fPv, double fFv, bool bPayInAdvance)
Definition: interpr2.cxx:1936
static void MEMat(const ScMatrixRef &mM, SCSIZE n)
Definition: interpr5.cxx:739
ScMatValType GetDoubleOrStringFromMatrix(double &rDouble, svl::SharedString &rString)
Definition: interpr4.cxx:2435
double GetTInv(double fAlpha, double fSize, int nType)
Definition: interpr3.cxx:2288
double GetDouble()
Definition: interpr4.cxx:2097
void ScCountIfs()
Definition: interpr1.cxx:6669
bool LookupQueryWithCache(ScAddress &o_rResultPos, const ScQueryParam &rParam, const ScComplexRefData *refData) const
Definition: interpr1.cxx:10271
void ScTTest()
Definition: interpr3.cxx:2647
void PushCellResultToken(bool bDisplayEmptyAsString, const ScAddress &rAddress, SvNumFormatType *pRetTypeExpr, sal_uInt32 *pRetIndexExpr, bool bFinalResult=false)
Obtain cell result / content from address and push as temp token.
Definition: interpr4.cxx:687
void ScFisher()
Definition: interpr3.cxx:1150
void ScGetTimeValue()
Definition: interpr2.cxx:912
void ScDBGet()
Definition: interpr4.cxx:2506
sal_uInt16 maxsp
Definition: interpre.hxx:200
void ScAverage(bool bTextAsZero=false)
Definition: interpr6.cxx:968
void ScGetMin()
Definition: interpr2.cxx:142
void ScIndirect()
Definition: interpr1.cxx:8250
double GetNumResult() const
Definition: interpre.hxx:1018
static double GetLogBeta(double fAlpha, double fBeta)
Definition: interpr3.cxx:833
void ScSumX2DY2()
Definition: interpr5.cxx:1777
static double ScGetDDB(double fCost, double fSalvage, double fLife, double fPeriod, double fFactor)
Definition: interpr2.cxx:1710
void ScChiTest()
Definition: interpr3.cxx:2780
double GetLowRegIGamma(double fA, double fX)
You must ensure fA>0.0 && fX>0.0)
Definition: interpr6.cxx:119
void ScSecantHyp()
Definition: interpr1.cxx:1960
void ScBinomDist()
Definition: interpr3.cxx:1346
void ScZTest()
Definition: interpr3.cxx:2453
void ScUnicode()
Definition: interpr1.cxx:3630
void ScChiDist(bool bODFF)
Definition: interpr3.cxx:1741
void ScIsString()
Definition: interpr1.cxx:2101
double GetFDist(double x, double fF1, double fF2)
Definition: interpr3.cxx:640
static double GetChiSqDistPDF(double fX, double fDF)
Definition: interpr3.cxx:689
static double BinomKoeff(double n, double k)
Definition: interpr3.cxx:460
double GetGammaDistPDF(double fX, double fAlpha, double fLambda)
Gamma distribution, probability density function.
Definition: interpr6.cxx:144
void ScGetDayOfWeek()
Definition: interpr2.cxx:189
void ScSumIf()
Definition: interpr1.cxx:5692
SvNumFormatType GetRetFormatType() const
Definition: interpre.hxx:1020
void IterateParametersIfs(double(*ResultFunc)(const sc::ParamIfsResult &rRes))
Definition: interpr1.cxx:5911
ScTokenMatrixMap & GetTokenMatrixMap()
Definition: interpre.hxx:1043
void ScVLookup()
Definition: interpr1.cxx:7709
void ConvertMatrixJumpConditionToMatrix()
Definition: interpr4.cxx:1438
double Fakultaet(double x)
Definition: interpr3.cxx:439
void PushDouble(double nVal)
Definition: interpr4.cxx:1801
void IterateParameters(ScIterFunc, bool bTextAsZero=false)
Definition: interpr6.cxx:460
void ScGetDay()
Definition: interpr2.cxx:135
void ScMatInv()
Definition: interpr5.cxx:952
void ScDebugVar()
Definition: interpr7.cxx:452
void ScDBCount2()
Definition: interpr1.cxx:8125
void ScNominal()
Definition: interpr2.cxx:2352
void ScHyperLink()
Definition: interpr2.cxx:3182
void ScQuartile(bool bInclusive)
Definition: interpr3.cxx:3482
void ScLinest()
Definition: interpr5.cxx:2331
void ScFrequency()
Definition: interpr5.cxx:1814
sc::RangeMatrix PopRangeMatrix()
Definition: interpr4.cxx:1674
const formula::FormulaToken ** pStack
Definition: interpre.hxx:197
void ScFTest()
Definition: interpr3.cxx:2730
void ScMatTrans()
Definition: interpr5.cxx:1113
void ScCountEmptyCells()
Definition: interpr1.cxx:5207
void QueryMatrixType(const ScMatrixRef &xMat, SvNumFormatType &rRetTypeExpr, sal_uInt32 &rRetIndexExpr)
Definition: interpr4.cxx:1714
static void GlobalExit()
Definition: interpr4.cxx:3913
void PopSingleRef(ScAddress &)
Definition: interpr4.cxx:907
void ScStyle()
Definition: interpr2.cxx:2642
void ScArcCot()
Definition: interpr1.cxx:1888
double PopDouble()
Definition: interpr4.cxx:781
void ReverseStack(sal_uInt8 nParamCount)
Definition: interpr4.cxx:2009
void ScGreater()
Definition: interpr1.cxx:1217
ScTokenMatrixMap maTokenMatrixMap
Definition: interpre.hxx:191
void MergeCalcConfig()
Merge global and document specific settings.
Definition: interpr4.cxx:3907
ScTokenArray * pArr
Definition: interpre.hxx:184
void ScDBMax()
Definition: interpr1.cxx:8160
void ScRawSubtract()
The purpose of RAWSUBTRACT() is exactly to not apply any error correction, approximation etc.
Definition: interpr6.cxx:988
bool SetSbxVariable(SbxVariable *pVar, const ScAddress &)
void ScSumSQ()
Definition: interpr6.cxx:953
SvNumberFormatter * pFormatter
Definition: interpre.hxx:193
void ScBitLshift()
Definition: interpr1.cxx:1688
FormulaError mnStringNoValueError
Definition: interpre.hxx:207
void ScNormInv()
Definition: interpr3.cxx:2116
void ScDecimal()
Definition: interpr2.cxx:2962
double Compare(ScQueryOp eOp)
Definition: interpr1.cxx:885
void ScEMat()
Definition: interpr5.cxx:716
void ScBitAnd()
Definition: interpr1.cxx:1643
void ScTInv(int nType)
Definition: interpr3.cxx:2264
void ScSinHyp()
Definition: interpr1.cxx:1893
static thread_local std::unique_ptr< ScTokenStack > pGlobalStack
Definition: interpre.hxx:178
void ScRangeFunc()
Definition: interpr2.cxx:2537
void ScVar(bool bTextAsZero=false)
Definition: interpr1.cxx:4220
void PushTempTokenWithoutError(const formula::FormulaToken *)
Does not substitute with formula::FormulaErrorToken in case nGlobalError is set.
Definition: interpr4.cxx:647
static double div(const double &fNumerator, const double &fDenominator)
Fail safe division, returning a FormulaError::DivisionByZero coded into a double if denominator is 0....
Definition: interpre.hxx:1155
ScMatrixRef GetMatrix()
Definition: interpr5.cxx:464
static sal_Int16 GetDayOfWeek(sal_Int32 n)
Definition: interpre.hxx:1160
void MatrixJumpConditionToMatrix()
Definition: interpre.hxx:1029
void ScBadName()
Definition: interpr3.cxx:185
void ScIndex()
Definition: interpr1.cxx:8753
void MakeMatNew(ScMatrixRef &rMat, SCSIZE nC, SCSIZE nR)
Definition: interpr5.cxx:269
void ScGetDateValue()
Definition: interpr2.cxx:169
void PushParameterExpected()
Definition: interpr4.cxx:1933
void ScGetYear()
Definition: interpr2.cxx:121
void ScConfidence()
Definition: interpr3.cxx:2423
void ScDBArea()
Definition: interpr4.cxx:3688
double GetHypGeomDist(double x, double n, double M, double N)
Calculates a value of the hypergeometric distribution.
Definition: interpr3.cxx:1895
void TreatDoubleError(double &rVal)
Definition: interpre.hxx:1142
void ScGetTime()
Definition: interpr2.cxx:646
void ScArcCosHyp()
Definition: interpr1.cxx:1918
void CalculateTrendGrowth(bool _bGrowth)
Definition: interpr5.cxx:2866
void GetDBStVarParams(double &rVal, double &rValCount)
Definition: interpr1.cxx:8175
void ScFDist()
Definition: interpr3.cxx:1689
void ScCurrency()
Definition: interpr1.cxx:9047
void ScRightB()
Definition: interpr1.cxx:9355
void ScNegBinomDist_MS()
Definition: interpr3.cxx:1520
double GetChiSqDistCDF(double fX, double fDF)
You must ensure fDF>0.0.
Definition: interpr3.cxx:681
double GetMedian(::std::vector< double > &rArray)
Definition: interpr3.cxx:3366
static double ScInterVDB(double fCost, double fSalvage, double fLife, double fLife1, double fPeriod, double fFactor)
Definition: interpr2.cxx:1788
ScJumpMatrix * pJumpMatrix
Definition: interpre.hxx:190
void CalculateAddSub(bool _bSub)
Definition: interpr5.cxx:1217
void ScBitXor()
Definition: interpr1.cxx:1673
void ScRandomImpl(const std::function< double(double fFirst, double fLast)> &RandomFunc, double fFirst, double fLast)
Definition: interpr1.cxx:1739
bool CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8 *pCellArr)
Definition: interpr4.cxx:461
sfx2::LinkManager * mpLinkManager
Definition: interpre.hxx:187
sal_Int32 double_to_int32(double fVal)
Definition: interpr4.cxx:2187
void ScFormula()
Definition: interpr1.cxx:2825
void ScOffset()
Definition: interpr1.cxx:8591
void ScMatRef()
Definition: interpr5.cxx:3164
void ScMissing()
Definition: interpr4.cxx:3122
void ScDBStdDevP()
Definition: interpr1.cxx:8223
void ScEqual()
Definition: interpr1.cxx:1166
sal_uInt32 nFuncFmtIndex
Definition: interpre.hxx:201
void ScGetSec()
Definition: interpr2.cxx:150
void ScSkewp()
Definition: interpr3.cxx:3361
FormulaError GetError() const
Definition: interpre.hxx:1015
void ScConfidenceT()
Definition: interpr3.cxx:2437
sal_uInt32 GetCellNumberFormat(const ScAddress &rPos, ScRefCellValue &rCell)
Definition: interpr4.cxx:125
void ScWorkday_MS()
Definition: interpr2.cxx:557
void PopDoubleRef(ScRange &rRange, short &rParam, size_t &rRefInList)
If formula::StackVar formula::svDoubleRef pop ScDoubleRefToken and return values of ScComplexRefData.
Definition: interpr4.cxx:1044
void ScIsNonString()
Definition: interpr1.cxx:2106
double GetTDist(double T, double fDF, int nType)
Definition: interpr3.cxx:648
void ScArabic()
Definition: interpr2.cxx:3125
void PushTokenRef(const formula::FormulaConstTokenRef &)
Pushes the token or substitutes with formula::FormulaErrorToken in case nGlobalError is set and the t...
Definition: interpr4.cxx:667
void IterateParametersIf(ScIterFuncIf)
Definition: interpr1.cxx:5287
double GetUpRegIGamma(double fA, double fX)
You must ensure fA>0.0 && fX>0.0)
Definition: interpr6.cxx:130
void ScPercentile(bool bInclusive)
Definition: interpr3.cxx:3459
void ScFalse()
Definition: interpr1.cxx:1837
bool CalculateTest(bool _bTemplin, const SCSIZE nC1, const SCSIZE nC2, const SCSIZE nR1, const SCSIZE nR2, const ScMatrixRef &pMat1, const ScMatrixRef &pMat2, double &fT, double &fF)
Definition: interpr3.cxx:2580
void ScLogest()
Definition: interpr5.cxx:2337
void GetStVarParams(bool bTextAsZero, double(*VarResult)(double fVal, size_t nValCount))
Definition: interpr1.cxx:3999
void PushMatrix(const sc::RangeMatrix &rMat)
Definition: interpr4.cxx:1902
void GetNumberSequenceArray(sal_uInt8 nParamCount, ::std::vector< double > &rArray, bool bConvertTextInArray)
Definition: interpr3.cxx:3960
void ScFInv_LT()
Definition: interpr3.cxx:2333
void ScSumIfs()
Definition: interpr1.cxx:6634
static double ScGetFV(double fRate, double fNper, double fPmt, double fPv, bool bPayInAdvance)
Definition: interpr2.cxx:1983
static utl::SearchParam::SearchType DetectSearchType(std::u16string_view rStr, const ScDocument &rDoc)
Detect if string should be used as regular expression or wildcard expression or literal string.
Definition: interpr1.cxx:10181
void ScChiSqDist()
Definition: interpr3.cxx:727
void ScPDuration()
Definition: interpr2.cxx:1910
void ScCosecantHyp()
Definition: interpr1.cxx:1955
void ScGammaDist(bool bODFF)
Definition: interpr3.cxx:2091
void ScTrimMean()
Definition: interpr3.cxx:3829
void CalculateSlopeIntercept(bool bSlope)
Definition: interpr3.cxx:4667
void ScVarP(bool bTextAsZero=false)
Definition: interpr1.cxx:4232
void ScCeil(bool bODFF)
tdf69552 ODFF1.2 function CEILING and Excel function CEILING.MATH In essence, the difference between ...
Definition: interpr2.cxx:1088
void ScCombin()
Definition: interpr3.cxx:1173
void ScGetMonth()
Definition: interpr2.cxx:128
static double phi(double x)
Definition: interpr3.cxx:195
void ScCovarianceP()
Definition: interpr3.cxx:4538
void PopError()
Definition: interpr4.cxx:754
ScFormulaCell * pMyFormulaCell
Definition: interpre.hxx:192
double GetPercentileExclusive(::std::vector< double > &rArray, double fPercentile)
Definition: interpr3.cxx:3429
void ScChooseJump()
Definition: interpr1.cxx:416
void ScEuroConvert()
Definition: interpr2.cxx:3312
void ScDBVarP()
Definition: interpr1.cxx:8237
void ScGauss()
Definition: interpr3.cxx:1145
void ScExact()
Definition: interpr1.cxx:9230
void ScReplace()
Definition: interpr1.cxx:9104
void ScColumn()
Definition: interpr1.cxx:4444
void ScRegex()
Definition: interpr1.cxx:9629
void ScUpper()
Definition: interpr1.cxx:3219
void ScCumIpmt()
Definition: interpr2.cxx:2253
void PopExternalDoubleRef(sal_uInt16 &rFileId, OUString &rTabName, ScComplexRefData &rRef)
Definition: interpr4.cxx:1220
static void QuickSort(::std::vector< double > &rSortArray, ::std::vector< tools::Long > *pIndexOrder)
Definition: interpr3.cxx:4210
void ScArcCos()
Definition: interpr1.cxx:1878
double GetCellValue(const ScAddress &, ScRefCellValue &rCell)
Definition: interpr4.cxx:178
bool MatrixParameterConversion()
Definition: interpre.hxx:1035
void ScRandbetween()
Definition: interpr1.cxx:1809
void ScCellExternal()
Definition: interpr1.cxx:2474
void PushTempToken(formula::FormulaToken *)
Does substitute with formula::FormulaErrorToken in case nGlobalError is set and the token passed is n...
Definition: interpr4.cxx:618
void ScAreas()
Definition: interpr1.cxx:9011
void ScSumProduct()
Definition: interpr5.cxx:1671
ScTokenStack * pStackObj
Definition: interpre.hxx:196
void ScConvertOOo()
Definition: interpr2.cxx:3018
void ScCeil_MS()
Definition: interpr2.cxx:1128
void ScFilterXML()
Definition: interpr7.cxx:39
void ScStDevP(bool bTextAsZero=false)
Definition: interpr1.cxx:4254
void ScSecant()
Definition: interpr1.cxx:1950
void PushSingleRef(SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: interpr4.cxx:1836
void ScFourier()
Definition: interpr3.cxx:5505
void ScMinIfs_MS()
Definition: interpr1.cxx:6686
VolatileType GetVolatileType() const
Definition: interpre.hxx:172
void ScAverageIf()
Definition: interpr1.cxx:5697
void ScFDist_LT()
Definition: interpr3.cxx:1704
static double GetLogGamma(double x)
You must ensure fZ>0.
Definition: interpr3.cxx:629
sc::RangeMatrix GetRangeMatrix()
Definition: interpr5.cxx:601
void ScMin(bool bTextAsZero=false)
Definition: interpr1.cxx:3685
void ScCount()
Definition: interpr6.cxx:973
void ScStdNormDist()
Definition: interpr3.cxx:1596
void ScIsLogical()
Definition: interpr1.cxx:2111
void ScArcSinHyp()
Definition: interpr1.cxx:1913
void ScHypGeomDist(int nMinParamCount)
Calculates a value of the hypergeometric distribution.
Definition: interpr3.cxx:1856
void ScConcat_MS()
Definition: interpr8.cxx:1382
void ScAbs()
Definition: interpr2.cxx:945
void ScNetWorkdays(bool bOOXML_Version)
Definition: interpr2.cxx:501
void ScBetaDist()
Definition: interpr3.cxx:1036
void ScProper()
Definition: interpr1.cxx:3225
void PushNoValue()
Definition: interpr4.cxx:1953
void ScTDist()
Definition: interpr3.cxx:1641
void SingleRefToVars(const ScSingleRefData &rRef, SCCOL &rCol, SCROW &rRow, SCTAB &rTab)
Definition: interpr4.cxx:863
void ScArcTan2()
Definition: interpr2.cxx:1278
bool IfErrorPushError()
If nGlobalError is set push formula::FormulaErrorToken.
Definition: interpre.hxx:293
void GetSortArray(sal_uInt8 nParamCount, ::std::vector< double > &rSortArray, ::std::vector< tools::Long > *pIndexOrder, bool bConvertTextInArray, bool bAllowEmptyArray)
Definition: interpr3.cxx:4143
void ScStandard()
Definition: interpr3.cxx:3196
double GetGammaDist(double fX, double fAlpha, double fLambda)
Gamma distribution, cumulative distribution function.
Definition: interpr6.cxx:198
void ScIsError()
Definition: interpr1.cxx:3023
double GetBetaDist(double x, double alpha, double beta)
Definition: interpr3.cxx:985
void ScMacro()
Definition: interpr4.cxx:3219
void ScValue()
Definition: interpr1.cxx:3335
void ScLeftB()
Definition: interpr1.cxx:9404
double GetDoubleWithDefault(double nDefault)
Definition: interpr4.cxx:2178
void ScFloor(bool bODFF)
tdf69552 ODFF1.2 function FLOOR and Excel function FLOOR.MATH In essence, the difference between the ...
Definition: interpr2.cxx:1176
void ScSlope()
Definition: interpr3.cxx:4737
void ScLower()
Definition: interpr1.cxx:3249
void ScBetaInv()
Definition: interpr3.cxx:2212
void ScChiSqDist_MS()
Definition: interpr3.cxx:750
bool IsMissing() const
Definition: interpr4.cxx:1958
static double GetPercentile(::std::vector< double > &rArray, double fPercentile)
Definition: interpr3.cxx:3400
void ScErrorType()
Definition: interpr1.cxx:10093
void ScChiInv()
Definition: interpr3.cxx:2368
void ScPearson()
Definition: interpr3.cxx:4548
ScMatrixRef MatConcat(const ScMatrixRef &pMat1, const ScMatrixRef &pMat2)
Definition: interpr5.cxx:1168
void ScIfError(bool bNAonly)
Definition: interpr1.cxx:249
void ScRoundSignificant()
Definition: interpr2.cxx:1058
sal_Int32 GetInt32()
if GetDouble() not within int32 limits sets nGlobalError and returns SAL_MAX_INT32
Definition: interpr4.cxx:2215
void ScTDist_MS()
Definition: interpr3.cxx:1674
formula::StackVar GetStackType()
Stack type with replacement of defaults, e.g. svMissing and formula::svEmptyCell will result in formu...
Definition: interpr4.cxx:1978
void ScRight()
Definition: interpr1.cxx:9547
formula::FormulaConstTokenRef xResult
Definition: interpre.hxx:189
static double GetPercentrank(::std::vector< double > &rArray, double fVal, bool bInclusive)
Definition: interpr3.cxx:3772
void ScAmpersand()
Definition: interpr5.cxx:1360
void ScArcTan()
Definition: interpr1.cxx:1883
void ScFloor_MS()
Definition: interpr2.cxx:1216
svl::SharedStringPool & mrStrPool
Definition: interpre.hxx:188
void ScAddressFunc()
Definition: interpr1.cxx:8489
void ScAggregate()
Definition: interpr1.cxx:7761
static double ScGetGCD(double fx, double fy)
Definition: interpr5.cxx:94
svl::SharedString GetStringFromMatrix(const ScMatrixRef &pMat)
Definition: interpr4.cxx:2413
double GetGammaSeries(double fA, double fX)
You must ensure fA>0.0 && fX>0.0 valid results only if fX <= fA+1.0 uses power series.
Definition: interpr6.cxx:96
bool bCalcAsShown
Definition: interpre.hxx:210
void ScIfJump()
Definition: interpr1.cxx:87
void PushInt(int nVal)
Definition: interpr4.cxx:1808
void ScColumns()
Definition: interpr1.cxx:4283
void ScCombinA()
Definition: interpr3.cxx:1186
SvNumFormatType nCurFmtType
Definition: interpre.hxx:205
void CalculateSumX2MY2SumX2DY2(bool _bSumX2DY2)
Definition: interpr5.cxx:1736
static double gaussinv(double x)
Definition: interpr3.cxx:268
void ScNotEqual()
Definition: interpr1.cxx:1183
void ScSheet()
Definition: interpr1.cxx:4669
void ScAverageIfs()
Definition: interpr1.cxx:6652
void SetLinkManager(sfx2::LinkManager *pLinkMgr)
Definition: interpre.hxx:1012
SvNumFormatType nRetFmtType
Definition: interpre.hxx:206
void ScFixed()
Definition: interpr1.cxx:9141
void ScCorrel()
Definition: interpr3.cxx:4532
void ScRoundUp()
Definition: interpr2.cxx:1033
void PushString(const OUString &rStr)
Definition: interpr4.cxx:1825
void DBIterator(ScIterFunc)
Definition: interpr1.cxx:7995
void RoundNumber(rtl_math_RoundingMode eMode)
Definition: interpr2.cxx:955
void PushStringBuffer(const sal_Unicode *pString)
Definition: interpr4.cxx:1814
void ScBitRshift()
Definition: interpr1.cxx:1711
void ScGeoMean()
Definition: interpr3.cxx:3024
ScMatrixRef CreateMatrixFromDoubleRef(const formula::FormulaToken *pToken, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2)
Definition: interpr5.cxx:302
void ScFindB()
Definition: interpr1.cxx:9468
void ScPercentrank(bool bInclusive)
Definition: interpr3.cxx:3734
void ScClean()
Definition: interpr1.cxx:3516
sal_uInt16 sp
Definition: interpre.hxx:199
void ScArcTanHyp()
Definition: interpr1.cxx:1927
void ScDBVar()
Definition: interpr1.cxx:8230
void ScSTEYX()
Definition: interpr3.cxx:4663
void ScPermut()
Definition: interpr3.cxx:1199
void ScBahtText()
Definition: interpr2.cxx:3483
double GetGammaContFraction(double fA, double fX)
You must ensure fA>0.0 && fX>0.0 valid results only if fX > fA+1.0 uses continued fraction with odd i...
Definition: interpr6.cxx:44
void ScUnichar()
Definition: interpr1.cxx:3644
void ScSwitch_MS()
Definition: interpr8.cxx:1897
ScInterpreter(ScFormulaCell *pCell, ScDocument &rDoc, ScInterpreterContext &rContext, const ScAddress &, ScTokenArray &, bool bForGroupThreading=false)
Definition: interpr4.cxx:3803
void ScIntersect()
Definition: interpr2.cxx:2390
void ScMatMult()
Definition: interpr5.cxx:1064
FormulaError GetErrorType()
Definition: interpr1.cxx:10021
void ScCurrent()
Definition: interpr2.cxx:2630
void ScPoissonDist(bool bODFF)
Definition: interpr3.cxx:1781
Matrix data type that can store values of mixed types.
Definition: scmatrix.hxx:101
static bool HasForceArray(OpCode eOp)
Whether OpCode has a parameter of type ForceArray or ReferenceOrForceArray.
Definition: parclass.hxx:63
const formula::FormulaToken * pPointer[MAXSTACK]
Definition: interpre.hxx:99
bool IsInForceArray() const
OpCode GetOpCode() const
Reference< XOutputStream > stream
FormulaError
FormulaError GetDoubleErrorValue(double fVal)
SubtotalFlags
Definition: global.hxx:240
ScQueryOp
Definition: global.hxx:834
ScETSType
Definition: interpre.hxx:120
@ etsAdd
Definition: interpre.hxx:121
@ etsStatMult
Definition: interpre.hxx:127
@ etsMult
Definition: interpre.hxx:122
@ etsSeason
Definition: interpre.hxx:123
@ etsPIMult
Definition: interpre.hxx:125
@ etsPIAdd
Definition: interpre.hxx:124
@ etsStatAdd
Definition: interpre.hxx:126
constexpr size_t MAXSTACK
Definition: interpre.hxx:94
constexpr sal_Int32 kScInterpreterMaxStrLen
Arbitrary 256MB result string length limit.
Definition: interpre.hxx:92
ScIterFunc
Definition: interpre.hxx:102
@ ifCOUNT2
Definition: interpre.hxx:108
@ ifMIN
Definition: interpre.hxx:109
@ ifCOUNT
Definition: interpre.hxx:107
@ ifPRODUCT
Definition: interpre.hxx:105
@ ifSUM
Definition: interpre.hxx:103
@ ifSUMSQ
Definition: interpre.hxx:104
@ ifAVERAGE
Definition: interpre.hxx:106
@ ifMAX
Definition: interpre.hxx:110
::std::map< const formula::FormulaConstTokenRef, formula::FormulaConstTokenRef, FormulaTokenRef_less > ScTokenMatrixMap
Definition: interpre.hxx:135
ScIterFuncIf
Definition: interpre.hxx:114
@ ifSUMIF
Definition: interpre.hxx:115
@ ifAVERAGEIF
Definition: interpre.hxx:116
sal_Int64 n
::boost::intrusive_ptr< const FormulaToken > FormulaConstTokenRef
CAUTION! The following defines must be in the same namespace as the respective type.
Definition: broadcast.cxx:15
double div(const double &fNumerator, const double &fDenominator)
Return fNumerator/fDenominator if fDenominator!=0 else #DIV/0! error coded into double.
Definition: math.hxx:29
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &stream, const ParamIfsResult &rRes)
Definition: interpre.hxx:71
These need to be in global namespace just like their respective types are.
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:398
sal_uIntPtr sal_uLong
bool operator()(const formula::FormulaConstTokenRef &r1, const formula::FormulaConstTokenRef &r2) const
Definition: interpre.hxx:132
Configuration options for formula interpreter.
Definition: calcconfig.hxx:44
Complex reference (a range) into the sheet.
Definition: refdata.hxx:123
Each instance of this struct represents a single filtering criteria.
Definition: queryentry.hxx:34
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:108
Single reference (one address) into the sheet.
Definition: refdata.hxx:30
::std::vector< ScComplexRefData > ScRefList
Definition: token.hxx:37
unsigned char sal_uInt8
#define SAL_MAX_INT32
sal_uInt16 sal_Unicode
sal_Int16 SCTAB
Definition: types.hxx:22
ScMatValType
Definition: types.hxx:31
sal_Int16 SCCOL
Definition: types.hxx:21
::boost::intrusive_ptr< ScMatrix > ScMatrixRef
Definition: types.hxx:25
sal_Int32 SCROW
Definition: types.hxx:17
SvNumFormatType