LibreOffice Module sc (master) 1
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
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 .
18 */
20#pragma once
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"
35#include <map>
36#include <memory>
37#include <vector>
38#include <limits>
39#include <ostream>
41namespace sfx2 { class LinkManager; }
43class ScDocument;
44class SbxVariable;
45class ScFormulaCell;
46class ScDBRangeBase;
47struct ScQueryParam;
49struct ScQueryEntry;
51struct ScSingleRefData;
52struct ScComplexRefData;
55class ScJumpMatrix;
56struct ScRefCellValue;
58namespace sc {
60struct CompareOptions;
65 double mfCount = 0.0;
66 double mfMin = std::numeric_limits<double>::max();
67 double mfMax = std::numeric_limits<double>::lowest();
70template<typename charT, typename traits>
71inline std::basic_ostream<charT, traits> & operator <<(std::basic_ostream<charT, traits> & stream, const ParamIfsResult& rRes)
73 stream << "{" <<
74 "sum=" << rRes.mfSum.get() << "," <<
75 "count=" << rRes.mfCount << "," <<
76 "min=" << rRes.mfMin << "," <<
77 "max=" << rRes.mfMax << "," <<
78 "}";
80 return stream;
85namespace svl {
87class SharedStringPool;
92constexpr sal_Int32 kScInterpreterMaxStrLen = SAL_MAX_INT32 / 8;
94constexpr size_t MAXSTACK = 512;
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
115 ifSUMIF, // Conditional sum
116 ifAVERAGEIF // Conditional average
133 { return r1.get() < r2.get(); }
135typedef ::std::map< const formula::FormulaConstTokenRef, formula::FormulaConstTokenRef, FormulaTokenRef_less> ScTokenMatrixMap;
139 // distribution function objects need the GetxxxDist methods
141 friend class ScBetaDistFunction;
142 friend class ScTDistFunction;
143 friend class ScFDistFunction;
144 friend class ScChiDistFunction;
148 static void SetGlobalConfig(const ScCalcConfig& rConfig);
149 static const ScCalcConfig& GetGlobalConfig();
151 static void GlobalExit(); // called by ScGlobal::Clear()
156 static utl::SearchParam::SearchType DetectSearchType(std::u16string_view rStr, const ScDocument& rDoc );
160 static inline double div( const double& fNumerator, const double& fDenominator );
162 ScMatrixRef GetNewMat(SCSIZE nC, SCSIZE nR, bool bEmpty = false);
164 ScMatrixRef GetNewMat(SCSIZE nC, SCSIZE nR, const std::vector<double>& rValues);
170 };
178 static thread_local std::unique_ptr<ScTokenStack> pGlobalStack;
179 static thread_local bool bGlobalStackInUse;
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
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
215 void MakeMatNew(ScMatrixRef& rMat, SCSIZE nC, SCSIZE nR);
218 void MergeCalcConfig();
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 );
226 void PushIllegalArgument();
227 void PushNoValue();
228 void PushNA();
230 // Functions for accessing a document
232 void ReplaceCell( ScAddress& ); // for TableOp
233 bool IsTableOpInRange( const ScRange& );
234 sal_uInt32 GetCellNumberFormat( const ScAddress& rPos, ScRefCellValue& rCell );
235 double ConvertStringToValue( const OUString& );
237 static double ScGetGCD(double fx, double fy);
240 double ConvertStringToValue( const OUString&, FormulaError& rError, SvNumFormatType& rCurFmtType );
242 double GetCellValue( const ScAddress&, ScRefCellValue& rCell );
243 double GetCellValueOrZero( const ScAddress&, ScRefCellValue& rCell );
244 double GetValueCellValue( const ScAddress&, double fOrig );
245 void GetCellString( svl::SharedString& rStr, ScRefCellValue& rCell );
246 static FormulaError GetCellErrCode( const ScRefCellValue& rCell );
248 bool CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
249 SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr);
250 bool CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
251 SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr);
252 bool CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
253 SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr);
255 // Stack operations
260 void Push( const formula::FormulaToken& r );
293 {
294 if (nGlobalError != FormulaError::NONE)
295 {
297 return true;
298 }
299 return false;
300 }
317 void PushCellResultToken( bool bDisplayEmptyAsString, const ScAddress & rAddress,
318 SvNumFormatType * pRetTypeExpr, sal_uInt32 * pRetIndexExpr, bool bFinalResult = false );
321 void Pop();
322 void PopError();
323 double PopDouble();
325 void ValidateRef( const ScSingleRefData & rRef );
326 void ValidateRef( const ScComplexRefData & rRef );
327 void ValidateRef( const ScRefList & rRefList );
328 void SingleRefToVars( const ScSingleRefData & rRef, SCCOL & rCol, SCROW & rRow, SCTAB & rTab );
329 void PopSingleRef( ScAddress& );
330 void PopSingleRef(SCCOL& rCol, SCROW &rRow, SCTAB& rTab);
331 void DoubleRefToRange( const ScComplexRefData&, ScRange&, bool bDontCheckForTableOp = false );
340 void PopDoubleRef( ScRange & rRange, short & rParam, size_t & rRefInList );
341 void PopDoubleRef( ScRange&, bool bDontCheckForTableOp = false );
343 SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1,
344 SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2 );
346 void PopDoubleRef(SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1,
347 SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2 );
348 // peek double ref data
349 const ScComplexRefData* GetStackDoubleRef(size_t rRefInList = 0);
351 void PopExternalSingleRef(sal_uInt16& rFileId, OUString& rTabName, ScSingleRefData& rRef);
357 void PopExternalSingleRef(sal_uInt16& rFileId, OUString& rTabName, ScSingleRefData& rRef,
360 void PopExternalDoubleRef(sal_uInt16& rFileId, OUString& rTabName, ScComplexRefData& rRef);
363 void GetExternalDoubleRef(sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& aData, ScExternalRefCache::TokenArrayRef& rArray);
367 // If MatrixFormula: convert svDoubleRef to svMatrix, create JumpMatrix.
368 // Else convert area reference parameters marked as ForceArray to array.
369 // Returns true if JumpMatrix created.
371 // If MatrixFormula: ConvertMatrixJumpConditionToMatrix()
372 inline void MatrixJumpConditionToMatrix();
373 // For MatrixFormula (preconditions already checked by
374 // MatrixJumpConditionToMatrix()): convert svDoubleRef to svMatrix, or if
375 // JumpMatrix currently in effect convert also other types to svMatrix so
376 // another JumpMatrix will be created by jump commands.
378 // If MatrixFormula or ForceArray: ConvertMatrixParameters()
379 inline bool MatrixParameterConversion();
380 // If MatrixFormula or ForceArray. Can be used within spreadsheet functions
381 // that do not depend on the formula cell's matrix size, for which only
382 // bMatrixFormula can be used.
383 inline bool IsInArrayContext() const;
386 void QueryMatrixType(const ScMatrixRef& xMat, SvNumFormatType& rRetTypeExpr, sal_uInt32& rRetIndexExpr);
388 formula::FormulaToken* CreateFormulaDoubleToken( double fVal, SvNumFormatType nFmt = SvNumFormatType::NUMBER );
391 void PushDouble(double nVal);
392 void PushInt( int nVal );
393 void PushStringBuffer( const sal_Unicode* pString );
394 void PushString( const OUString& rStr );
395 void PushString( const svl::SharedString& rString );
396 void PushSingleRef(SCCOL nCol, SCROW nRow, SCTAB nTab);
397 void PushDoubleRef(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
398 SCCOL nCol2, SCROW nRow2, SCTAB nTab2);
399 void PushExternalSingleRef(sal_uInt16 nFileId, const OUString& rTabName,
400 SCCOL nCol, SCROW nRow, SCTAB nTab);
401 void PushExternalDoubleRef(sal_uInt16 nFileId, const OUString& rTabName,
402 SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
403 SCCOL nCol2, SCROW nRow2, SCTAB nTab2);
404 void PushSingleRef( const ScRefAddress& rRef );
405 void PushDoubleRef( const ScRefAddress& rRef1, const ScRefAddress& rRef2 );
406 void PushMatrix( const sc::RangeMatrix& rMat );
407 void PushMatrix(const ScMatrixRef& pMat);
408 void PushError( FormulaError nError );
413 // peek StackType of Parameter, Parameter 1 == TOS, 2 == TOS-1, ...
415 sal_uInt8 GetByte() const { return cPar; }
416 // reverse order of stack
417 void ReverseStack( sal_uInt8 nParamCount );
418 // generates a position-dependent SingleRef out of a DoubleRef
419 bool DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& rAdr );
420 double GetDoubleFromMatrix(const ScMatrixRef& pMat);
421 double GetDouble();
422 double GetDoubleWithDefault(double nDefault);
423 bool IsMissing() const;
424 sal_Int32 double_to_int32(double fVal);
426 sal_Int32 GetInt32();
428 sal_Int32 GetInt32WithDefault( sal_Int32 nDefault );
430 sal_Int16 GetInt16();
432 sal_uInt32 GetUInt32();
433 bool GetBool() { return GetDouble() != 0.0; }
435 bool GetDoubleOrString( double& rValue, svl::SharedString& rString );
438 svl::SharedString GetStringFromDouble( const double fVal);
439 // pop matrix and obtain one element, upper left or according to jump matrix
442 SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
443 SCCOL nCol2, SCROW nRow2, SCTAB nTab2 );
446 ScMatrixRef GetMatrix( short & rParam, size_t & rInRefList );
449 void ScTableOp(); // repeated operations
451 // common helper functions
466 static inline bool CheckStringPositionArgument( double & fVal );
472 inline sal_Int32 GetStringPositionArgument();
474 // Check for String overflow of rResult+rAdd and set error and erase rResult
475 // if so. Return true if ok, false if overflow
476 inline bool CheckStringResultLen( OUString& rResult, sal_Int32 nIncrease );
478 // Check for String overflow of rResult+rAdd and set error and erase rResult
479 // if so. Return true if ok, false if overflow
480 inline bool CheckStringResultLen( OUStringBuffer& rResult, sal_Int32 nIncrease );
482 // Set error according to rVal, and set rVal to 0.0 if there was an error.
483 inline void TreatDoubleError( double& rVal );
484 // Lookup using ScLookupCache, @returns true if found and result address
485 bool LookupQueryWithCache( ScAddress & o_rResultPos,
486 const ScQueryParam & rParam, const ScComplexRefData* refData ) const;
488 void ScIfJump();
489 void ScIfError( bool bNAonly );
490 void ScChooseJump();
492 // Be sure to only call this if pStack[sp-nStackLevel] really contains a
493 // ScJumpMatrixToken, no further checks are applied!
494 // Returns true if last jump was executed and result matrix pushed.
495 bool JumpMatrix( short nStackLevel );
497 double Compare( ScQueryOp eOp );
501 sc::RangeMatrix CompareMat( ScQueryOp eOp, sc::CompareOptions* pOptions = nullptr );
502 ScMatrixRef QueryMat( const ScMatrixRef& pMat, sc::CompareOptions& rOptions );
503 void ScEqual();
504 void ScNotEqual();
505 void ScLess();
506 void ScGreater();
507 void ScLessEqual();
508 void ScGreaterEqual();
509 void ScAnd();
510 void ScOr();
511 void ScXor();
512 void ScNot();
513 void ScNeg();
514 void ScPercentSign();
515 void ScIntersect();
516 void ScRangeFunc();
517 void ScUnionFunc();
518 void ScPi();
519 void ScRandom();
520 void ScRandbetween();
521 void ScRandomImpl( const std::function<double( double fFirst, double fLast )>& RandomFunc,
522 double fFirst, double fLast );
523 void ScTrue();
524 void ScFalse();
525 void ScDeg();
526 void ScRad();
527 void ScSin();
528 void ScCos();
529 void ScTan();
530 void ScCot();
531 void ScArcSin();
532 void ScArcCos();
533 void ScArcTan();
534 void ScArcCot();
535 void ScSinHyp();
536 void ScCosHyp();
537 void ScTanHyp();
538 void ScCotHyp();
539 void ScArcSinHyp();
540 void ScArcCosHyp();
541 void ScArcTanHyp();
542 void ScArcCotHyp();
543 void ScCosecant();
544 void ScSecant();
545 void ScCosecantHyp();
546 void ScSecantHyp();
547 void ScExp();
548 void ScLn();
549 void ScLog10();
550 void ScSqrt();
551 void ScIsEmpty();
552 bool IsString();
553 void ScIsString();
554 void ScIsNonString();
555 void ScIsLogical();
556 void ScType();
557 void ScCell();
558 void ScCellExternal();
559 void ScIsRef();
560 void ScIsValue();
561 void ScIsFormula();
562 void ScFormula();
563 void ScRoman();
564 void ScArabic();
565 void ScIsNV();
566 void ScIsErr();
567 void ScIsError();
568 bool IsEven();
569 void ScIsEven();
570 void ScIsOdd();
571 void ScN();
572 void ScCode();
573 void ScTrim();
574 void ScUpper();
575 void ScProper();
576 void ScLower();
577 void ScLen();
578 void ScT();
579 void ScValue();
580 void ScNumberValue();
581 void ScClean();
582 void ScChar();
583 void ScJis();
584 void ScAsc();
585 void ScUnicode();
586 void ScUnichar();
587 void ScMin( bool bTextAsZero = false );
588 void ScMax( bool bTextAsZero = false );
591 size_t GetRefListArrayMaxSize( short nParamCount );
594 bool SwitchToArrayRefList( ScMatrixRef& xResMat, SCSIZE nMatRows, double fCurrent,
595 const std::function<void( SCSIZE i, double fCurrent )>& MatOpFunc, bool bDoMatOp );
596 void IterateParameters( ScIterFunc, bool bTextAsZero = false );
597 void ScSumSQ();
598 void ScSum();
599 void ScProduct();
600 void ScAverage( bool bTextAsZero = false );
601 void ScCount();
602 void ScCount2();
603 void GetStVarParams( bool bTextAsZero, double(*VarResult)( double fVal, size_t nValCount ) );
604 void ScVar( bool bTextAsZero = false );
605 void ScVarP( bool bTextAsZero = false );
606 void ScStDev( bool bTextAsZero = false );
607 void ScStDevP( bool bTextAsZero = false );
608 void ScRawSubtract();
609 void ScColumns();
610 void ScRows();
611 void ScSheets();
612 void ScColumn();
613 void ScRow();
614 void ScSheet();
615 void ScMatch();
617 void ScCountIf();
618 void ScSumIf();
619 void ScAverageIf();
620 void IterateParametersIfs( double(*ResultFunc)( const sc::ParamIfsResult& rRes ) );
621 void ScSumIfs();
622 void ScAverageIfs();
623 void ScCountIfs();
624 void ScCountEmptyCells();
625 void ScLookup();
626 void ScHLookup();
627 void ScVLookup();
628 void ScSubTotal();
630 // If upon call rMissingField==true then the database field parameter may be
631 // missing (Xcl DCOUNT() syntax), or may be faked as missing by having the
632 // value 0.0 or being exactly the entire database range reference (old SO
633 // compatibility). If this was the case then rMissingField is set to true upon
634 // return. If rMissingField==false upon call all "missing cases" are considered
635 // to be an error.
636 std::unique_ptr<ScDBQueryParamBase> GetDBParams( bool& rMissingField );
638 void DBIterator( ScIterFunc );
639 void ScDBSum();
640 void ScDBCount();
641 void ScDBCount2();
642 void ScDBAverage();
643 void ScDBGet();
644 void ScDBMax();
645 void ScDBMin();
646 void ScDBProduct();
647 void GetDBStVarParams( double& rVal, double& rValCount );
648 void ScDBStdDev();
649 void ScDBStdDevP();
650 void ScDBVar();
651 void ScDBVarP();
652 void ScIndirect();
653 void ScAddressFunc();
654 void ScOffset();
655 void ScIndex();
656 void ScMultiArea();
657 void ScAreas();
658 void ScCurrency();
659 void ScReplace();
660 void ScFixed();
661 void ScFind();
662 void ScExact();
663 void ScLeft();
664 void ScRight();
665 void ScSearch();
666 void ScMid();
667 void ScText();
668 void ScSubstitute();
669 void ScRept();
670 void ScRegex();
671 void ScConcat();
672 void ScConcat_MS();
673 void ScTextJoin_MS();
674 void ScIfs_MS();
675 void ScSwitch_MS();
676 void ScMinIfs_MS();
677 void ScMaxIfs_MS();
678 void ScExternal();
679 void ScMissing();
680 void ScMacro();
681 bool SetSbxVariable( SbxVariable* pVar, const ScAddress& );
683 void ScErrorType();
684 void ScErrorType_ODF();
685 void ScDBArea();
686 void ScColRowNameAuto();
687 void ScGetPivotData();
688 void ScHyperLink();
689 void ScBahtText();
690 void ScBitAnd();
691 void ScBitOr();
692 void ScBitXor();
693 void ScBitRshift();
694 void ScBitLshift();
695 void ScTTT();
696 void ScDebugVar();
708 double GetDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, bool bStrict );
710 void ScGetActDate();
711 void ScGetActTime();
712 void ScGetYear();
713 void ScGetMonth();
714 void ScGetDay();
715 void ScGetDayOfWeek();
716 void ScGetWeekOfYear();
717 void ScGetIsoWeekOfYear();
718 void ScWeeknumOOo();
719 void ScEasterSunday();
720 FormulaError GetWeekendAndHolidayMasks( const sal_uInt8 nParamCount, const sal_uInt32 nNullDate,
721 ::std::vector<double>& rSortArray, bool bWeekendMask[ 7 ] );
722 FormulaError GetWeekendAndHolidayMasks_MS( const sal_uInt8 nParamCount, const sal_uInt32 nNullDate,
723 ::std::vector<double>& rSortArray, bool bWeekendMask[ 7 ], bool bWorkdayFunction );
724 static inline sal_Int16 GetDayOfWeek( sal_Int32 n );
725 void ScNetWorkdays( bool bOOXML_Version );
726 void ScWorkday_MS();
727 void ScGetHour();
728 void ScGetMin();
729 void ScGetSec();
730 void ScPlusMinus();
731 void ScAbs();
732 void ScInt();
733 void ScEven();
734 void ScOdd();
735 void ScCeil( bool bODFF );
736 void ScCeil_MS();
737 void ScCeil_Precise();
738 void ScFloor( bool bODFF );
739 void ScFloor_MS();
740 void ScFloor_Precise();
741 void RoundNumber( rtl_math_RoundingMode eMode );
742 void ScRound();
743 void ScRoundUp();
744 void ScRoundDown();
745 void ScGetDateValue();
746 void ScGetTimeValue();
747 void ScArcTan2();
748 void ScLog();
749 void ScGetDate();
750 void ScGetTime();
751 void ScGetDiffDate();
752 void ScGetDiffDate360();
753 void ScGetDateDif();
754 void ScPower();
755 void ScAmpersand();
756 void ScAdd();
757 void ScSub();
758 void ScMul();
759 void ScDiv();
760 void ScPow();
761 void ScCurrent();
762 void ScStyle();
763 void ScDde();
764 void ScBase();
765 void ScDecimal();
766 void ScConvertOOo();
767 void ScEuroConvert();
768 void ScRoundSignificant();
769 static void RoundSignificant( double fX, double fDigits, double &fRes );
771 // financial functions
772 void ScNPV();
773 void ScIRR();
774 void ScMIRR();
775 void ScISPMT();
777 static double ScGetPV(double fRate, double fNper, double fPmt,
778 double fFv, bool bPayInAdvance);
779 void ScPV();
780 void ScSYD();
781 static double ScGetDDB(double fCost, double fSalvage, double fLife,
782 double fPeriod, double fFactor);
783 void ScDDB();
784 void ScDB();
785 static double ScInterVDB(double fCost, double fSalvage, double fLife, double fLife1,
786 double fPeriod, double fFactor);
787 void ScVDB();
788 void ScPDuration();
789 void ScSLN();
790 static double ScGetPMT(double fRate, double fNper, double fPv,
791 double fFv, bool bPayInAdvance);
792 void ScPMT();
793 void ScRRI();
794 static double ScGetFV(double fRate, double fNper, double fPmt,
795 double fPv, bool bPayInAdvance);
796 void ScFV();
797 void ScNper();
798 static bool RateIteration(double fNper, double fPayment, double fPv,
799 double fFv, bool bPayType, double& fGuess);
800 void ScRate();
801 double ScGetIpmt(double fRate, double fPer, double fNper, double fPv,
802 double fFv, bool bPayInAdvance, double& fPmt);
803 void ScIpmt();
804 void ScPpmt();
805 void ScCumIpmt();
806 void ScCumPrinc();
807 void ScEffect();
808 void ScNominal();
809 void ScMod();
810 void ScIntercept();
811 void ScGCD();
812 void ScLCM();
814 // matrix functions
815 void ScMatValue();
816 static void MEMat(const ScMatrixRef& mM, SCSIZE n);
817 void ScMatDet();
818 void ScMatInv();
819 void ScMatMult();
820 void ScMatTrans();
821 void ScEMat();
822 void ScMatRef();
823 ScMatrixRef MatConcat(const ScMatrixRef& pMat1, const ScMatrixRef& pMat2);
824 void ScSumProduct();
825 void ScSumX2MY2();
826 void ScSumX2DY2();
827 void ScSumXMY2();
828 void ScGrowth();
829 bool CalculateSkew(KahanSum& fSum, double& fCount, std::vector<double>& values);
830 void CalculateSkewOrSkewp( bool bSkewp );
831 void CalculateSlopeIntercept(bool bSlope);
832 void CalculateSmallLarge(bool bSmall);
833 void CalculatePearsonCovar( bool _bPearson, bool _bStexy, bool _bSample ); //fdo#70000 argument _bSample is ignored if _bPearson == true
834 bool CalculateTest( bool _bTemplin
835 ,const SCSIZE nC1, const SCSIZE nC2,const SCSIZE nR1,const SCSIZE nR2
836 ,const ScMatrixRef& pMat1,const ScMatrixRef& pMat2
837 ,double& fT,double& fF);
838 void CalculateLookup(bool bHLookup);
839 bool FillEntry(ScQueryEntry& rEntry);
840 void CalculateAddSub(bool _bSub);
841 void CalculateTrendGrowth(bool _bGrowth);
842 void CalculateRGPRKP(bool _bRKP);
843 void CalculateSumX2MY2SumX2DY2(bool _bSumX2DY2);
844 void CalculateMatrixValue(const ScMatrix* pMat,SCSIZE nC,SCSIZE nR);
845 bool CheckMatrix(bool _bLOG,sal_uInt8& nCase,SCSIZE& nCX,SCSIZE& nCY,SCSIZE& nRX,SCSIZE& nRY,SCSIZE& M,SCSIZE& N,ScMatrixRef& pMatX,ScMatrixRef& pMatY);
846 void ScLinest();
847 void ScLogest();
848 void ScForecast();
849 void ScForecast_Ets( ScETSType eETSType );
850 void ScFourier();
851 void ScNoName();
852 void ScBadName();
853 // Statistics:
854 static double taylor(const double* pPolynom, sal_uInt16 nMax, double x);
855 static double gauss(double x);
858 static double phi(double x);
859 static double integralPhi(double x);
860 static double gaussinv(double x);
861 static double GetPercentile( ::std::vector<double> & rArray, double fPercentile );
865 double GetBetaDist(double x, double alpha, double beta); //cumulative distribution function
866 double GetBetaDistPDF(double fX, double fA, double fB); //probability density function)
867 double GetChiDist(double fChi, double fDF); // for LEGACY.CHIDIST, returns right tail
868 double GetChiSqDistCDF(double fX, double fDF); // for CHISQDIST, returns left tail
869 static double GetChiSqDistPDF(double fX, double fDF); // probability density function
870 double GetFDist(double x, double fF1, double fF2);
871 double GetTDist( double T, double fDF, int nType );
872 double Fakultaet(double x);
873 static double BinomKoeff(double n, double k);
874 double GetGamma(double x);
875 static double GetLogGamma(double x);
876 double GetBeta(double fAlpha, double fBeta);
877 static double GetLogBeta(double fAlpha, double fBeta);
878 double GetBinomDistPMF(double x, double n, double p); //probability mass function
879 double GetHypGeomDist( double x, double n, double M, double N );
880 void ScLogGamma();
881 void ScGamma();
882 void ScPhi();
883 void ScGauss();
884 void ScStdNormDist();
885 void ScStdNormDist_MS();
886 void ScFisher();
887 void ScFisherInv();
888 void ScFact();
889 void ScNormDist( int nMinParamCount );
890 void ScGammaDist( bool bODFF );
891 void ScGammaInv();
892 void ScExpDist();
893 void ScBinomDist();
894 void ScPoissonDist( bool bODFF );
895 void ScCombin();
896 void ScCombinA();
897 void ScPermut();
898 void ScPermutationA();
899 void ScB();
900 void ScHypGeomDist( int nMinParamCount );
901 void ScLogNormDist( int nMinParamCount );
902 void ScLogNormInv();
903 void ScTDist();
904 void ScTDist_MS();
905 void ScTDist_T( int nTails );
906 void ScFDist();
907 void ScFDist_LT();
908 void ScChiDist( bool bODFF); // for LEGACY.CHIDIST, returns right tail
909 void ScChiSqDist(); // returns left tail or density
910 void ScChiSqDist_MS();
911 void ScChiSqInv(); // inverse to CHISQDIST
912 void ScWeibull();
913 void ScBetaDist();
914 void ScBetaDist_MS();
915 void ScFInv();
916 void ScFInv_LT();
917 void ScTInv( int nType );
918 void ScChiInv();
919 void ScBetaInv();
920 void ScCritBinom();
921 void ScNegBinomDist();
922 void ScNegBinomDist_MS();
923 void ScKurt();
924 void ScHarMean();
925 void ScGeoMean();
926 void ScStandard();
927 void ScSkew();
928 void ScSkewp();
929 void ScMedian();
930 double GetMedian( ::std::vector<double> & rArray );
931 double GetPercentileExclusive( ::std::vector<double> & rArray, double fPercentile );
932 std::vector<double> GetTopNumberArray( SCSIZE& rCol, SCSIZE& rRow );
933 void GetNumberSequenceArray( sal_uInt8 nParamCount, ::std::vector<double>& rArray, bool bConvertTextInArray );
934 void GetSortArray( sal_uInt8 nParamCount, ::std::vector<double>& rSortArray, ::std::vector<tools::Long>* pIndexOrder, bool bConvertTextInArray, bool bAllowEmptyArray );
935 static void QuickSort(::std::vector<double>& rSortArray, ::std::vector<tools::Long>* pIndexOrder);
936 void ScModalValue();
937 void ScModalValue_MS( bool bSingle );
938 void ScAveDev();
939 void ScAggregate();
940 void ScDevSq();
941 void ScZTest();
942 void ScTTest();
943 void ScFTest();
944 void ScChiTest();
945 void ScRank( bool bAverage );
946 void ScPercentile( bool bInclusive );
947 void ScPercentrank( bool bInclusive );
948 static double GetPercentrank( ::std::vector<double> & rArray, double fVal, bool bInclusive );
949 void ScLarge();
950 void ScSmall();
951 void ScFrequency();
952 void ScQuartile( bool bInclusive );
953 void ScNormInv();
954 void ScSNormInv();
955 void ScConfidence();
956 void ScConfidenceT();
957 void ScTrimMean();
958 void ScProbability();
959 void ScCorrel();
960 void ScCovarianceP();
961 void ScCovarianceS();
962 void ScPearson();
963 void ScRSQ();
964 void ScSTEYX();
965 void ScSlope();
966 void ScTrend();
967 void ScInfo();
968 void ScLenB();
969 void ScRightB();
970 void ScLeftB();
971 void ScMidB();
972 void ScReplaceB();
973 void ScFindB();
974 void ScSearchB();
976 void ScFilterXML();
977 void ScWebservice();
978 void ScEncodeURL();
979 void ScColor();
980 void ScErf();
981 void ScErfc();
983 static const double fMaxGammaArgument;
985 double GetGammaContFraction(double fA,double fX);
986 double GetGammaSeries(double fA,double fX);
987 double GetLowRegIGamma(double fA,double fX); // lower regularized incomplete gamma function, GAMMAQ
988 double GetUpRegIGamma(double fA,double fX); // upper regularized incomplete gamma function, GAMMAP
989 // probability density function; fLambda is "scale" parameter
990 double GetGammaDistPDF(double fX, double fAlpha, double fLambda);
991 // cumulative distribution function; fLambda is "scale" parameter
992 double GetGammaDist(double fX, double fAlpha, double fLambda);
993 double GetTInv( double fAlpha, double fSize, int nType );
997 const ScAddress&, ScTokenArray&, bool bForGroupThreading = false );
1000 // Used only for threaded formula-groups.
1001 // Resets the interpreter object, allowing reuse of interpreter object for each cell
1002 // in the group.
1003 void Init( ScFormulaCell* pCell, const ScAddress& rPos, ScTokenArray& rTokArray );
1008 { if (nError != FormulaError::NONE && nGlobalError == FormulaError::NONE) nGlobalError = nError; }
1009 void AssertFormulaMatrix();
1012 { mpLinkManager = pLinkMgr; }
1015 formula::StackVar GetResultType() const { return xResult->GetType(); }
1016 const svl::SharedString & GetStringResult() const;
1017 double GetNumResult() const { return xResult->GetDouble(); }
1025 return bMatrixFormula || pCur->IsInForceArray();
1030 if (IsInArrayContext())
1037 !pJumpMatrix && sp > 0 )
1038 return ConvertMatrixParameters();
1039 return false;
1044 return maTokenMatrixMap;
1047inline bool ScInterpreter::MustHaveParamCount( short nAct, short nMust )
1049 if ( nAct == nMust )
1050 return true;
1051 if ( nAct < nMust )
1053 else
1055 return false;
1058inline bool ScInterpreter::MustHaveParamCount( short nAct, short nMust, short nMax )
1060 if ( nMust <= nAct && nAct <= nMax )
1061 return true;
1062 if ( nAct < nMust )
1064 else
1066 return false;
1069inline bool ScInterpreter::MustHaveParamCountMin( short nAct, short nMin )
1071 if ( nAct >= nMin )
1072 return true;
1074 return false;
1079 if (!std::isfinite( fVal))
1080 {
1081 fVal = -1.0;
1082 return false;
1083 }
1084 else if (fVal < 0.0)
1085 {
1086 fVal = 0.0;
1087 return false;
1088 }
1089 else if (fVal > SAL_MAX_INT32)
1090 {
1091 fVal = static_cast<double>(SAL_MAX_INT32);
1092 return false;
1093 }
1094 return true;
1099 double fVal = rtl::math::approxFloor( GetDouble());
1100 if (!CheckStringPositionArgument( fVal))
1101 {
1102 fVal = -1.0;
1103 SetError( FormulaError::IllegalArgument);
1104 }
1105 return static_cast<sal_Int32>(fVal);
1108inline bool ScInterpreter::CheckStringResultLen( OUString& rResult, sal_Int32 nIncrease )
1110 if (nIncrease > kScInterpreterMaxStrLen - rResult.getLength())
1111 {
1112 SetError( FormulaError::StringOverflow );
1113 rResult.clear();
1114 return false;
1115 }
1116 return true;
1119inline bool ScInterpreter::CheckStringResultLen( OUStringBuffer& rResult, sal_Int32 nIncrease )
1121 if (nIncrease > kScInterpreterMaxStrLen - rResult.getLength())
1122 {
1123 SetError( FormulaError::StringOverflow );
1124 rResult.setLength(0);
1125 return false;
1126 }
1127 return true;
1130inline void ScInterpreter::TreatDoubleError( double& rVal )
1132 if ( !std::isfinite( rVal ) )
1133 {
1134 FormulaError nErr = GetDoubleErrorValue( rVal );
1135 if ( nErr != FormulaError::NONE )
1136 SetError( nErr );
1137 else
1138 SetError( FormulaError::NoValue );
1139 rVal = 0.0;
1140 }
1143inline double ScInterpreter::div( const double& fNumerator, const double& fDenominator )
1145 return sc::div(fNumerator, fDenominator);
1148inline sal_Int16 ScInterpreter::GetDayOfWeek( sal_Int32 n )
1149{ // monday = 0, ..., sunday = 6
1150 return static_cast< sal_Int16 >( ( n - 1 ) % 7 );
1153/* 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:765
static void SetGlobalConfig(const ScCalcConfig &rConfig)
Definition: interpr4.cxx:3885
void ScDevSq()
Definition: interpr3.cxx:4432
void ScSumX2MY2()
Definition: interpr5.cxx:1716
void ScNormDist(int nMinParamCount)
Definition: interpr3.cxx:1546
sal_uInt32 nCurFmtIndex
Definition: interpre.hxx:202
void ScStDev(bool bTextAsZero=false)
Definition: interpr1.cxx:4206
sal_uLong GetRetFormatIndex() const
Definition: interpre.hxx:1020
void ScSubstitute()
Definition: interpr1.cxx:9807
void ScSumXMY2()
Definition: interpr5.cxx:1766
void SetError(FormulaError nError)
Definition: interpre.hxx:1007
void ScProduct()
Definition: interpr6.cxx:963
void ScAveDev()
Definition: interpr3.cxx:4274
void ScMatDet()
Definition: interpr5.cxx:904
void ScTableOp()
Definition: interpr4.cxx:3586
bool bMatrixFormula
Definition: interpre.hxx:211
void ScIsOdd()
Definition: interpr1.cxx:3145
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:162
void ScLarge()
Definition: interpr3.cxx:3715
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:1779
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:59
void ScFisherInv()
Definition: interpr3.cxx:1159
void ScCosecant()
Definition: interpr1.cxx:1945
void CalculateLookup(bool bHLookup)
Definition: interpr1.cxx:7314
svl::SharedString GetString()
Definition: interpr4.cxx:2322
static double ScGetPV(double fRate, double fNper, double fPmt, double fFv, bool bPayInAdvance)
Definition: interpr2.cxx:1611
void ScLookup()
Definition: interpr1.cxx:6657
static double gauss(double x)
Definition: interpr3.cxx:215
void ScGetDiffDate()
Definition: interpr2.cxx:660
void ScLogGamma()
Definition: interpr3.cxx:791
void ScRoman()
Definition: interpr2.cxx:2977
void ScExpDist()
Definition: interpr3.cxx:1615
void ScGetIsoWeekOfYear()
Definition: interpr2.cxx:292
void ScForecast()
Definition: interpr3.cxx:4717
bool IsInArrayContext() const
Definition: interpre.hxx:1023
void ScTanHyp()
Definition: interpr1.cxx:1903
void ScIsEven()
Definition: interpr1.cxx:3140
static bool RateIteration(double fNper, double fPayment, double fPv, double fFv, bool bPayType, double &fGuess)
Definition: interpr2.cxx:1987
void ScDBCount()
Definition: interpr1.cxx:7996
bool ConvertMatrixParameters()
Definition: interpr4.cxx:1456
void ScFloor_Precise()
Definition: interpr2.cxx:1187
static ScCalcConfig * mpGlobalConfig
Definition: interpre.hxx:176
void ScArcSin()
Definition: interpr1.cxx:1873
void ScGetPivotData()
Definition: interpr2.cxx:3486
void ScIsErr()
Definition: interpr1.cxx:2924
void ScLCM()
Definition: interpr5.cxx:188
void ScIsFormula()
Definition: interpr1.cxx:2720
void ScISPMT()
Definition: interpr2.cxx:1594
void ScColRowNameAuto()
Definition: interpr4.cxx:3693
FormulaError GetWeekendAndHolidayMasks(const sal_uInt8 nParamCount, const sal_uInt32 nNullDate, ::std::vector< double > &rSortArray, bool bWeekendMask[7])
Definition: interpr2.cxx:342
void ScSheets()
Definition: interpr1.cxx:4361
void ScGetDateDif()
Definition: interpr2.cxx:761
void ScCritBinom()
Definition: interpr3.cxx:1410
void ScPlusMinus()
Definition: interpr2.cxx:932
static bool CheckStringPositionArgument(double &fVal)
Check if a double is suitable as string position or length argument.
Definition: interpre.hxx:1077
void ScChiSqInv()
Definition: interpr3.cxx:2403
void ScSearch()
Definition: interpr1.cxx:9449
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:2209
void ScMaxIfs_MS()
Definition: interpr1.cxx:6640
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:2529
bool MustHaveParamCount(short nAct, short nMust)
Definition: interpre.hxx:1047
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:1754
void ScStdNormDist_MS()
Definition: interpr3.cxx:1601
ScMatrixRef PopMatrix()
Definition: interpr4.cxx:1630
void ScGetHour()
Definition: interpr2.cxx:159
void ScDBStdDev()
Definition: interpr1.cxx:8145
void DoubleRefToVars(const formula::FormulaToken *p, SCCOL &rCol1, SCROW &rRow1, SCTAB &rTab1, SCCOL &rCol2, SCROW &rRow2, SCTAB &rTab2)
Definition: interpr4.cxx:943
void ScHLookup()
Definition: interpr1.cxx:7309
void ScIntercept()
Definition: interpr3.cxx:4712
void PopExternalSingleRef(sal_uInt16 &rFileId, OUString &rTabName, ScSingleRefData &rRef)
Definition: interpr4.cxx:1140
bool MustHaveParamCountMin(short nAct, short nMin)
Definition: interpre.hxx:1069
sal_Int32 GetStringPositionArgument()
Obtain a sal_Int32 suitable as string position or length argument.
Definition: interpre.hxx:1097
ScAddress aPos
Definition: interpre.hxx:183
ScDocument & mrDoc
Definition: interpre.hxx:186
bool FillEntry(ScQueryEntry &rEntry)
Definition: interpr1.cxx:7579
static FormulaError GetCellErrCode(const ScRefCellValue &rCell)
Definition: interpr4.cxx:157
void ScErrorType_ODF()
Definition: interpr1.cxx:9983
void PushExternalDoubleRef(sal_uInt16 nFileId, const OUString &rTabName, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2)
Definition: interpr4.cxx:1857
SubtotalFlags mnSubTotalFlags
Definition: interpre.hxx:208
static const double fMaxGammaArgument
Definition: interpre.hxx:983
void ScPermutationA()
Definition: interpr3.cxx:1219
bool GetBool()
Definition: interpre.hxx:433
void ScDBMin()
Definition: interpr1.cxx:8094
void AssertFormulaMatrix()
Definition: interpr4.cxx:4777
ScDBRangeBase * PopDBDoubleRef()
Definition: interpr4.cxx:961
void ScColor()
Definition: interpr7.cxx:512
void ScDBAverage()
Definition: interpr1.cxx:8084
void CurFmtToFuncFmt()
Definition: interpre.hxx:453
void CalculateSkewOrSkewp(bool bSkewp)
Definition: interpr3.cxx:3316
void PushIllegalParameter()
Definition: interpr4.cxx:1926
void ScIsValue()
Definition: interpr1.cxx:2649
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:2262
void ScCotHyp()
Definition: interpr1.cxx:1908
static ScCalcConfig & GetOrCreateGlobalConfig()
Definition: interpr4.cxx:3878
FormulaError nGlobalError
Definition: interpre.hxx:198
void PushIllegalArgument()
Definition: interpr4.cxx:1931
sal_Int16 GetInt16()
if GetDouble() not within int16 limits sets nGlobalError and returns SAL_MAX_INT16
Definition: interpr4.cxx:2217
void ScWebservice()
Definition: interpr7.cxx:274
void ScInt()
Definition: interpr2.cxx:948
bool CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8 *pCellArr)
Definition: interpr4.cxx:279
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:3960
void ScRoundDown()
Definition: interpr2.cxx:991
void ScMatch()
Definition: interpr1.cxx:4803
void ScLessEqual()
Definition: interpr1.cxx:1234
void ScTDist_T(int nTails)
Definition: interpr3.cxx:1656
void ScNumberValue()
Definition: interpr1.cxx:3378
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:7643
void DoubleRefToRange(const ScComplexRefData &, ScRange &, bool bDontCheckForTableOp=false)
Definition: interpr4.cxx:1025
void ScSearchB()
Definition: interpr1.cxx:9368
void ScCosHyp()
Definition: interpr1.cxx:1898
void ScMax(bool bTextAsZero=false)
Definition: interpr1.cxx:3806
void ScCeil_Precise()
Definition: interpr2.cxx:1096
void PushDoubleRef(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2)
Definition: interpr4.cxx:1834
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:599
void ScCountIf()
Definition: interpr1.cxx:5648
void ScLogNormInv()
Definition: interpr3.cxx:2143
std::vector< double > GetTopNumberArray(SCSIZE &rCol, SCSIZE &rRow)
Definition: interpr3.cxx:3849
void ScErf()
Definition: interpr7.cxx:498
static void RoundSignificant(double fX, double fDigits, double &fRes)
Definition: interpr2.cxx:1001
void PushExternalSingleRef(sal_uInt16 nFileId, const OUString &rTabName, SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: interpr4.cxx:1845
void CalculateMatrixValue(const ScMatrix *pMat, SCSIZE nC, SCSIZE nR)
Definition: interpr5.cxx:692
sal_uInt8 cPar
Definition: interpre.hxx:209
void ScGetDiffDate360()
Definition: interpr2.cxx:670
void ScIsRef()
Definition: interpr1.cxx:2597
formula::StackVar GetResultType() const
Definition: interpre.hxx:1015
void ReplaceCell(ScAddress &)
Definition: interpr4.cxx:87
const svl::SharedString & GetStringResult() const
Definition: interpr4.cxx:4782
void CalculateRGPRKP(bool _bRKP)
Definition: interpr5.cxx:2326
void ScGetActDate()
Definition: interpr2.cxx:99
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:3623
void ScModalValue()
Definition: interpr3.cxx:3505
void ScRank(bool bAverage)
Definition: interpr3.cxx:4211
formula::StackVar GetRawStackType()
Raw stack type without default replacements.
Definition: interpr4.cxx:1951
svl::SharedString GetStringFromDouble(const double fVal)
Definition: interpr4.cxx:2484
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:2142
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:986
void ScGetDate()
Definition: interpr2.cxx:627
SvNumFormatType nFuncFmtType
Definition: interpre.hxx:204
void ScGrowth()
Definition: interpr5.cxx:2845
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:2005
void ScLog10()
Definition: interpr2.cxx:1261
void ScProbability()
Definition: interpr3.cxx:4441
void ScIsEmpty()
Definition: interpr1.cxx:1979
void ScMatValue()
Definition: interpr5.cxx:614
sal_uInt32 GetUInt32()
if GetDouble() not within uint32 limits sets nGlobalError and returns SAL_MAX_UINT32
Definition: interpr4.cxx:2246
std::unique_ptr< ScDBQueryParamBase > GetDBParams(bool &rMissingField)
Definition: interpr1.cxx:7786
void ScEasterSunday()
Definition: interpr2.cxx:302
void ScDBSum()
Definition: interpr1.cxx:7991
void ScGetWeekOfYear()
Definition: interpr2.cxx:246
void ScReplaceB()
Definition: interpr1.cxx:9311
double GetValueCellValue(const ScAddress &, double fOrig)
Only ValueCell, formula cells already store the result rounded.
Definition: interpr4.cxx:147
void ScPower()
Definition: interpr5.cxx:1595
bool IsTableOpInRange(const ScRange &)
Definition: interpr4.cxx:106
static double integralPhi(double x)
Definition: interpr3.cxx:200
void ScDBProduct()
Definition: interpr1.cxx:8099
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:812
const ScComplexRefData * GetStackDoubleRef(size_t rRefInList=0)
Definition: interpr4.cxx:1117
void GetCellString(svl::SharedString &rStr, ScRefCellValue &rCell)
Definition: interpr4.cxx:244
void ScCumPrinc()
Definition: interpr2.cxx:2244
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:1341
void ScTrend()
Definition: interpr5.cxx:2840
bool CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8 *pCellArr)
Definition: interpr4.cxx:362
void ScTextJoin_MS()
Definition: interpr8.cxx:1507
void ValidateRef(const ScSingleRefData &rRef)
Definition: interpr4.cxx:840
void ScGreaterEqual()
Definition: interpr1.cxx:1251
void ScWeibull()
Definition: interpr3.cxx:1763
VolatileType meVolatileType
Definition: interpre.hxx:213
void ScSmall()
Definition: interpr3.cxx:3720
void GetExternalDoubleRef(sal_uInt16 nFileId, const OUString &rTabName, const ScComplexRefData &aData, ScExternalRefCache::TokenArrayRef &rArray)
Definition: interpr4.cxx:1283
double GetCellValueOrZero(const ScAddress &, ScRefCellValue &rCell)
Definition: interpr4.cxx:187
void PushError(FormulaError nError)
Definition: interpr4.cxx:1915
void PopRefListPushMatrixOrRef()
Definition: interpr4.cxx:1377
sal_uInt8 GetByte() const
Definition: interpre.hxx:415
ScMatrixRef QueryMat(const ScMatrixRef &pMat, sc::CompareOptions &rOptions)
Definition: interpr1.cxx:1144
void ScGetActTime()
Definition: interpr2.cxx:107
double GetDoubleFromMatrix(const ScMatrixRef &pMat)
Definition: interpr4.cxx:2044
const formula::FormulaConstTokenRef & GetResultToken() const
Definition: interpre.hxx:1018
FormulaError GetWeekendAndHolidayMasks_MS(const sal_uInt8 nParamCount, const sal_uInt32 nNullDate, ::std::vector< double > &rSortArray, bool bWeekendMask[7], bool bWorkdayFunction)
Definition: interpr2.cxx:382
static const ScCalcConfig & GetGlobalConfig()
Definition: interpr4.cxx:3890
sal_Int32 GetInt32WithDefault(sal_Int32 nDefault)
if GetDoubleWithDefault() not within int32 limits sets nGlobalError and returns SAL_MAX_INT32
Definition: interpr4.cxx:2208
void ScGCD()
Definition: interpr5.cxx:114
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:583
void ScUnionFunc()
Definition: interpr2.cxx:2507
void ScForecast_Ets(ScETSType eETSType)
Definition: interpr8.cxx:1175
void CalculatePearsonCovar(bool _bPearson, bool _bStexy, bool _bSample)
Definition: interpr3.cxx:4523
void ScEffect()
Definition: interpr2.cxx:2283
bool CheckStringResultLen(OUString &rResult, sal_Int32 nIncrease)
Definition: interpre.hxx:1108
void Init(ScFormulaCell *pCell, const ScAddress &rPos, ScTokenArray &rTokArray)
Definition: interpr4.cxx:3854
void ScMultiArea()
Definition: interpr1.cxx:8864
double GetBeta(double fAlpha, double fBeta)
Definition: interpr3.cxx:800
void ScModalValue_MS(bool bSingle)
Definition: interpr3.cxx:3549
void ScWeeknumOOo()
Definition: interpr2.cxx:234
ScMatrixRef GetNewMat(SCSIZE nC, SCSIZE nR, bool bEmpty=false)
Definition: interpr5.cxx:283
void ScCovarianceS()
Definition: interpr3.cxx:4513
void ScMedian()
Definition: interpr3.cxx:3390
void PopDoubleRefPushMatrix()
Definition: interpr4.cxx:1363
static double ScGetPMT(double fRate, double fNper, double fPv, double fFv, bool bPayInAdvance)
Definition: interpr2.cxx:1886
static void MEMat(const ScMatrixRef &mM, SCSIZE n)
Definition: interpr5.cxx:738
ScMatValType GetDoubleOrStringFromMatrix(double &rDouble, svl::SharedString &rString)
Definition: interpr4.cxx:2423
double GetTInv(double fAlpha, double fSize, int nType)
Definition: interpr3.cxx:2288
double GetDouble()
Definition: interpr4.cxx:2085
void ScCountIfs()
Definition: interpr1.cxx:6605
bool LookupQueryWithCache(ScAddress &o_rResultPos, const ScQueryParam &rParam, const ScComplexRefData *refData) const
Definition: interpr1.cxx:10147
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:686
void ScFisher()
Definition: interpr3.cxx:1150
void ScGetTimeValue()
Definition: interpr2.cxx:910
void ScDBGet()
Definition: interpr4.cxx:2494
sal_uInt16 maxsp
Definition: interpre.hxx:200
void ScAverage(bool bTextAsZero=false)
Definition: interpr6.cxx:968
void ScGetMin()
Definition: interpr2.cxx:140
void ScIndirect()
Definition: interpr1.cxx:8173
double GetNumResult() const
Definition: interpre.hxx:1017
static double GetLogBeta(double fAlpha, double fBeta)
Definition: interpr3.cxx:833
void ScSumX2DY2()
Definition: interpr5.cxx:1761
static double ScGetDDB(double fCost, double fSalvage, double fLife, double fPeriod, double fFactor)
Definition: interpr2.cxx:1660
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:3594
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:187
void ScSumIf()
Definition: interpr1.cxx:5638
SvNumFormatType GetRetFormatType() const
Definition: interpre.hxx:1019
void IterateParametersIfs(double(*ResultFunc)(const sc::ParamIfsResult &rRes))
Definition: interpr1.cxx:5857
ScTokenMatrixMap & GetTokenMatrixMap()
Definition: interpre.hxx:1042
void ScVLookup()
Definition: interpr1.cxx:7638
void ConvertMatrixJumpConditionToMatrix()
Definition: interpr4.cxx:1437
double Fakultaet(double x)
Definition: interpr3.cxx:439
void PushDouble(double nVal)
Definition: interpr4.cxx:1789
void IterateParameters(ScIterFunc, bool bTextAsZero=false)
Definition: interpr6.cxx:460
void ScGetDay()
Definition: interpr2.cxx:133
void ScMatInv()
Definition: interpr5.cxx:951
void ScDebugVar()
Definition: interpr7.cxx:452
void ScDBCount2()
Definition: interpr1.cxx:8054
void ScNominal()
Definition: interpr2.cxx:2302
void ScHyperLink()
Definition: interpr2.cxx:3118
void ScQuartile(bool bInclusive)
Definition: interpr3.cxx:3482
void ScLinest()
Definition: interpr5.cxx:2315
void ScFrequency()
Definition: interpr5.cxx:1798
sc::RangeMatrix PopRangeMatrix()
Definition: interpr4.cxx:1662
const formula::FormulaToken ** pStack
Definition: interpre.hxx:197
void ScFTest()
Definition: interpr3.cxx:2730
void ScMatTrans()
Definition: interpr5.cxx:1112
void ScCountEmptyCells()
Definition: interpr1.cxx:5153
void QueryMatrixType(const ScMatrixRef &xMat, SvNumFormatType &rRetTypeExpr, sal_uInt32 &rRetIndexExpr)
Definition: interpr4.cxx:1702
static void GlobalExit()
Definition: interpr4.cxx:3901
void PopSingleRef(ScAddress &)
Definition: interpr4.cxx:906
void ScStyle()
Definition: interpr2.cxx:2592
void ScArcCot()
Definition: interpr1.cxx:1888
double PopDouble()
Definition: interpr4.cxx:780
void ReverseStack(sal_uInt8 nParamCount)
Definition: interpr4.cxx:1997
void ScGreater()
Definition: interpr1.cxx:1217
ScTokenMatrixMap maTokenMatrixMap
Definition: interpre.hxx:191
void MergeCalcConfig()
Merge global and document specific settings.
Definition: interpr4.cxx:3895
ScTokenArray * pArr
Definition: interpre.hxx:184
void ScDBMax()
Definition: interpr1.cxx:8089
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:2898
double Compare(ScQueryOp eOp)
Definition: interpr1.cxx:885
void ScEMat()
Definition: interpr5.cxx:715
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:2487
void ScVar(bool bTextAsZero=false)
Definition: interpr1.cxx:4184
void PushTempTokenWithoutError(const formula::FormulaToken *)
Does not substitute with formula::FormulaErrorToken in case nGlobalError is set.
Definition: interpr4.cxx:646
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:1143
ScMatrixRef GetMatrix()
Definition: interpr5.cxx:463
static sal_Int16 GetDayOfWeek(sal_Int32 n)
Definition: interpre.hxx:1148
void MatrixJumpConditionToMatrix()
Definition: interpre.hxx:1028
void ScBadName()
Definition: interpr3.cxx:185
void ScIndex()
Definition: interpr1.cxx:8659
void MakeMatNew(ScMatrixRef &rMat, SCSIZE nC, SCSIZE nR)
Definition: interpr5.cxx:268
void ScGetDateValue()
Definition: interpr2.cxx:167
void PushParameterExpected()
Definition: interpr4.cxx:1921
void ScGetYear()
Definition: interpr2.cxx:119
void ScConfidence()
Definition: interpr3.cxx:2423
void ScConcat()
Definition: interpr1.cxx:9878
void ScDBArea()
Definition: interpr4.cxx:3676
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:1130
void ScGetTime()
Definition: interpr2.cxx:644
void ScArcCosHyp()
Definition: interpr1.cxx:1918
void CalculateTrendGrowth(bool _bGrowth)
Definition: interpr5.cxx:2850
void GetDBStVarParams(double &rVal, double &rValCount)
Definition: interpr1.cxx:8104
void ScFDist()
Definition: interpr3.cxx:1689
void ScCurrency()
Definition: interpr1.cxx:8913
void ScRightB()
Definition: interpr1.cxx:9221
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:1738
ScJumpMatrix * pJumpMatrix
Definition: interpre.hxx:190
void CalculateAddSub(bool _bSub)
Definition: interpr5.cxx:1216
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:460
sfx2::LinkManager * mpLinkManager
Definition: interpre.hxx:187
sal_Int32 double_to_int32(double fVal)
Definition: interpr4.cxx:2175
void ScFormula()
Definition: interpr1.cxx:2789
void ScOffset()
Definition: interpr1.cxx:8497
void ScMatRef()
Definition: interpr5.cxx:3148
void ScMissing()
Definition: interpr4.cxx:3110
void ScDBStdDevP()
Definition: interpr1.cxx:8152
void ScEqual()
Definition: interpr1.cxx:1166
sal_uInt32 nFuncFmtIndex
Definition: interpre.hxx:201
void ScGetSec()
Definition: interpr2.cxx:148
void ScSkewp()
Definition: interpr3.cxx:3361
FormulaError GetError() const
Definition: interpre.hxx:1014
void ScConfidenceT()
Definition: interpr3.cxx:2437
sal_uInt32 GetCellNumberFormat(const ScAddress &rPos, ScRefCellValue &rCell)
Definition: interpr4.cxx:124
void ScWorkday_MS()
Definition: interpr2.cxx:555
void PopDoubleRef(ScRange &rRange, short &rParam, size_t &rRefInList)
If formula::StackVar formula::svDoubleRef pop ScDoubleRefToken and return values of ScComplexRefData.
Definition: interpr4.cxx:1043
void ScIsNonString()
Definition: interpr1.cxx:2106
double GetTDist(double T, double fDF, int nType)
Definition: interpr3.cxx:648
void ScArabic()
Definition: interpr2.cxx:3061
void PushTokenRef(const formula::FormulaConstTokenRef &)
Pushes the token or substitutes with formula::FormulaErrorToken in case nGlobalError is set and the t...
Definition: interpr4.cxx:666
void IterateParametersIf(ScIterFuncIf)
Definition: interpr1.cxx:5233
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:2321
void GetStVarParams(bool bTextAsZero, double(*VarResult)(double fVal, size_t nValCount))
Definition: interpr1.cxx:3963
void PushMatrix(const sc::RangeMatrix &rMat)
Definition: interpr4.cxx:1890
void GetNumberSequenceArray(sal_uInt8 nParamCount, ::std::vector< double > &rArray, bool bConvertTextInArray)
Definition: interpr3.cxx:3934
void ScFInv_LT()
Definition: interpr3.cxx:2333
void ScSumIfs()
Definition: interpr1.cxx:6570
static double ScGetFV(double fRate, double fNper, double fPmt, double fPv, bool bPayInAdvance)
Definition: interpr2.cxx:1933
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:10057
void ScChiSqDist()
Definition: interpr3.cxx:727
void ScPDuration()
Definition: interpr2.cxx:1860
void ScCosecantHyp()
Definition: interpr1.cxx:1955
void ScGammaDist(bool bODFF)
Definition: interpr3.cxx:2091
void ScTrimMean()
Definition: interpr3.cxx:3820
void CalculateSlopeIntercept(bool bSlope)
Definition: interpr3.cxx:4637
void ScVarP(bool bTextAsZero=false)
Definition: interpr1.cxx:4196
void ScCeil(bool bODFF)
tdf69552 ODFF1.2 function CEILING and Excel function CEILING.MATH In essence, the difference between ...
Definition: interpr2.cxx:1038
void ScCombin()
Definition: interpr3.cxx:1173
void ScGetMonth()
Definition: interpr2.cxx:126
static double phi(double x)
Definition: interpr3.cxx:195
void ScCovarianceP()
Definition: interpr3.cxx:4508
void PopError()
Definition: interpr4.cxx:753
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:3248
void ScDBVarP()
Definition: interpr1.cxx:8166
void ScGauss()
Definition: interpr3.cxx:1145
void ScExact()
Definition: interpr1.cxx:9096
void ScReplace()
Definition: interpr1.cxx:8970
void ScColumn()
Definition: interpr1.cxx:4408
void ScRegex()
Definition: interpr1.cxx:9495
void ScUpper()
Definition: interpr1.cxx:3183
void ScCumIpmt()
Definition: interpr2.cxx:2203
void PopExternalDoubleRef(sal_uInt16 &rFileId, OUString &rTabName, ScComplexRefData &rRef)
Definition: interpr4.cxx:1219
static void QuickSort(::std::vector< double > &rSortArray, ::std::vector< tools::Long > *pIndexOrder)
Definition: interpr3.cxx:4184
void ScArcCos()
Definition: interpr1.cxx:1878
double GetCellValue(const ScAddress &, ScRefCellValue &rCell)
Definition: interpr4.cxx:177
bool MatrixParameterConversion()
Definition: interpre.hxx:1034
void ScRandbetween()
Definition: interpr1.cxx:1809
void ScCellExternal()
Definition: interpr1.cxx:2456
void PushTempToken(formula::FormulaToken *)
Does substitute with formula::FormulaErrorToken in case nGlobalError is set and the token passed is n...
Definition: interpr4.cxx:617
void ScAreas()
Definition: interpr1.cxx:8877
void ScSumProduct()
Definition: interpr5.cxx:1655
ScTokenStack * pStackObj
Definition: interpre.hxx:196
void ScConvertOOo()
Definition: interpr2.cxx:2954
void ScCeil_MS()
Definition: interpr2.cxx:1078
void ScFilterXML()
Definition: interpr7.cxx:39
void ScStDevP(bool bTextAsZero=false)
Definition: interpr1.cxx:4218
void ScSecant()
Definition: interpr1.cxx:1950
void PushSingleRef(SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: interpr4.cxx:1824
void ScFourier()
Definition: interpr3.cxx:5475
void ScMinIfs_MS()
Definition: interpr1.cxx:6622
VolatileType GetVolatileType() const
Definition: interpre.hxx:172
void ScAverageIf()
Definition: interpr1.cxx:5643
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:600
void ScMin(bool bTextAsZero=false)
Definition: interpr1.cxx:3649
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:943
void ScNetWorkdays(bool bOOXML_Version)
Definition: interpr2.cxx:499
void ScBetaDist()
Definition: interpr3.cxx:1036
void ScProper()
Definition: interpr1.cxx:3189
void PushNoValue()
Definition: interpr4.cxx:1941
void ScTDist()
Definition: interpr3.cxx:1641
void SingleRefToVars(const ScSingleRefData &rRef, SCCOL &rCol, SCROW &rRow, SCTAB &rTab)
Definition: interpr4.cxx:862
void ScArcTan2()
Definition: interpr2.cxx:1228
bool IfErrorPushError()
If nGlobalError is set push formula::FormulaErrorToken.
Definition: interpre.hxx:292
void GetSortArray(sal_uInt8 nParamCount, ::std::vector< double > &rSortArray, ::std::vector< tools::Long > *pIndexOrder, bool bConvertTextInArray, bool bAllowEmptyArray)
Definition: interpr3.cxx:4117
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:2987
double GetBetaDist(double x, double alpha, double beta)
Definition: interpr3.cxx:985
void ScMacro()
Definition: interpr4.cxx:3207
void ScValue()
Definition: interpr1.cxx:3299
void ScLeftB()
Definition: interpr1.cxx:9270
double GetDoubleWithDefault(double nDefault)
Definition: interpr4.cxx:2166
void ScFloor(bool bODFF)
tdf69552 ODFF1.2 function FLOOR and Excel function FLOOR.MATH In essence, the difference between the ...
Definition: interpr2.cxx:1126
void ScSlope()
Definition: interpr3.cxx:4707
void ScLower()
Definition: interpr1.cxx:3213
void ScBetaInv()
Definition: interpr3.cxx:2212
void ScChiSqDist_MS()
Definition: interpr3.cxx:750
bool IsMissing() const
Definition: interpr4.cxx:1946
static double GetPercentile(::std::vector< double > &rArray, double fPercentile)
Definition: interpr3.cxx:3400
void ScErrorType()
Definition: interpr1.cxx:9969
void ScChiInv()
Definition: interpr3.cxx:2368
void ScPearson()
Definition: interpr3.cxx:4518
ScMatrixRef MatConcat(const ScMatrixRef &pMat1, const ScMatrixRef &pMat2)
Definition: interpr5.cxx:1167
void ScIfError(bool bNAonly)
Definition: interpr1.cxx:249
void ScRoundSignificant()
Definition: interpr2.cxx:1008
sal_Int32 GetInt32()
if GetDouble() not within int32 limits sets nGlobalError and returns SAL_MAX_INT32
Definition: interpr4.cxx:2203
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:1966
void ScRight()
Definition: interpr1.cxx:9413
formula::FormulaConstTokenRef xResult
Definition: interpre.hxx:189
static double GetPercentrank(::std::vector< double > &rArray, double fVal, bool bInclusive)
Definition: interpr3.cxx:3763
void ScAmpersand()
Definition: interpr5.cxx:1344
void ScArcTan()
Definition: interpr1.cxx:1883
void ScFloor_MS()
Definition: interpr2.cxx:1166
svl::SharedStringPool & mrStrPool
Definition: interpre.hxx:188
void ScAddressFunc()
Definition: interpr1.cxx:8395
void ScAggregate()
Definition: interpr1.cxx:7690
static double ScGetGCD(double fx, double fy)
Definition: interpr5.cxx:93
svl::SharedString GetStringFromMatrix(const ScMatrixRef &pMat)
Definition: interpr4.cxx:2401
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:1796
void ScColumns()
Definition: interpr1.cxx:4247
void ScCombinA()
Definition: interpr3.cxx:1186
SvNumFormatType nCurFmtType
Definition: interpre.hxx:205
void CalculateSumX2MY2SumX2DY2(bool _bSumX2DY2)
Definition: interpr5.cxx:1720
static double gaussinv(double x)
Definition: interpr3.cxx:268
void ScNotEqual()
Definition: interpr1.cxx:1183
void ScSheet()
Definition: interpr1.cxx:4615
void ScAverageIfs()
Definition: interpr1.cxx:6588
void SetLinkManager(sfx2::LinkManager *pLinkMgr)
Definition: interpre.hxx:1011
SvNumFormatType nRetFmtType
Definition: interpre.hxx:206
void ScFixed()
Definition: interpr1.cxx:9007
void ScCorrel()
Definition: interpr3.cxx:4502
void ScRoundUp()
Definition: interpr2.cxx:996
void PushString(const OUString &rStr)
Definition: interpr4.cxx:1813
void DBIterator(ScIterFunc)
Definition: interpr1.cxx:7924
void RoundNumber(rtl_math_RoundingMode eMode)
Definition: interpr2.cxx:953
void PushStringBuffer(const sal_Unicode *pString)
Definition: interpr4.cxx:1802
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:301
void ScFindB()
Definition: interpr1.cxx:9334
void ScPercentrank(bool bInclusive)
Definition: interpr3.cxx:3725
void ScClean()
Definition: interpr1.cxx:3480
sal_uInt16 sp
Definition: interpre.hxx:199
void ScArcTanHyp()
Definition: interpr1.cxx:1927
void ScDBVar()
Definition: interpr1.cxx:8159
void ScSTEYX()
Definition: interpr3.cxx:4633
void ScPermut()
Definition: interpr3.cxx:1199
void ScBahtText()
Definition: interpr2.cxx:3419
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:3608
void ScSwitch_MS()
Definition: interpr8.cxx:1897
ScInterpreter(ScFormulaCell *pCell, ScDocument &rDoc, ScInterpreterContext &rContext, const ScAddress &, ScTokenArray &, bool bForGroupThreading=false)
Definition: interpr4.cxx:3791
void ScIntersect()
Definition: interpr2.cxx:2340
void ScMatMult()
Definition: interpr5.cxx:1063
FormulaError GetErrorType()
Definition: interpr1.cxx:9897
void ScCurrent()
Definition: interpr2.cxx:2580
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 GetDoubleErrorValue(double fVal)
Definition: global.hxx:239
Definition: global.hxx:833
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
Definition: interpre.hxx:102
@ ifCOUNT2
Definition: interpre.hxx:108
@ ifMIN
Definition: interpre.hxx:109
Definition: interpre.hxx:107
Definition: interpre.hxx:105
@ ifSUM
Definition: interpre.hxx:103
Definition: interpre.hxx:104
Definition: interpre.hxx:106
@ ifMAX
Definition: interpre.hxx:110
::std::map< const formula::FormulaConstTokenRef, formula::FormulaConstTokenRef, FormulaTokenRef_less > ScTokenMatrixMap
Definition: interpre.hxx:135
Definition: interpre.hxx:114
Definition: interpre.hxx:115
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.
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.
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
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