Classes | Macros | Typedefs | Functions | Variables
kolmogorov.c File Reference
#include "mconf.h"
#include <float.h>
#include <math.h>
#include <assert.h>
#include "dd_real.h"
Include dependency graph for kolmogorov.c:

Go to the source code of this file.

Classes

struct  ThreeProbs
 

Macros

#define _MAX_EXPONENT   960
 
#define add_dd   dd_add_d_d
 
#define add_DD   dd_add
 
#define add_Dd   dd_add_dd_d
 
#define add_dD   dd_add_d_dd
 
#define CLIP(X, LOW, HIGH)   ((X) < LOW ? LOW : MIN(X, HIGH))
 
#define div_dd   dd_div_d_d
 
#define div_DD   dd_div
 
#define div_Dd   dd_div_dd_d
 
#define div_dD   dd_div_d_dd
 
#define frexpD   dd_frexp
 
#define KOLMOG_CUTOVER   0.82
 
#define ldexpD   dd_ldexp
 
#define log1pD   dd_log1p
 
#define logD   dd_log
 
#define LOGSQRT2PI   0.91893853320467274178032973640561764
 
#define MAX(a, b)   (((a) < (b)) ? (b) : (a))
 
#define MIN(a, b)   (((a) < (b)) ? (a) : (b))
 
#define mul_dd   dd_mul_d_d
 
#define mul_DD   dd_mul
 
#define mul_Dd   dd_mul_dd_d
 
#define mul_dD   dd_mul_d_dd
 
#define neg_D   dd_neg
 
#define RETURN_3PROBS(PSF, PCDF, PDF)
 
#define RETURN_M_E(MAND, EXPT)
 
#define SM_UPPER_MAX_TERMS   3
 
#define SM_UPPERSUM_MIN_N   10
 
#define sub_dd   dd_sub_d_d
 
#define sub_DD   dd_sub
 
#define sub_Dd   dd_sub_dd_d
 
#define sub_dD   dd_sub_d_dd
 
#define valueD   dd_to_double
 

Typedefs

typedef struct ThreeProbs ThreeProbs
 

Functions

static double _kolmogi (double psf, double pcdf)
 
static ThreeProbs _kolmogorov (double x)
 
static ThreeProbs _smirnov (int n, double x)
 
static double _smirnovi (int n, double psf, double pcdf)
 
static int _within_tol (double x, double y, double atol, double rtol)
 
static void computeAv (int n, double x, int v, double2 Cman, int Cexpt, double2 *pt1, double2 *pt2, double2 *pAv)
 
double kolmogc (double x)
 
double kolmogci (double p)
 
double kolmogi (double p)
 
double kolmogorov (double x)
 
double kolmogp (double x)
 
static double logpow4 (double a, double b, double c, double d, int m)
 
static double2 logpow4_D (double a, double b, double c, double d, int m)
 
static double modNX (int n, double x, int *pNXFloor, double *pNX)
 
static double nextPowerOf2 (double x)
 
static double pow2 (double a, double b, int m)
 
static double2 pow2Scaled_D (double2 a, int m, int *pExponent)
 
static double pow4 (double a, double b, double c, double d, int m)
 
static double2 pow4_D (double a, double b, double c, double d, int m)
 
static double2 pow_D (double2 a, int m)
 
double smirnov (int n, double d)
 
double smirnovc (int n, double d)
 
double smirnovci (int n, double p)
 
double smirnovi (int n, double p)
 
double smirnovp (int n, double d)
 
static void updateBinomial (double2 *Cman, int *Cexpt, int n, int j)
 

Variables

static const double _rtol = 2*DBL_EPSILON
 
static const double _xtol = DBL_EPSILON
 
static const int MIN_EXPABLE = (-708 - 38)
 
double MINLOG
 
const int SMIRNOV_MAX_COMPUTE_N = 1000000
 

Macro Definition Documentation

◆ _MAX_EXPONENT

#define _MAX_EXPONENT   960

Definition at line 549 of file kolmogorov.c.

◆ add_dd

#define add_dd   dd_add_d_d

Definition at line 131 of file kolmogorov.c.

◆ add_DD

#define add_DD   dd_add

Definition at line 136 of file kolmogorov.c.

◆ add_Dd

