#include "lib/stringinfo.h"
Go to the source code of this file.
Data Structures | |
struct | TS_ELEMENT |
struct | SAX_ELEMENT |
struct | TS |
struct | SAX |
Defines | |
#define | DEFAULT_CARDINALITY 8 |
#define | DatumGetTS(x) ((TS*)DatumGetPointer(x)) |
#define | DatumGetSAX(x) ((SAX*)DatumGetPointer(x)) |
#define | PG_GETARG_TS(x) DatumGetTS( PG_DETOAST_DATUM(PG_GETARG_DATUM(x)) ) |
#define | PG_GETARG_SAX(x) DatumGetSAX( PG_DETOAST_DATUM(PG_GETARG_DATUM(x)) ) |
#define | PG_RETURN_TS(x) PG_RETURN_POINTER(x) |
#define | PG_RETURN_SAX(x) PG_RETURN_POINTER(x) |
#define | SIZE_OF_SAX(len) (offsetof(SAX, data[0]) + sizeof(SAX_ELEMENT) * len) |
#define | SIZE_OF_TS(len) (offsetof(SAX, data[0]) + sizeof(TS_ELEMENT) * len) |
#define | SCAN_HEX(str, valp) |
#define | NONE_IS_NULL(r1, r2, i) (!(sax_isNull(&(r1->data[i])) || sax_isNull(&(r2->data[i])))) |
#define | NEITHER_ELEMENT_NULL(r1, r2) (!(sax_isNull(r1) || sax_isNull(r2))) |
#define | WEAK_CHAR_LENGTH 3.0 |
#define | MAX_DIST (4.0*bp256[0]*bp256[0]) |
Functions | |
unsigned char | promoteLetter (unsigned char let, unsigned char ref, unsigned char oldA, unsigned char newA) |
New cardinality is greater than old one. | |
unsigned char | downgradeLetter (unsigned char let, unsigned char oldA, unsigned char newA) |
New cardinality is less then old one. | |
bool | ts_uoverlap (TS *a, TS *b) |
overlap from top: a &> b means a[i].l >= b[i].l & a[i].l <= b[i].u for all i=1. | |
bool | ts_loverlap (TS *a, TS *b) |
overlap from bottom: a &< b means a[i].u<= b[i].u & a[i].u >= b[i].l for all i=1. | |
bool | ts_contained (TS *a, TS *b) |
contained (a <@ b) : a[i].u < b[i].u & a[i].l>b[i].l for all i=1. | |
bool | ts_contains (TS *a, TS *b) |
contains (a > b) : a[i].u > b[i].u & a[i].l < b[i].l for all i=1. | |
bool | ts_wcontained (TS *a, TS *b) |
bool | ts_wcontains (TS *a, TS *b) |
bool | ts_greater (TS *a, TS *b) |
greater (a>b) - lower bound of a is always higher than upper bound of b (a[i].l >= b[i].u for all i=1. | |
bool | ts_less (TS *a, TS *b) |
less (a<b) - is equivalent of b>a (a[i].u <= b[i].l for all i=1. | |
bool | ts_intersect (TS *a, TS *b) |
intersect ( a >< b) a is neither greater nor less than b; | |
bool | sax_uoverlap (SAX *a, SAX *b) |
overlap from top: a &> b means a[i].l >= b[i].l & a[i].l <= b[i].u for all i=1. | |
bool | sax_loverlap (SAX *a, SAX *b) |
overlap from bottom: a &< b means a[i].u<= b[i].u & a[i].u >= b[i].l for all i=1. | |
bool | sax_contained (SAX *a, SAX *b) |
contained (a <@ b) : a[i].u < b[i].u & a[i].l>b[i].l for all i=1. | |
bool | sax_contains (SAX *a, SAX *b) |
contains (a > b) : a[i].u > b[i].u & a[i].l < b[i].l for all i=1. | |
bool | sax_greater (SAX *a, SAX *b) |
greater (a>b) - lower bound of a is always higher than upper bound of b (a[i].l >= b[i].u for all i=1. | |
bool | sax_less (SAX *a, SAX *b) |
less (a<b) - is equivalent of b>a (a[i].u <= b[i].l for all i=1. | |
bool | sax_intersect (SAX *a, SAX *b) |
intersect ( a >< b) a is neither greater nor less than b; | |
Datum | ts_subset (PG_FUNCTION_ARGS) |
extract subset of time series. | |
Datum | sax_subset (PG_FUNCTION_ARGS) |
extract subset of SAX string. | |
unsigned char | unify_cardinality_up (SAX_ELEMENT *a, SAX_ELEMENT *b, unsigned char *al, unsigned char *au, unsigned char *bl, unsigned char *bu) |
calculate new boundaries for both SAX_ELEMENTS in assumption that alphabet promote to upper cardinality | |
unsigned char | unify_cardinality_down (SAX_ELEMENT *a, SAX_ELEMENT *b, unsigned char *al, unsigned char *au, unsigned char *bl, unsigned char *bu) |
float | dist (unsigned char a, unsigned char b, unsigned char c) |
SAX * | i_sax_upper (SAX *sax) |
SAX * | i_sax_lower (SAX *sax) |
StringInfo | i_sax_string (SAX *sax) |
SAX * | i_sax_in (char *str) |
String to SAX conversion. |
#define NEITHER_ELEMENT_NULL | ( | r1, | |||
r2 | ) | (!(sax_isNull(r1) || sax_isNull(r2))) |
#define NONE_IS_NULL | ( | r1, | |||
r2, | |||||
i | ) | (!(sax_isNull(&(r1->data[i])) || sax_isNull(&(r2->data[i])))) |
#define PG_GETARG_SAX | ( | x | ) | DatumGetSAX( PG_DETOAST_DATUM(PG_GETARG_DATUM(x)) ) |
#define PG_GETARG_TS | ( | x | ) | DatumGetTS( PG_DETOAST_DATUM(PG_GETARG_DATUM(x)) ) |
#define SCAN_HEX | ( | str, | |||
valp | ) |
#define SIZE_OF_SAX | ( | len | ) | (offsetof(SAX, data[0]) + sizeof(SAX_ELEMENT) * len) |
#define SIZE_OF_TS | ( | len | ) | (offsetof(SAX, data[0]) + sizeof(TS_ELEMENT) * len) |
float dist | ( | unsigned char | a, | |
unsigned char | b, | |||
unsigned char | c | |||
) |
unsigned char downgradeLetter | ( | unsigned char | let, | |
unsigned char | oldA, | |||
unsigned char | newA | |||
) |
SAX* i_sax_in | ( | char * | str | ) |
unsigned char promoteLetter | ( | unsigned char | let, | |
unsigned char | ref, | |||
unsigned char | oldA, | |||
unsigned char | newA | |||
) |
contained (a <@ b) : a[i].u < b[i].u & a[i].l>b[i].l for all i=1.
.N; this is equivalent of ((a &> b) & (b &< a))
Definition at line 253 of file saxoperators.c.
contains (a > b) : a[i].u > b[i].u & a[i].l < b[i].l for all i=1.
.N; is equivalent of b <@ a
Definition at line 257 of file saxoperators.c.
greater (a>b) - lower bound of a is always higher than upper bound of b (a[i].l >= b[i].u for all i=1.
.N );
Definition at line 265 of file saxoperators.c.
intersect ( a >< b) a is neither greater nor less than b;
Definition at line 261 of file saxoperators.c.
less (a<b) - is equivalent of b>a (a[i].u <= b[i].l for all i=1.
.N);
Definition at line 281 of file saxoperators.c.
overlap from bottom: a &< b means a[i].u<= b[i].u & a[i].u >= b[i].l for all i=1.
.N
Definition at line 237 of file saxoperators.c.
Datum sax_subset | ( | PG_FUNCTION_ARGS | ) |
extract subset of SAX string.
It returns SAX string starts at offset and spanning length points. If offset is negative SAX string will be padded with NULL values in the beginning. If offset+length greater than length of original SAX string, result will be padded with NULL values at the end.
SAX | string to deal with | |
offset | ||
length |
overlap from top: a &> b means a[i].l >= b[i].l & a[i].l <= b[i].u for all i=1.
.N
Definition at line 212 of file saxoperators.c.
contained (a <@ b) : a[i].u < b[i].u & a[i].l>b[i].l for all i=1.
.N; this is equivalent of ((a &> b) & (b &< a))
Definition at line 72 of file tsoperators.c.
contains (a > b) : a[i].u > b[i].u & a[i].l < b[i].l for all i=1.
.N; is equivalent of b <@ a
Definition at line 77 of file tsoperators.c.
greater (a>b) - lower bound of a is always higher than upper bound of b (a[i].l >= b[i].u for all i=1.
.N );
Definition at line 86 of file tsoperators.c.
intersect ( a >< b) a is neither greater nor less than b;
Definition at line 81 of file tsoperators.c.
less (a<b) - is equivalent of b>a (a[i].u <= b[i].l for all i=1.
.N);
Definition at line 97 of file tsoperators.c.
overlap from bottom: a &< b means a[i].u<= b[i].u & a[i].u >= b[i].l for all i=1.
.N
Definition at line 62 of file tsoperators.c.
Datum ts_subset | ( | PG_FUNCTION_ARGS | ) |
extract subset of time series.
It returns time series starts at offset and spanning length points. If offset is negative time series will be padded with NULL values in the beginning. If offset+length greater than length of original time series, result will be padded with NULL values at the end.
time | series to deal with | |
offset | ||
length |
overlap from top: a &> b means a[i].l >= b[i].l & a[i].l <= b[i].u for all i=1.
.N
Definition at line 51 of file tsoperators.c.
Definition at line 107 of file tsoperators.c.
Definition at line 130 of file tsoperators.c.
unsigned char unify_cardinality_down | ( | SAX_ELEMENT * | a, | |
SAX_ELEMENT * | b, | |||
unsigned char * | al, | |||
unsigned char * | au, | |||
unsigned char * | bl, | |||
unsigned char * | bu | |||
) |
Definition at line 174 of file saxoperators.c.
unsigned char unify_cardinality_up | ( | SAX_ELEMENT * | a, | |
SAX_ELEMENT * | b, | |||
unsigned char * | al, | |||
unsigned char * | au, | |||
unsigned char * | bl, | |||
unsigned char * | bu | |||
) |
calculate new boundaries for both SAX_ELEMENTS in assumption that alphabet promote to upper cardinality
Definition at line 136 of file saxoperators.c.