MobilityDB  1.0
Functions
tinstantset.h File Reference

Basic functions for temporal instant 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 tinstantset.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

const TInstanttinstantset_inst_n (const TInstantSet *ti, int index)
 Returns the n-th instant of the temporal value. More...
 
bool tinstantset_find_timestamp (const TInstantSet *ti, TimestampTz t, int *pos)
 Returns the location of the timestamp in the temporal instant set value using binary search. More...
 
TInstantSettinstantset_make1 (const TInstant **instants, int count)
 Creating a temporal value from its arguments. More...
 
TInstantSettinstantset_make (const TInstant **instants, int count, bool merge)
 Construct a temporal instant set value from the array of temporal instant values. More...
 
TInstantSettinstantset_make_free (TInstant **instants, int count, bool merge)
 Construct a temporal instant set value from the array of temporal instant values and free the array and the instants after the creation. More...
 
TInstantSettinstantset_copy (const TInstantSet *ti)
 Returns a copy of the temporal value. More...
 
bool intersection_tinstantset_tinstant (const TInstantSet *ti, const TInstant *inst, TInstant **inter1, TInstant **inter2)
 Temporally intersect the two temporal values. More...
 
bool intersection_tinstant_tinstantset (const TInstant *inst, const TInstantSet *ti, TInstant **inter1, TInstant **inter2)
 Temporally intersect the two temporal values. More...
 
bool intersection_tinstantset_tinstantset (const TInstantSet *ti1, const TInstantSet *ti2, TInstantSet **inter1, TInstantSet **inter2)
 Temporally intersect the two temporal values. More...
 
char * tinstantset_to_string (const TInstantSet *ti, char *(*value_out)(Oid, Datum))
 Returns the string representation of the temporal value. More...
 
void tinstantset_write (const TInstantSet *ti, StringInfo buf)
 Write the binary representation of the temporal value into the buffer. More...
 
TInstantSettinstantset_read (StringInfo buf, Oid basetypid)
 Returns a new temporal value from its binary representation read from the buffer. More...
 
TInstantSettinstantset_from_base_internal (Datum value, Oid basetypid, const TimestampSet *ts)
 Construct a temporal instant set value from a base value and a timestamp set. More...
 
Datum tinstantset_from_base (PG_FUNCTION_ARGS)
 
TInstantSettinstantset_append_tinstant (const TInstantSet *ti, const TInstant *inst)
 Append an instant to the temporal value. More...
 
Temporaltinstantset_merge (const TInstantSet *ti1, const TInstantSet *ti2)
 Merge the two temporal values. More...
 
Temporaltinstantset_merge_array (const TInstantSet **tis, int count)
 Merge the array of temporal instant values. More...
 
TInstantSettintinstset_to_tfloatinstset (const TInstantSet *ti)
 Cast the temporal integer value as a temporal float value. More...
 
TInstantSettfloatinstset_to_tintinstset (const TInstantSet *ti)
 Cast the temporal float value as a temporal integer value. More...
 
TInstantSettinstant_to_tinstantset (const TInstant *inst)
 Transform the temporal instant value into a temporal instant set value. More...
 
TInstantSettsequence_to_tinstantset (const TSequence *seq)
 Transforms the temporal sequence value into a temporal instant value. More...
 
TInstantSettsequenceset_to_tinstantset (const TSequenceSet *ts)
 Transforms the temporal sequence set value into a temporal instant set value. More...
 
int tinstantset_values (Datum *result, const TInstantSet *ti)
 Returns the base values of the temporal value as a C array. More...
 
ArrayType * tinstantset_values_array (const TInstantSet *ti)
 Returns the base values of the temporal value as a PostgreSQL array. More...
 
ArrayType * tfloatinstset_ranges (const TInstantSet *ti)
 Returns the base values of the temporal float value as an array of ranges. More...
 
PeriodSettinstantset_get_time (const TInstantSet *ti)
 Returns the time on which the temporal value is defined as a period set. More...
 
void * tinstantset_bbox_ptr (const TInstantSet *ti)
 Returns a pointer to the precomputed bounding box of the temporal value. More...
 
void tinstantset_bbox (void *box, const TInstantSet *ti)
 Copy in the first argument the bounding box of the temporal value. More...
 
Datum tinstantset_min_value (const TInstantSet *ti)
 Returns the minimum base value of the temporal value. More...
 
Datum tinstantset_max_value (const TInstantSet *ti)
 Returns the maximum base value of the temporal value. More...
 
void tinstantset_period (Period *p, const TInstantSet *ti)
 Returns the bounding period on which the temporal value is defined. More...
 
Datum tinstantset_timespan (const TInstantSet *ti)
 Returns the timespan of the timestamp set value. More...
 
ArrayType * tinstantset_sequences_array (const TInstantSet *ti)
 Returns the sequences of the temporal value as a PostgreSQL array. More...
 
const TInstant ** tinstantset_instants (const TInstantSet *ti, int *count)
 Returns the instants of the temporal value as a C array. More...
 