#define add_Dd   dd_add_dd_d

Definition at line 140 of file kolmogorov.c.

◆ add_dD

#define add_dD   dd_add_d_dd

Definition at line 141 of file kolmogorov.c.

◆ CLIP

#define CLIP (   X,
  LOW,
  HIGH 
)    ((X) < LOW ? LOW : MIN(X, HIGH))

Definition at line 85 of file kolmogorov.c.

◆ div_dd

#define div_dd   dd_div_d_d

Definition at line 135 of file kolmogorov.c.

◆ div_DD

#define div_DD   dd_div

Definition at line 139 of file kolmogorov.c.

◆ div_Dd

#define div_Dd   dd_div_dd_d

Definition at line 146 of file kolmogorov.c.

◆ div_dD

#define div_dD   dd_div_d_dd

Definition at line 147 of file kolmogorov.c.

◆ frexpD

#define frexpD   dd_frexp

Definition at line 148 of file kolmogorov.c.

◆ KOLMOG_CUTOVER

#define KOLMOG_CUTOVER   0.82

Definition at line 63 of file kolmogorov.c.

◆ ldexpD

#define ldexpD   dd_ldexp

Definition at line 149 of file kolmogorov.c.

◆ log1pD

#define log1pD   dd_log1p

Definition at line 151 of file kolmogorov.c.

◆ logD

#define logD   dd_log

Definition at line 150 of file kolmogorov.c.

◆ LOGSQRT2PI

#define LOGSQRT2PI   0.91893853320467274178032973640561764

Definition at line 100 of file kolmogorov.c.

◆ MAX

#define MAX (   a,
  b 
)    (((a) < (b)) ? (b) : (a))

Definition at line 90 of file kolmogorov.c.

◆ MIN

#define MIN (   a,
  b 
)    (((a) < (b)) ? (a) : (b))

Definition at line 87 of file kolmogorov.c.

◆ mul_dd

#define mul_dd   dd_mul_d_d

Definition at line 133 of file kolmogorov.c.

◆ mul_DD

#define mul_DD   dd_mul

Definition at line 138 of file kolmogorov.c.

◆ mul_Dd

#define mul_Dd   dd_mul_dd_d

Definition at line 144 of file kolmogorov.c.

◆ mul_dD

#define mul_dD   dd_mul_d_dd

Definition at line 145 of file kolmogorov.c.

◆ neg_D

#define neg_D   dd_neg

Definition at line 134 of file kolmogorov.c.

◆ RETURN_3PROBS

#define RETURN_3PROBS (   PSF,
  PCDF,
  PDF 
)
Value:
ret.cdf = (PCDF); \
ret.sf = (PSF); \
ret.pdf = (PDF); \
return ret;

Definition at line 110 of file kolmogorov.c.

◆ RETURN_M_E

#define RETURN_M_E (   MAND,
  EXPT 
)
Value:
*pExponent = EXPT;\
return MAND;

Definition at line 551 of file kolmogorov.c.

◆ SM_UPPER_MAX_TERMS

#define SM_UPPER_MAX_TERMS   3

Definition at line 78 of file kolmogorov.c.

◆ SM_UPPERSUM_MIN_N

#define SM_UPPERSUM_MIN_N   10

Definition at line 79 of file kolmogorov.c.

◆ sub_dd

#define sub_dd   dd_sub_d_d

Definition at line 132 of file kolmogorov.c.

◆ sub_DD

#define sub_DD   dd_sub

Definition at line 137 of file kolmogorov.c.

◆ sub_Dd

#define sub_Dd   dd_sub_dd_d

Definition at line 142 of file kolmogorov.c.

◆ sub_dD

#define sub_dD   dd_sub_d_dd

Definition at line 143 of file kolmogorov.c.

◆ valueD

#define valueD   dd_to_double

Definition at line 130 of file kolmogorov.c.

Typedef Documentation

◆ ThreeProbs

typedef struct ThreeProbs ThreeProbs

Function Documentation

◆ _kolmogi()

static double _kolmogi ( double  psf,
double  pcdf 
)
static

Definition at line 256 of file kolmogorov.c.

◆ _kolmogorov()

static ThreeProbs _kolmogorov ( double  x)
static

Definition at line 159 of file kolmogorov.c.

◆ _smirnov()

