/Users/asorokin/Documents/workspaceC/Decima/ts/ts.c File Reference

#include "postgres.h"
#include <float.h>
#include <math.h>
#include "access/gist.h"
#include "access/skey.h"
#include "utils/builtins.h"
#include "lib/stringinfo.h"
#include "utils/array.h"
#include "tsdata.h"

Go to the source code of this file.

Defines

#define ARRPTR(x)   ( (double *) ARR_DATA_PTR(x) )
#define ARRNELEMS(x)   ArrayGetNItems( ARR_NDIM(x), ARR_DIMS(x))

Functions

int ts_yyparse ()
void ts_yyerror (const char *message)
int ts_scanner_init (const char *str)
void ts_scanner_finish (void)
void i_ts_sax (TS *ts, int32 sax_len, SAX *result)
 internal TS to SAX converter.
unsigned char to_base_sax (double val)
bool isNull (TS_ELEMENT *point)
 Check for NULL conditions in TS.
 PG_FUNCTION_INFO_V1 (ts_in)
 PG_FUNCTION_INFO_V1 (ts_out)
 PG_FUNCTION_INFO_V1 (ts_length)
 PG_FUNCTION_INFO_V1 (ts_duration)
 PG_FUNCTION_INFO_V1 (ts_range)
 PG_FUNCTION_INFO_V1 (ts_sax)
 PG_FUNCTION_INFO_V1 (ts_mean)
 PG_FUNCTION_INFO_V1 (ts_std)
 PG_FUNCTION_INFO_V1 (ts_add)
 PG_FUNCTION_INFO_V1 (ts_multiply)
 PG_FUNCTION_INFO_V1 (ts_subtract)
 PG_FUNCTION_INFO_V1 (ts_divide)
 PG_FUNCTION_INFO_V1 (ts_subset)
Datum ts_in (PG_FUNCTION_ARGS)
 Read string to time series.
Datum ts_out (PG_FUNCTION_ARGS)
 Writes time series to string.
Datum ts_length (PG_FUNCTION_ARGS)
 Return the length of the series.
Datum ts_duration (PG_FUNCTION_ARGS)
 Return the duration of the series.
Datum ts_range (PG_FUNCTION_ARGS)
 Return a TS consisting of one point representing the range of the input series.
Datum ts_sax (PG_FUNCTION_ARGS)
 Return a SAX representing the input time series.
Datum ts_mean (PG_FUNCTION_ARGS)
 Calculate average level for time series.
Datum ts_std (PG_FUNCTION_ARGS)
 Standard deviation of time series.
Datum ts_add (PG_FUNCTION_ARGS)
 Shift time series up to a certain amount.
Datum ts_subtract (PG_FUNCTION_ARGS)
 Shift time series down to a certain amount.
Datum ts_multiply (PG_FUNCTION_ARGS)
 Scale time series up to a certain amount.
Datum ts_divide (PG_FUNCTION_ARGS)
 Scale time series down to a certain amount.
float i_ts_mean (TS *ts)
float i_ts_std (TS *ts)
void ts_shift (TS *ts, float4 shift, TS *result)
void ts_scale (TS *ts, float4 scale, TS *result)
void i_ts_subset (TS *ts, int32 offset, TS *result)
Datum ts_subset (PG_FUNCTION_ARGS)
 extract subset of time series.

Variables

 PG_MODULE_MAGIC


Define Documentation

#define ARRNELEMS (  )     ArrayGetNItems( ARR_NDIM(x), ARR_DIMS(x))

Definition at line 53 of file ts.c.

#define ARRPTR (  )     ( (double *) ARR_DATA_PTR(x) )

Definition at line 52 of file ts.c.


Function Documentation

float i_ts_mean ( TS ts  ) 

Definition at line 285 of file ts.c.

void i_ts_sax ( TS ts,
int32  sax_len,
SAX result 
)

internal TS to SAX converter.

