OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
numerical.c File Reference
#include "globals.h"
#include "minmax.h"
#include "math.h"
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for numerical.c:

Go to the source code of this file.

Macros

#define GOLD   1.618034
 
#define GLIMIT   100.0
 
#define TINY   1.0e-20
 
#define MAX(a, b)   ((a) > (b) ? (a) : (b))
 
#define SIGN(a, b)   ((b) > 0.0 ? fabs(a) : -fabs(a))
 
#define SHFT(a, b, c, d)   (a)=(b);(b)=(c);(c)=(d);
 
#define ITMAX   100
 
#define CGOLD   0.3819660
 
#define ZEPS   1.0e-10
 
#define SIGN(a, b)   ((b) > 0.0 ? fabs(a) : -fabs(a))
 
#define SHFT(a, b, c, d)   (a)=(b);(b)=(c);(c)=(d);
 

Functions

int compare_floats (const void *a, const void *b)
 
void ecdf_ (float *xcdf, float *ycdf, int32_t *bin_number, float *xs, int32_t *sample_size)
 
float mean (float *xs, int sample_size)
 
float variance (float *xs, int sample_size)
 
void linear_regression (float *slope, float *intercept, float *xs, float *ys, int sample_size)
 
void estimate_evd_parameters (int *used_sample_size, float *xi, float *theta, float *normalised_energies, int sample_size)
 
void mnbrak (float *ax, float *bx, float *cx, float *fa, float *fb, float *fc, float(*func)(float))
 
float brent (float ax, float bx, float cx, float(*f)(float), float tol, float *xmin)
 

Macro Definition Documentation

◆ CGOLD

#define CGOLD   0.3819660

Definition at line 235 of file numerical.c.

◆ GLIMIT

#define GLIMIT   100.0

Definition at line 170 of file numerical.c.

◆ GOLD

#define GOLD   1.618034

Definition at line 169 of file numerical.c.

◆ ITMAX

#define ITMAX   100

Definition at line 234 of file numerical.c.

◆ MAX

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

Definition at line 172 of file numerical.c.

◆ SHFT [1/2]

#define SHFT (   a,
  b,
  c,
 
)    (a)=(b);(b)=(c);(c)=(d);

Definition at line 238 of file numerical.c.

◆ SHFT [2/2]

#define SHFT (   a,
  b,
  c,
 
)    (a)=(b);(b)=(c);(c)=(d);

Definition at line 238 of file numerical.c.

◆ SIGN [1/2]

#define SIGN (   a,
  b 
)    ((b) > 0.0 ? fabs(a) : -fabs(a))

Definition at line 237 of file numerical.c.

◆ SIGN [2/2]

#define SIGN (   a,
  b 
)    ((b) > 0.0 ? fabs(a) : -fabs(a))

Definition at line 237 of file numerical.c.

◆ TINY

#define TINY   1.0e-20

Definition at line 171 of file numerical.c.

◆ ZEPS

#define ZEPS   1.0e-10

Definition at line 236 of file numerical.c.

Function Documentation

◆ brent()

float brent ( float  ax,
float  bx,
float  cx,
float(*)(float)  f,
float  tol,
float *  xmin 
)

Definition at line 240 of file numerical.c.

◆ compare_floats()

int compare_floats ( const void *  a,
const void *  b 
)

Definition at line 15 of file numerical.c.

◆ ecdf_()

void ecdf_ ( float *  xcdf,
float *  ycdf,
int32_t *  bin_number,
float *  xs,
int32_t *  sample_size 
)

Definition at line 22 of file numerical.c.

◆ estimate_evd_parameters()

void estimate_evd_parameters ( int *  used_sample_size,
float *  xi,
float *  theta,
float *  normalised_energies,
int  sample_size 
)

Definition at line 127 of file numerical.c.

◆ linear_regression()

void linear_regression ( float *  slope,
float *  intercept,
float *  xs,
float *  ys,
int  sample_size 
)

Definition at line 102 of file numerical.c.

◆ mean()

float mean ( float *  xs,
int  sample_size 
)

Definition at line 81 of file numerical.c.

◆ mnbrak()

void mnbrak ( float *  ax,
float *  bx,
float *  cx,
float *  fa,
float *  fb,
float *  fc,
float(*)(float)  func 
)

Definition at line 176 of file numerical.c.

◆ variance()

float variance ( float *  xs,
int  sample_size 
)

Definition at line 91 of file numerical.c.