static ThreeProbs _smirnov ( int  n,
double  x 
)
static

Definition at line 715 of file kolmogorov.c.

◆ _smirnovi()

static double _smirnovi ( int  n,
double  psf,
double  pcdf 
)
static

Definition at line 903 of file kolmogorov.c.

◆ _within_tol()

static int _within_tol ( double  x,
double  y,
double  atol,
double  rtol 
)
static

Definition at line 120 of file kolmogorov.c.

◆ computeAv()

static void computeAv ( int  n,
double  x,
int  v,
double2  Cman,
int  Cexpt,
double2 pt1,
double2 pt2,
double2 pAv 
)
static

Definition at line 695 of file kolmogorov.c.

◆ kolmogc()

double kolmogc ( double  x)

Definition at line 393 of file kolmogorov.c.

◆ kolmogci()

double kolmogci ( double  p)

Definition at line 429 of file kolmogorov.c.

◆ kolmogi()

double kolmogi ( double  p)

Definition at line 417 of file kolmogorov.c.

◆ kolmogorov()

double kolmogorov ( double  x)

Definition at line 384 of file kolmogorov.c.

◆ kolmogp()

double kolmogp ( double  x)

Definition at line 402 of file kolmogorov.c.

◆ logpow4()

static double logpow4 ( double  a,
double  b,
double  c,
double  d,
int  m 
)
static

Definition at line 684 of file kolmogorov.c.

◆ logpow4_D()

static double2 logpow4_D ( double  a,
double  b,
double  c,
double  d,
int  m 
)
static

Definition at line 650 of file kolmogorov.c.

◆ modNX()

static double modNX ( int  n,
double  x,
int pNXFloor,
double *  pNX 
)
static

Definition at line 460 of file kolmogorov.c.

◆ nextPowerOf2()

static double nextPowerOf2 ( double  x)
static

Definition at line 444 of file kolmogorov.c.

◆ pow2()

static double pow2 ( double  a,
double  b,
int  m 
)
static

Definition at line 540 of file kolmogorov.c.

◆ pow2Scaled_D()

static double2 pow2Scaled_D ( double2  a,
int  m,
int pExponent 
)
static

Definition at line 557 of file kolmogorov.c.

◆ pow4()

static double pow4 ( double  a,
double  b,
double  c,
double  d,
int  m 
)
static

Definition at line 642 of file kolmogorov.c.

◆ pow4_D()

static double2 pow4_D ( double  a,
double  b,
double  c,
double  d,
int  m 
)
static

Definition at line 619 of file kolmogorov.c.

◆ pow_D()

static double2 pow_D ( double2  a,
int  m 
)
static

Definition at line 508 of file kolmogorov.c.

◆ smirnov()

double smirnov ( int  n,
double  d 
)

Definition at line 1079 of file kolmogorov.c.

◆ smirnovc()

double smirnovc ( int  n,
double  d 
)

Definition at line 1090 of file kolmogorov.c.

◆ smirnovci()

double smirnovci ( int  n,
double  p 
)

Definition at line 1141 of file kolmogorov.c.

◆ smirnovi()

double smirnovi ( int  n,
double  p 
)

Definition at line 1132 of file kolmogorov.c.

◆ smirnovp()

double smirnovp ( int  n,
double  d 
)

Definition at line 1106 of file kolmogorov.c.

◆ updateBinomial()

static void updateBinomial ( double2 Cman,
int Cexpt,
int  n,
int  j 
)
static

Definition at line 495 of file kolmogorov.c.

Variable Documentation

◆ _rtol

const double _rtol = 2*DBL_EPSILON
static

Definition at line 117 of file kolmogorov.c.

◆ _xtol

const double _xtol = DBL_EPSILON
static

Definition at line 116 of file kolmogorov.c.

◆ MIN_EXPABLE

const int MIN_EXPABLE = (-708 - 38)
static

Definition at line 97 of file kolmogorov.c.

◆ MINLOG

double MINLOG

Definition at line 60 of file const.c.

◆ SMIRNOV_MAX_COMPUTE_N

const int SMIRNOV_MAX_COMPUTE_N = 1000000

Definition at line 70 of file kolmogorov.c.

ret
DenseIndex ret
Definition: level1_cplx_impl.h:44


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:09:47