Used by ts_sax.

Definition at line 491 of file ts.c.

float i_ts_std ( TS ts  ) 

Definition at line 301 of file ts.c.

void i_ts_subset ( TS ts,
int32  offset,
TS result 
)

Definition at line 429 of file ts.c.

bool isNull ( TS_ELEMENT point  ) 

Check for NULL conditions in TS.

Definition at line 249 of file ts.c.

PG_FUNCTION_INFO_V1 ( ts_subset   ) 

PG_FUNCTION_INFO_V1 ( ts_divide   ) 

PG_FUNCTION_INFO_V1 ( ts_subtract   ) 

PG_FUNCTION_INFO_V1 ( ts_multiply   ) 

PG_FUNCTION_INFO_V1 ( ts_add   ) 

PG_FUNCTION_INFO_V1 ( ts_std   ) 

PG_FUNCTION_INFO_V1 ( ts_mean   ) 

PG_FUNCTION_INFO_V1 ( ts_sax   ) 

PG_FUNCTION_INFO_V1 ( ts_range   ) 

PG_FUNCTION_INFO_V1 ( ts_duration   ) 

PG_FUNCTION_INFO_V1 ( ts_length   ) 

PG_FUNCTION_INFO_V1 ( ts_out   ) 

PG_FUNCTION_INFO_V1 ( ts_in   ) 

unsigned char to_base_sax ( double  val  ) 

Definition at line 574 of file ts.c.

Datum ts_add ( PG_FUNCTION_ARGS   ) 

Shift time series up to a certain amount.

Definition at line 368 of file ts.c.

Datum ts_divide ( PG_FUNCTION_ARGS   ) 

Scale time series down to a certain amount.

Definition at line 472 of file ts.c.

Datum ts_duration ( PG_FUNCTION_ARGS   ) 

Return the duration of the series.

Definition at line 191 of file ts.c.

Datum ts_in ( PG_FUNCTION_ARGS   ) 

Read string to time series.

String is of form:

TS = 'lower:upper;lower:upper;... lower:; ... :upper; ... :'

Definition at line 108 of file ts.c.

Datum ts_length ( PG_FUNCTION_ARGS   ) 

Return the length of the series.

Definition at line 204 of file ts.c.

Datum ts_mean ( PG_FUNCTION_ARGS   ) 

Calculate average level for time series.

Definition at line 321 of file ts.c.

Datum ts_multiply ( PG_FUNCTION_ARGS   ) 

Scale time series up to a certain amount.

Definition at line 411 of file ts.c.

Datum ts_out ( PG_FUNCTION_ARGS   ) 

Writes time series to string.

Definition at line 134 of file ts.c.

Datum ts_range ( PG_FUNCTION_ARGS   ) 

Return a TS consisting of one point representing the range of the input series.

Definition at line 219 of file ts.c.

Datum ts_sax ( PG_FUNCTION_ARGS   ) 

Return a SAX representing the input time series.

Definition at line 258 of file ts.c.

void ts_scale ( TS ts,
float4  scale,
TS result 
)

Definition at line 342 of file ts.c.

void ts_scanner_finish ( void   ) 

int ts_scanner_init ( const char *  str  ) 

void ts_shift ( TS ts,
float4  shift,
TS result 
)

Definition at line 331 of file ts.c.

Datum ts_std ( PG_FUNCTION_ARGS   ) 

Standard deviation of time series.

Definition at line 356 of file ts.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.

Parameters:
time series to deal with
offset 
length 

Definition at line 451 of file ts.c.

Datum ts_subtract ( PG_FUNCTION_ARGS   ) 

Shift time series down to a certain amount.

Definition at line 389 of file ts.c.

void ts_yyerror ( const char *  message  ) 

int ts_yyparse (  ) 


Variable Documentation

Definition at line 46 of file ts.c.


Generated on Fri Jul 24 12:11:26 2009 for Decima by  doxygen 1.5.9