LibreOffice Module sc (master) 1
Classes | Typedefs | Functions | Variables
interpr3.cxx File Reference
#include <tools/solar.h>
#include <stdlib.h>
#include <interpre.hxx>
#include <global.hxx>
#include <document.hxx>
#include <dociter.hxx>
#include <matrixoperators.hxx>
#include <scmatrix.hxx>
#include <cassert>
#include <cmath>
#include <memory>
#include <set>
#include <vector>
#include <algorithm>
#include <comphelper/random.hxx>
#include <o3tl/float_int_conversion.hxx>
#include <osl/diagnose.h>
Include dependency graph for interpr3.cxx:

Go to the source code of this file.

Classes

class  ScGammaDistFunction
 
class  ScBetaDistFunction
 
class  ScTDistFunction
 
class  ScFDistFunction
 
class  ScChiDistFunction
 
class  ScChiSqDistFunction
 

Typedefs

using ScMatrixGenerator = ScMatrixRef(SCSIZE, SCSIZE, std::vector< double > &)
 

Functions

static size_t MAX_COUNT_DOUBLE_FOR_SORT (const ScSheetLimits &rSheetLimits)
 Two columns of data should be sortable with GetSortArray() and QuickSort() More...
 
static bool lcl_HasChangeOfSign (double u, double w)
 u*w<0.0 fails for values near zero More...
 
static double lcl_IterateInverse (const ScDistFunc &rFunction, double fAx, double fBx, bool &rConvError)
 
static double lcl_getLanczosSum (double fZ)
 you must ensure fZ>0 Uses a variant of the Lanczos sum with a rational function. More...
 
static double lcl_GetGammaHelper (double fZ)
 You must ensure fZ>0; fZ>171.624376956302 will overflow. More...
 
static double lcl_GetLogGammaHelper (double fZ)
 You must ensure fZ>0. More...
 
static double lcl_GetBetaHelperContFrac (double fX, double fA, double fB)
 
static double lcl_GetBinomDistRange (double n, double xs, double xe, double fFactor, double p, double q)
 
static void lcl_PutFactorialElements (::std::vector< double > &cn, double fLower, double fUpper, double fBase)
 Local function used in the calculation of the hypergeometric distribution. More...
 
static void lcl_QuickSort (tools::Long nLo, tools::Long nHi, vector< double > &rSortArray, vector< tools::Long > *pIndexOrder)
 
static void lcl_roundUpNearestPow2 (SCSIZE &nNum, SCSIZE &nNumBits)
 
static SCSIZE lcl_bitReverse (SCSIZE nIn, SCSIZE nBound)
 
static void lcl_normalize (std::vector< double > &rCmplxArray, bool bScaleOnlyReal)
 
static void lcl_convertToPolar (std::vector< double > &rCmplxArray, double fMinMag)
 

Variables

const double fMachEps = ::std::numeric_limits<double>::epsilon()
 

Typedef Documentation

◆ ScMatrixGenerator

using ScMatrixGenerator = ScMatrixRef(SCSIZE, SCSIZE, std::vector<double>&)

Definition at line 5435 of file interpr3.cxx.

Function Documentation

◆ lcl_bitReverse()

static SCSIZE lcl_bitReverse ( SCSIZE  nIn,
SCSIZE  nBound 
)
static

Definition at line 4834 of file interpr3.cxx.

◆ lcl_convertToPolar()

static void lcl_convertToPolar ( std::vector< double > &  rCmplxArray,
double  fMinMag 
)
static

Definition at line 5126 of file interpr3.cxx.

◆ lcl_GetBetaHelperContFrac()

static double lcl_GetBetaHelperContFrac ( double  fX,
double  fA,
double  fB 
)
static

Definition at line 937 of file interpr3.cxx.

References fMachEps.

Referenced by ScInterpreter::GetBetaDist().

◆ lcl_GetBinomDistRange()

static double lcl_GetBinomDistRange ( double  n,
double  xs,
double  xe,
double  fFactor,
double  p,
double  q 
)
static

Definition at line 1260 of file interpr3.cxx.

References KahanSum::get(), i, n, and p.

Referenced by ScInterpreter::ScB(), and ScInterpreter::ScBinomDist().

◆ lcl_GetGammaHelper()

static double lcl_GetGammaHelper ( double  fZ)
static

You must ensure fZ>0; fZ>171.624376956302 will overflow.

Definition at line 559 of file interpr3.cxx.

References lcl_getLanczosSum().

Referenced by ScInterpreter::GetGamma(), and ScInterpreter::GetLogGamma().

◆ lcl_getLanczosSum()

static double lcl_getLanczosSum ( double  fZ)
static

you must ensure fZ>0 Uses a variant of the Lanczos sum with a rational function.

Definition at line 491 of file interpr3.cxx.

Referenced by ScInterpreter::GetBeta(), ScInterpreter::GetLogBeta(), lcl_GetGammaHelper(), and lcl_GetLogGammaHelper().

◆ lcl_GetLogGammaHelper()

static double lcl_GetLogGammaHelper ( double  fZ)
static

You must ensure fZ>0.

Definition at line 577 of file interpr3.cxx.

References lcl_getLanczosSum(), and log.

Referenced by ScInterpreter::GetGamma(), and ScInterpreter::GetLogGamma().

◆ lcl_HasChangeOfSign()

static bool lcl_HasChangeOfSign ( double  u,
double  w 
)
static

u*w<0.0 fails for values near zero

Definition at line 71 of file interpr3.cxx.

References u, and w.

Referenced by lcl_IterateInverse().

◆ lcl_IterateInverse()

static double lcl_IterateInverse ( const ScDistFunc &  rFunction,
double  fAx,
double  fBx,
bool &  rConvError 
)
static

◆ lcl_normalize()

static void lcl_normalize ( std::vector< double > &  rCmplxArray,
bool  bScaleOnlyReal 
)
static

Definition at line 5109 of file interpr3.cxx.

◆ lcl_PutFactorialElements()

static void lcl_PutFactorialElements ( ::std::vector< double > &  cn,
double  fLower,
double  fUpper,
double  fBase 
)
static

Local function used in the calculation of the hypergeometric distribution.

Definition at line 1834 of file interpr3.cxx.

References i.

Referenced by ScInterpreter::GetHypGeomDist().

◆ lcl_QuickSort()

static void lcl_QuickSort ( tools::Long  nLo,
tools::Long  nHi,
vector< double > &  rSortArray,
vector< tools::Long > *  pIndexOrder 
)
static

Definition at line 4159 of file interpr3.cxx.

References lcl_QuickSort(), and swap().

Referenced by lcl_QuickSort(), and ScInterpreter::QuickSort().

◆ lcl_roundUpNearestPow2()

static void lcl_roundUpNearestPow2 ( SCSIZE nNum,
SCSIZE nNumBits 
)
static

Definition at line 4813 of file interpr3.cxx.

◆ MAX_COUNT_DOUBLE_FOR_SORT()

static size_t MAX_COUNT_DOUBLE_FOR_SORT ( const ScSheetLimits rSheetLimits)
static

Two columns of data should be sortable with GetSortArray() and QuickSort()

Definition at line 45 of file interpr3.cxx.

References ScSheetLimits::GetMaxRowCount().

Referenced by ScInterpreter::GetSortArray().

Variable Documentation

◆ fMachEps

const double fMachEps = ::std::numeric_limits<double>::epsilon()

Definition at line 51 of file interpr3.cxx.

Referenced by lcl_GetBetaHelperContFrac(), and ScInterpreter::ScBinomDist().