MobilityDB  1.0
Functions
tsequenceset.h File Reference

Basic functions for temporal sequence sets. More...

#include <postgres.h>
#include <catalog/pg_type.h>
#include <utils/array.h>
#include <utils/rangetypes.h>
#include "temporal.h"
Include dependency graph for tsequenceset.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

const TSequencetsequenceset_seq_n (const TSequenceSet *ts, int index)
 Returns the n-th sequence of the temporal value. More...
 
TSequenceSettsequenceset_make (const TSequence **sequences, int count, bool normalize)
 Construct a temporal sequence set value from the array of temporal sequence values. More...
 
TSequenceSettsequenceset_make_free (TSequence **sequences, int count, bool normalize)
 Construct a temporal sequence set value from the array of temporal sequence values and free the array and the sequences after the creation. More...
 
TSequenceSettsequenceset_copy (const TSequenceSet *ts)
 Returns a copy of the temporal value. More...
 
bool tsequenceset_find_timestamp (const TSequenceSet *ts, TimestampTz t, int *loc)
 Returns the location of the timestamp in the temporal sequence set value using binary search. More...
 
double tsequenceset_interval_double (const TSequenceSet *ts)
 Returns the duration of the temporal value as a double. More...
 
bool intersection_tsequenceset_tinstant (const TSequenceSet *ts, const TInstant *inst, TInstant **inter1, TInstant **inter2)
 Temporally intersect the two temporal values. More...
 
bool intersection_tinstant_tsequenceset (const TInstant *inst, const TSequenceSet *ts, TInstant **inter1, TInstant **inter2)
 Temporally intersect the two temporal values. More...
 
bool intersection_tsequenceset_tinstantset (const TSequenceSet *ts, const TInstantSet *ti, TInstantSet **inter1, TInstantSet **inter2)
 Temporally intersect the two temporal values. More...
 
bool intersection_tinstantset_tsequenceset (const TInstantSet *ti, const TSequenceSet *ts, TInstantSet **inter1, TInstantSet **inter2)
 Temporally intersect the two temporal values. More...
 
bool synchronize_tsequenceset_tsequence (const TSequenceSet *ts, const TSequence *seq, TIntersection mode, TSequenceSet **inter1, TSequenceSet **inter2)
 Temporally intersect or synchronize the two temporal values. More...
 
bool intersection_tsequence_tsequenceset (const TSequence *seq, const TSequenceSet *ts, TIntersection mode, TSequenceSet **inter1, TSequenceSet **inter2)
 Temporally intersect or synchronize the two temporal values. More...
 
bool synchronize_tsequenceset_tsequenceset (const TSequenceSet *ts1, const TSequenceSet *ts2, TIntersection mode, TSequenceSet **inter1, TSequenceSet **inter2)
 Temporally intersect or synchronize the two temporal values. More...
 
char * tsequenceset_to_string (const TSequenceSet *ts, char *(*value_out)(Oid, Datum))
 Returns the string representation of the temporal value. More...
 
void tsequenceset_write (const TSequenceSet *ts, StringInfo buf)
 Write the binary representation of the temporal value into the buffer. More...
 
TSequenceSettsequenceset_read (StringInfo buf, Oid basetypid)
 Returns a new temporal value from its binary representation read from the buffer. More...
 
TSequenceSettsequenceset_from_base_internal (Datum value, Oid basetypid, const PeriodSet *ps, bool linear)
 Construct a temporal sequence set value from from a base value and a timestamp set (internal function) $. More...
 
Datum tsequenceset_from_base (PG_FUNCTION_ARGS)
 Construct a temporal sequence set value from from a base value and a timestamp set. More...
 
TSequenceSettsequenceset_append_tinstant (const TSequenceSet *ts, const TInstant *inst)
 Append an instant to the temporal value. More...
 
TSequenceSettsequenceset_merge (const TSequenceSet *ts1, const TSequenceSet *ts2)
 Merge the two temporal values. More...
 
TSequenceSettsequenceset_merge_array (const TSequenceSet **ts, int count)
 Merge the array of temporal sequence set values. More...
 
RangeType * tfloatseqset_to_range (const TSequenceSet *ts)
 Cast a temporal float value as a floatrange. More...
 
TSequenceSettintseqset_to_tfloatseqset (const TSequenceSet *ts)
 Cast the temporal integer value as a temporal float value. More...
 
TSequenceSettfloatseqset_to_tintseqset (const TSequenceSet *ts)
 Cast the temporal float value as a temporal integer value. More...
 