ArrayType * tinstantset_instants_array (const TInstantSet *ti)
 Returns the instants of the temporal value as an PostgreSQL array. More...
 
TimestampTz tinstantset_start_timestamp (const TInstantSet *ti)
 Returns the start timestamp of the temporal value. More...
 
TimestampTz tinstantset_end_timestamp (const TInstantSet *ti)
 Returns the end timestamp of the temporal value. More...
 
TimestampTz * tinstantset_timestamps1 (const TInstantSet *ti)
 Returns the distinct timestamps of the temporal value. More...
 
ArrayType * tinstantset_timestamps (const TInstantSet *ti)
 Returns the distinct timestamps of the temporal value as a C array. More...
 
TInstantSettinstantset_shift_tscale (const TInstantSet *ti, const Interval *start, const Interval *duration)
 Shift and/or scale the time span of the temporal value by the two intervals. More...
 
bool tinstantset_ever_eq (const TInstantSet *ti, Datum value)
 Returns true if the temporal value is ever equal to the base value. More...
 
bool tinstantset_ever_lt (const TInstantSet *ti, Datum value)
 Returns true if the temporal value is ever less than the base value. More...
 
bool tinstantset_ever_le (const TInstantSet *ti, Datum value)
 Returns true if the temporal value is ever less than or equal to the base value. More...
 
bool tinstantset_always_eq (const TInstantSet *ti, Datum value)
 Returns true if the temporal value is always equal to the base value. More...
 
bool tinstantset_always_lt (const TInstantSet *ti, Datum value)
 Returns true if the temporal value is always less than the base value. More...
 
bool tinstantset_always_le (const TInstantSet *ti, Datum value)
 Returns true if the temporal value is always less than or equal to the base value. More...
 
TInstantSettinstantset_restrict_value (const TInstantSet *ti, Datum value, bool atfunc)
 Restricts the temporal value to the (complement of the) base value. More...
 
TInstantSettinstantset_restrict_values (const TInstantSet *ti, const Datum *values, int count, bool atfunc)
 Restricts the temporal value to the (complement of the) array of base values. More...
 
TInstantSettnumberinstset_restrict_range (const TInstantSet *ti, const RangeType *range, bool atfunc)
 Restricts the temporal number to the (complement of the) range of base values. More...
 
TInstantSettnumberinstset_restrict_ranges (const TInstantSet *ti, RangeType **normranges, int count, bool atfunc)
 Restricts the temporal value to the (complement of the) array of ranges of base values. More...
 
const TInstanttinstantset_min_instant (const TInstantSet *ti)
 Returns a pointer to the instant with minimum base value of the temporal value. More...
 
TInstantSettinstantset_restrict_minmax (const TInstantSet *ti, bool min, bool atfunc)
 Restricts the temporal value to (the complement of) the minimum/maximum base value. More...
 
bool tinstantset_value_at_timestamp (const TInstantSet *ti, TimestampTz t, Datum *result)
 Returns the base value of the temporal value at the timestamp. More...
 
Temporaltinstantset_restrict_timestamp (const TInstantSet *ti, TimestampTz t, bool atfunc)
 Restricts the temporal value to (the complement of) the timestamp. More...
 
TInstantSettinstantset_restrict_timestampset (const TInstantSet *ti, const TimestampSet *ts, bool atfunc)
 Restricts the temporal value to the (complement of the) timestamp set. More...
 
TInstantSettinstantset_restrict_period (const TInstantSet *ti, const Period *p, bool atfunc)
 Restricts the temporal value to (the complement of) the period. More...
 
TInstantSettinstantset_restrict_periodset (const TInstantSet *ti, const PeriodSet *ps, bool atfunc)
 Restricts the temporal value to (the complement of) the period set. More...
 
bool tinstantset_intersects_timestamp (const TInstantSet *ti, const TimestampTz t)
 Returns true if the temporal value intersects the timestamp. More...
 
bool tinstantset_intersects_timestampset (const TInstantSet *ti, const TimestampSet *ts)
 Returns true if the temporal value intersects the timestamp set. More...
 
bool tinstantset_intersects_period (const TInstantSet *ti, const Period *p)
 Returns true if the temporal value intersects the period. More...
 
bool tinstantset_intersects_periodset (const TInstantSet *ti, const PeriodSet *ps)
 Returns true if the temporal value intersects the period set. More...
 
double tnumberinstset_twavg (const TInstantSet *ti)
 Returns the time-weighted average of the temporal number. More...
 
int tinstantset_cmp (const TInstantSet *ti1, const TInstantSet *ti2)
 Returns -1, 0, or 1 depending on whether the first temporal value is less than, equal, or greater than the second one. More...
 
bool tinstantset_eq (const TInstantSet *ti1, const TInstantSet *ti2)
 Returns true if the two temporal instant set values are equal. More...
 
uint32 tinstantset_hash (const TInstantSet *ti)
 Returns the hash value of the temporal value. More...
 

Detailed Description

Basic functions for temporal instant sets.