SDDSlib
|
Computes the local density of data points using various methods such as fraction, spread, or Kernel Density Estimation (KDE). More...
#include "mdb.h"
#include "SDDS.h"
#include "scan.h"
#include <ctype.h>
#include <gsl/gsl_statistics.h>
#include <gsl/gsl_sort.h>
#include <gsl/gsl_math.h>
Go to the source code of this file.
Classes | |
struct | COLUMN_LIST |
struct | bin_layer |
Macros | |
#define | NOTHREADS 1 |
#define | NORM_NONE 0 |
#define | NORM_RANGE 1 |
#define | NORM_RMS 2 |
#define | NORM_OPTIONS 3 |
#define | KDE_BINS_SEEN 0x001UL |
#define | KDE_GRIDOUTPUT_SEEN 0x002UL |
#define | KDE_NSIGMAS_SEEN 0x004UL |
#define | KDE_EXPLIMIT_SEEN 0x008UL |
#define | KDE_SAMPLE_SEEN 0x010UL |
#define | KDE_USE_SEEN 0x020UL |
#define | KDE_SPAN_PAGES 0x040UL |
Typedefs | |
typedef struct bin_layer | BIN_LAYER |
Enumerations | |
enum | option_type { CLO_COLUMNS , CLO_PIPE , CLO_OUTPUT , CLO_FRACTION , CLO_SPREAD , CLO_KDE , CLO_VERBOSE , CLO_THREADS , CLO_WEIGHT , N_OPTIONS } |
Functions | |
long | resolveColumnNames (SDDS_DATASET *SDDSin, COLUMN_LIST *columnList, int32_t nColumnLists, char ***columnName, short **normalizationMode, int32_t *nColumns) |
void | normalizeData (double *data, int64_t rows, short mode, double min, double max, int threads) |
double | SilvermansBandwidth (double data[], long dimensions, int64_t M) |
void | createBinTree (long bins, long inputColumns, BIN_LAYER *layer) |
void | fillIndexArray (double *point, long bins, long inputColumns, long *indexList, double *min, double *delta) |
void | addToBinValue (int myid, long bins, long inputColumns, BIN_LAYER *layer, long *indexList, double quantity) |
void | zeroBinValues (long bins, long inputColumns, BIN_LAYER *layer) |
double | retrieveBinValue (long bins, long inputColumns, BIN_LAYER *layer, long *indexList) |
double | interpolateBinValue (long bins, long inputColumns, BIN_LAYER *layer, double *data, double *min, double *delta, long *indexList) |
void | interpolateBinValue0 (int myid) |
void | addDensityToBinTree (int myid, BIN_LAYER *layer, long bins, long inputColumns, double *min, double *delta, double *bw, uint64_t row, uint64_t rows, double **data, double weight, long nSigmas, double expLimit) |
void | addDensityToBinTree1 (int myid, BIN_LAYER *layer, long bins, long inputColumns, double *min, double *delta, double *bw, double *data, double weight, uint64_t rows, long nSigmas, double expLimit) |
int | advanceCounter (long *index, long *index1, long *index2, long n) |
void | dumpBinValues (SDDS_DATASET *SDDSkde, SDDS_DATASET *SDDSin, long bins, char **inputColumn, long inputColumns, char *densityColumn, BIN_LAYER *layer, double *min, double *delta) |
void | rescaleDensity (long bins, long inputColumns, BIN_LAYER *layer, double factor) |
void | addDensityToBinTree0 (int myid) |
int | main (int argc, char **argv) |
Variables | |
char * | option [N_OPTIONS] |
char * | normalizationOption [NORM_OPTIONS] |
static char * | USAGE |
int | threads = 1 |
BIN_LAYER | binTree |
long | bins |
long | nKdeSigmas |
double * | min |
double * | max |
double * | delta |
int64_t | iRow |
int64_t | rows |
int64_t | jRow |
int64_t | rowsSampled |
int64_t * | rowsSampledThread = NULL |
double ** | data |
double | kdeExpLimit |
int | verbose |
double | kdeSampleFraction |
int32_t | inputColumns |
double * | bw = NULL |
double * | density = NULL |
double * | weightValue = NULL |
Computes the local density of data points using various methods such as fraction, spread, or Kernel Density Estimation (KDE).
-pipe -threads <number> -columns <normalizationMode>,<name>[,...] The normalization mode is one of "none"
, "range"
, or "rms"
. Note that the normalization mode is irrelevant when fraction or spread options are used. -weight <columnName> -fraction
-spread
-kde bins=<number> gridoutput=<filename> nsigma=
explimit=
sample=<fraction> or use=<number> spanPages -output <columnName> -verbose
Definition in file sddslocaldensity.c.
#define KDE_BINS_SEEN 0x001UL |
Definition at line 160 of file sddslocaldensity.c.
#define KDE_EXPLIMIT_SEEN 0x008UL |
Definition at line 163 of file sddslocaldensity.c.
#define KDE_GRIDOUTPUT_SEEN 0x002UL |
Definition at line 161 of file sddslocaldensity.c.
#define KDE_NSIGMAS_SEEN 0x004UL |
Definition at line 162 of file sddslocaldensity.c.
#define KDE_SAMPLE_SEEN 0x010UL |
Definition at line 164 of file sddslocaldensity.c.
#define KDE_SPAN_PAGES 0x040UL |
Definition at line 166 of file sddslocaldensity.c.
#define KDE_USE_SEEN 0x020UL |
Definition at line 165 of file sddslocaldensity.c.
#define NORM_NONE 0 |
Definition at line 85 of file sddslocaldensity.c.
#define NORM_OPTIONS 3 |
Definition at line 88 of file sddslocaldensity.c.
#define NORM_RANGE 1 |
Definition at line 86 of file sddslocaldensity.c.
#define NORM_RMS 2 |
Definition at line 87 of file sddslocaldensity.c.
#define NOTHREADS 1 |
Definition at line 56 of file sddslocaldensity.c.
enum option_type |
Definition at line 60 of file sddslocaldensity.c.
void addDensityToBinTree | ( | int | myid, |
BIN_LAYER * | layer, | ||
long | bins, | ||
long | inputColumns, | ||
double * | min, | ||
double * | delta, | ||
double * | bw, | ||
uint64_t | row, | ||
uint64_t | rows, | ||
double ** | data, | ||
double | weight, | ||
long | nSigmas, | ||
double | expLimit ) |
Definition at line 868 of file sddslocaldensity.c.
void addDensityToBinTree0 | ( | int | myid | ) |
Definition at line 832 of file sddslocaldensity.c.
void addDensityToBinTree1 | ( | int | myid, |
BIN_LAYER * | layer, | ||
long | bins, | ||
long | inputColumns, | ||
double * | min, | ||
double * | delta, | ||
double * | bw, | ||
double * | data, | ||
double | weight, | ||
uint64_t | rows, | ||
long | nSigmas, | ||
double | expLimit ) |
Definition at line 899 of file sddslocaldensity.c.
void addToBinValue | ( | int | myid, |
long | bins, | ||
long | inputColumns, | ||
BIN_LAYER * | layer, | ||
long * | indexList, | ||
double | quantity ) |
Definition at line 691 of file sddslocaldensity.c.
int advanceCounter | ( | long * | index, |
long * | index1, | ||
long * | index2, | ||
long | n ) |
Definition at line 883 of file sddslocaldensity.c.
void createBinTree | ( | long | bins, |
long | inputColumns, | ||
BIN_LAYER * | layer ) |
Definition at line 666 of file sddslocaldensity.c.
void dumpBinValues | ( | SDDS_DATASET * | SDDSkde, |
SDDS_DATASET * | SDDSin, | ||
long | bins, | ||
char ** | inputColumn, | ||
long | inputColumns, | ||
char * | densityColumn, | ||
BIN_LAYER * | layer, | ||
double * | min, | ||
double * | delta ) |
Definition at line 725 of file sddslocaldensity.c.
void fillIndexArray | ( | double * | point, |
long | bins, | ||
long | inputColumns, | ||
long * | indexList, | ||
double * | min, | ||
double * | delta ) |
Definition at line 677 of file sddslocaldensity.c.
double interpolateBinValue | ( | long | bins, |
long | inputColumns, | ||
BIN_LAYER * | layer, | ||
double * | data, | ||
double * | min, | ||
double * | delta, | ||
long * | indexList ) |
Definition at line 806 of file sddslocaldensity.c.
void interpolateBinValue0 | ( | int | myid | ) |
Definition at line 776 of file sddslocaldensity.c.
int main | ( | int | argc, |
char ** | argv ) |
Definition at line 183 of file sddslocaldensity.c.
void normalizeData | ( | double * | data, |
int64_t | rows, | ||
short | mode, | ||
double | min, | ||
double | max, | ||
int | threads ) |
Definition at line 635 of file sddslocaldensity.c.
void rescaleDensity | ( | long | bins, |
long | inputColumns, | ||
BIN_LAYER * | layer, | ||
double | factor ) |
Definition at line 703 of file sddslocaldensity.c.
long resolveColumnNames | ( | SDDS_DATASET * | SDDSin, |
COLUMN_LIST * | columnList, | ||
int32_t | nColumnLists, | ||
char *** | columnName, | ||
short ** | normalizationMode, | ||
int32_t * | nColumns ) |
Definition at line 585 of file sddslocaldensity.c.
double retrieveBinValue | ( | long | bins, |
long | inputColumns, | ||
BIN_LAYER * | layer, | ||
long * | indexList ) |
Definition at line 768 of file sddslocaldensity.c.
double SilvermansBandwidth | ( | double | data[], |
long | dimensions, | ||
int64_t | M ) |
Definition at line 661 of file sddslocaldensity.c.
void zeroBinValues | ( | long | bins, |
long | inputColumns, | ||
BIN_LAYER * | layer ) |
Definition at line 714 of file sddslocaldensity.c.
long bins |
Definition at line 170 of file sddslocaldensity.c.
BIN_LAYER binTree |
Definition at line 169 of file sddslocaldensity.c.
double* bw = NULL |
Definition at line 179 of file sddslocaldensity.c.
double** data |
Definition at line 174 of file sddslocaldensity.c.
double * delta |
Definition at line 171 of file sddslocaldensity.c.
double* density = NULL |
Definition at line 180 of file sddslocaldensity.c.
int32_t inputColumns |
Definition at line 178 of file sddslocaldensity.c.
int64_t iRow |
Definition at line 172 of file sddslocaldensity.c.
int64_t jRow |
Definition at line 172 of file sddslocaldensity.c.
double kdeExpLimit |
Definition at line 175 of file sddslocaldensity.c.
double kdeSampleFraction |
Definition at line 177 of file sddslocaldensity.c.
double * max |
Definition at line 171 of file sddslocaldensity.c.
double* min |
Definition at line 171 of file sddslocaldensity.c.
long nKdeSigmas |
Definition at line 170 of file sddslocaldensity.c.
char* normalizationOption[NORM_OPTIONS] |
Definition at line 89 of file sddslocaldensity.c.
char* option[N_OPTIONS] |
Definition at line 73 of file sddslocaldensity.c.
int64_t rows |
Definition at line 172 of file sddslocaldensity.c.
int64_t rowsSampled |
Definition at line 172 of file sddslocaldensity.c.
int64_t* rowsSampledThread = NULL |
Definition at line 173 of file sddslocaldensity.c.
int threads = 1 |
Definition at line 168 of file sddslocaldensity.c.
|
static |
Definition at line 93 of file sddslocaldensity.c.
int verbose |
Definition at line 176 of file sddslocaldensity.c.
double* weightValue = NULL |
Definition at line 181 of file sddslocaldensity.c.