TSequenceSettinstant_to_tsequenceset (const TInstant *inst, bool linear)
 Transform the temporal instant value into a temporal sequence set value. More...
 
TSequenceSettinstantset_to_tsequenceset (const TInstantSet *ti, bool linear)
 Transform the temporal instant set value into a temporal sequence set value. More...
 
TSequenceSettsequence_to_tsequenceset (const TSequence *seq)
 Construct a temporal sequence set value from the temporal sequence. More...
 
TSequenceSettstepseqset_to_linear (const TSequenceSet *ts)
 Transform the temporal value with continuous base type from stepwise to linear interpolation. More...
 
int tsequenceset_values (Datum *result, const TSequenceSet *ts)
 Returns the distinct base values of the temporal value with stepwise interpolation. More...
 
ArrayType * tsequenceset_values_array (const TSequenceSet *ts)
 Returns the distinct base values of the temporal value with stepwise interpolation as a PostgreSQL array. More...
 
ArrayType * tfloatseqset_ranges (const TSequenceSet *ts)
 Returns the ranges of base values of the temporal float value as a PostgreSQL array. More...
 
void * tsequenceset_bbox_ptr (const TSequenceSet *ts)
 Returns a pointer to the precomputed bounding box of the temporal value. More...
 
void tsequenceset_bbox (void *box, const TSequenceSet *ts)
 Copy in the first argument the bounding box of the temporal value. More...
 
const TInstanttsequenceset_min_instant (const TSequenceSet *ts)
 Returns a pointer to the instant with minimum base value of the temporal value. More...
 
Datum tsequenceset_min_value (const TSequenceSet *ts)
 Returns the minimum base value of the temporal value. More...
 
Datum tsequenceset_max_value (const TSequenceSet *ts)
 Returns the maximum base value of the temporal value. More...
 
PeriodSettsequenceset_get_time (const TSequenceSet *ts)
 Returns the time on which the temporal value is defined as a period set. More...
 
Datum tsequenceset_timespan (const TSequenceSet *ts)
 Returns the timespan of the temporal value. More...
 
Datum tsequenceset_duration (const TSequenceSet *ts)
 Returns the duration of the temporal value. More...
 
void tsequenceset_period (Period *p, const TSequenceSet *ts)
 Returns the bounding period on which the temporal value is defined. More...
 
ArrayType * tsequenceset_segments_array (const TSequenceSet *ts)
 Returns the segments of the temporal value as a PostgreSQL array. More...
 
const TSequence ** tsequenceset_sequences (const TSequenceSet *ts)
 Returns the sequences of the temporal value as a C array. More...
 
ArrayType * tsequenceset_sequences_array (const TSequenceSet *ts)
 Returns the sequences of the temporal value as a PostgreSQL array. More...
 
int tsequenceset_num_instants (const TSequenceSet *ts)
 Returns the number of distinct instants of the temporal value. More...
 
const TInstanttsequenceset_inst_n (const TSequenceSet *ts, int n)
 Returns the n-th distinct instant of the temporal value. More...
 
const TInstant ** tsequenceset_instants (const TSequenceSet *ts, int *count)
 Returns the distinct instants of the temporal value. More...
 
ArrayType * tsequenceset_instants_array (const TSequenceSet *ts)
 Returns the distinct instants of the temporal value. More...
 
TimestampTz tsequenceset_start_timestamp (const TSequenceSet *ts)
 Returns the start timestamp of the temporal value. More...
 
TimestampTz tsequenceset_end_timestamp (const TSequenceSet *ts)
 Returns the end timestamp of the temporal value. More...
 
int tsequenceset_num_timestamps (const TSequenceSet *ts)
 Returns the number of distinct timestamps of the temporal value. More...
 
bool tsequenceset_timestamp_n (const TSequenceSet *ts, int n, TimestampTz *result)
 Returns the n-th distinct timestamp of the temporal value. More...
 
ArrayType * tsequenceset_timestamps (const TSequenceSet *ts)
 Returns the distinct timestamps of the temporal value as a PostgreSQL array. More...
 
TSequenceSettsequenceset_shift_tscale (const TSequenceSet *ts, const Interval *start, const Interval *duration)
 Shift and/or scale the time span of the temporal value by the two intervals. More...
 
bool tsequenceset_ever_eq (const TSequenceSet *ts, Datum value)
 Returns true if the temporal value is ever equal to the base value. More...
 
bool tsequenceset_ever_lt (const TSequenceSet *ts, Datum value)
 Returns true if the temporal value is ever less than the base value. More...
 
bool tsequenceset_ever_le (const TSequenceSet *ts, Datum value)
 Returns true if the temporal value is ever less than or equal to the base value. More...
 
bool tsequenceset_always_eq (const TSequenceSet *ts, Datum value)
 Returns true if the temporal value is always equal to the base value. More...
 
bool tsequenceset_always_lt (const TSequenceSet *ts, Datum value)
 Returns true if the temporal value is always less than the base value. More...
 
bool tsequenceset_always_le (const TSequenceSet *ts, Datum value)
 Returns true if the temporal value is always less than or equal to the base value. More...
 
TSequenceSettsequenceset_restrict_value (const TSequenceSet *ts, Datum value, bool atfunc)
 Restricts the temporal value to the base value. More...
 
TSequenceSettsequenceset_restrict_values (const TSequenceSet *ts, const Datum *values, int count, bool atfunc)
 Restricts the temporal value to the (complement of the) array of base values. More...
 
TSequenceSettnumberseqset_restrict_range (const TSequenceSet *ts, const RangeType *range, bool atfunc)
 Restricts the temporal number to the range of base values. More...
 
TSequenceSettnumberseqset_restrict_ranges (const TSequenceSet *ts, RangeType **normranges, int count, bool atfunc)
 Restricts the temporal number to the (complement of the) array of ranges of base values. More...
 
TSequenceSettsequenceset_restrict_minmax (const TSequenceSet *ts, bool min, bool atfunc)
 Restricts the temporal value to (the complement of) the minimum/maximum base value. More...
 
bool tsequenceset_value_at_timestamp (const TSequenceSet *ts, TimestampTz t, Datum *result)
 Returns the base value of the temporal value at the timestamp. More...
 
bool tsequenceset_value_at_timestamp_inc (const TSequenceSet *ts, TimestampTz t, Datum *result)
 Returns the base value of the temporal value at the timestamp when the timestamp may be at an exclusive bound. More...
 
const TInstanttsequenceset_inst_at_timestamp_excl (const TSequenceSet *ts, TimestampTz t)
 Returns the temporal instant at the timestamp when the timestamp is at an exclusive bound. More...
 
Temporaltsequenceset_restrict_timestamp (const TSequenceSet *ts, TimestampTz t, bool atfunc)
 Restricts the temporal value to the (the complement of) timestamp. More...
 
Temporaltsequenceset_restrict_timestampset (const TSequenceSet *ts1, const TimestampSet *ts2, bool atfunc)
 Restricts the temporal value to the (complement of the) timestamp set. More...
 
TSequenceSettsequenceset_restrict_period (const TSequenceSet *ts, const Period *p, bool atfunc)
 Restricts the temporal value to the (complement of the) period. More...
 
TSequenceSettsequenceset_restrict_periodset (const TSequenceSet *ts, const PeriodSet *ps, bool atfunc)
 Restricts the temporal value to the (complement of the) period set. More...
 
bool tsequenceset_intersects_timestamp (const TSequenceSet *ts, TimestampTz t)
 Returns true if the temporal value intersect the timestamp. More...
 
bool tsequenceset_intersects_timestampset (const TSequenceSet *ts, const TimestampSet *ts1)
 Returns true if the temporal value intersect the timestamp set. More...
 
bool tsequenceset_intersects_period (const TSequenceSet *ts, const Period *p)
 Returns true if the temporal value intersect the period. More...
 
bool tsequenceset_intersects_periodset (const TSequenceSet *ts, const PeriodSet *ps)
 Returns true if the temporal value intersect the period set. More...
 
double tnumberseqset_integral (const TSequenceSet *ts)
 Returns the integral (area under the curve) of the temporal number. More...
 
double tnumberseqset_twavg (const TSequenceSet *ts)
 Returns the time-weighted average of the temporal number. More...
 
int tsequenceset_cmp (const TSequenceSet *ts1, const TSequenceSet *ts2)
 Returns -1, 0, or 1 depending on whether the first temporal value is less than, equal, or greater than the second one. More...
 
bool tsequenceset_eq (const TSequenceSet *ts1, const TSequenceSet *ts2)
 Returns true if the two temporal sequence set values are equal. More...
 
uint32 tsequenceset_hash (const TSequenceSet *ts)
 Returns the hash value of the temporal value. More...
 

Detailed Description

Basic functions for temporal sequence sets.