MobilityDB 1.3
Loading...
Searching...
No Matches
Functions
temporal_boxops.c File Reference

Bounding box operators for temporal types. More...

#include "temporal/temporal_boxops.h"
#include <assert.h>
#include <limits.h>
#include <utils/timestamp.h>
#include <meos.h>
#include <meos_internal.h>
#include <meos_internal_geo.h>
#include "temporal/span.h"
#include "temporal/type_util.h"
#include "geo/tspatial_boxops.h"

Functions

size_t bbox_get_size (meosType bboxtype)
 Return the size of a bounding box type. More...
 
int bbox_max_dims (meosType bboxtype)
 Return the maximum number of dimensions of a bounding box type. More...
 
bool bbox_type (meosType bboxtype)
 Return true if the type is a bounding box type. More...
 
bool boxop_temporal_temporal (const Temporal *temp1, const Temporal *temp2, bool(*func)(const Span *, const Span *))
 Generic bounding box function for two temporal values. More...
 
bool boxop_temporal_tstzspan (const Temporal *temp, const Span *s, bool(*func)(const Span *, const Span *), bool invert)
 Generic bounding box function for a temporal value and a timestamptz span. More...
 
bool boxop_tnumber_numspan (const Temporal *temp, const Span *s, bool(*func)(const Span *, const Span *), bool invert)
 Generic bounding box function for a temporal number and a span. More...
 
bool boxop_tnumber_tbox (const Temporal *temp, const TBox *box, bool(*func)(const TBox *, const TBox *), bool invert)
 Generic bounding box function for a temporal number and a temporal box. More...
 
bool boxop_tnumber_tnumber (const Temporal *temp1, const Temporal *temp2, bool(*func)(const TBox *, const TBox *))
 Generic bounding box function for two temporal numbers. More...
 
static int tcontseq_spans_iter (const TSequence *seq, Span *result)
 Return an array of spans obtained from the segments of a temporal sequence with continuous interpolation (iterator function) More...
 
static int tcontseq_split_each_n_spans_iter (const TSequence *seq, int elems_per_span, Span *result)
 Return an array of spans of a temporal number sequence with continuous interpolation obtained by merging consecutive segments (iterator function) More...
 
static int tcontseq_split_n_spans_iter (const TSequence *seq, int span_count, Span *result)
 Return an array of N spans from the segments of a temporal sequence with continuous interpolation (iterator function) More...
 
static Spantdiscseq_spans (const TSequence *seq)
 Return an array of spans obtained from the instants of a temporal sequence with discrete interpolation. More...
 
static Spantdiscseq_split_each_n_spans (const TSequence *seq, int elems_per_span, int *count)
 Return an array of spans obtained by merging consecutive instants from a temporal number sequence with discrete interpolation. More...
 
static Spantdiscseq_split_n_spans (const TSequence *seq, int span_count, int *count)
 Return an array of N spans from the instants of a temporal sequence with discrete interpolation. More...
 
int temporal_bbox_cmp (const void *box1, const void *box2, meosType temptype)
 Return -1, 0, or 1 depending on whether the first bounding box is less than, equal, or greater than the second one. More...
 
bool temporal_bbox_eq (const void *box1, const void *box2, meosType temptype)
 Return true if two bounding boxes are equal. More...
 
size_t temporal_bbox_size (meosType temptype)
 Return the size of a bounding box of a temporal type. More...
 
Spantemporal_spans (const Temporal *temp, int *count)
 Return an array of spans obtained from the instants or segments of a temporal value, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More...
 
Spantemporal_split_each_n_spans (const Temporal *temp, int elems_per_span, int *count)
 Return an array of spans obtained from the instants or segments of a temporal value, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More...
 
Spantemporal_split_n_spans (const Temporal *temp, int span_count, int *count)
 Return an array of N spans obtained from the instants or segments of a temporal value, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More...
 
void tinstant_set_bbox (const TInstant *inst, void *box)
 Return in the last argument the bounding box of a temporal instant. More...
 
static void tinstant_set_span (const TInstant *inst, Span *result)
 Set the span in the last argument from a temporal instant. More...
 
Spantinstant_spans (const TInstant *inst)
 Return a singleton array of spans from a temporal instant. More...
 
void tinstarr_set_bbox (const TInstant **instants, int count, bool lower_inc, bool upper_inc, interpType interp, void *box)
 Set a bounding box from an array of temporal instant values. More...
 
void tnumber_set_tbox (const Temporal *temp, TBox *box)
 Return in the last argument the temporal box of a temporal number. More...
 
TBoxtnumber_split_each_n_tboxes (const Temporal *temp, int elems_per_box, int *count)
 Return an array of temporal boxes obtained from the instants or segments of a temporal number, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More...
 
TBoxtnumber_split_n_tboxes (const Temporal *temp, int box_count, int *count)
 Return an array of N temporal boxes obtained from the instants or segments of a temporal number, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More...
 
TBoxtnumber_tboxes (const Temporal *temp, int *count)
 Return an array of temporal boxes obtained from the instants or segments of a temporal number, where the choice between instants or segments depends on whether the interpolation is discrete or continuous. More...
 
void tnumberinst_set_tbox (const TInstant *inst, TBox *box)
 Return in the last argument the temporal box of a temporal number instant. More...
 
TBoxtnumberinst_tboxes (const TInstant *inst)
 Return a singleton array of temporal boxes from a temporal number instant. More...
 
static void tnumberinstarr_set_tbox (const TInstant **instants, int count, bool lower_inc, bool upper_inc, interpType interp, TBox *box)
 Set a temporal box from an array of temporal number instants. More...
 
static int tnumberseq_cont_split_each_n_tboxes_iter (const TSequence *seq, int elems_per_box, TBox *result)
 Return an array of temporal boxes obtained from the segments of a temporal number sequence with continuous interpolation (iterator function) More...
 
static int tnumberseq_cont_split_n_tboxes_iter (const TSequence *seq, int box_count, TBox *result)
 Return an array of N temporal boxes from the segments of a temporal number sequence with continuous interpolation (iterator function) More...
 
static int tnumberseq_cont_tboxes_iter (const TSequence *seq, TBox *result)
 Return an array of temporal boxes from the segments of a temporal number sequence with continuous interpolation (iterator function) More...
 
static TBoxtnumberseq_disc_split_each_n_tboxes (const TSequence *seq, int elems_per_box, int *count)
 Return an array of temporal boxes obtained from the instants of a temporal number sequence with discrete interpolation. More...
 
static TBoxtnumberseq_disc_split_n_tboxes (const TSequence *seq, int box_count, int *count)
 Return an array of N temporal boxes from the instants of a temporal number sequence with discrete interpolation. More...
 
static TBoxtnumberseq_disc_tboxes (const TSequence *seq)
 Return an array of temporal boxes obtained from the instants of a temporal number sequence with discrete interpolation. More...
 
static void tnumberseq_expand_tbox (TSequence *seq, const TInstant *inst)
 Expand the bounding box of a temporal number sequence with an instant. More...
 
void tnumberseq_set_tbox (const TSequence *seq, TBox *box)
 Return int the last argument the temporal box of a temporal number sequence. More...
 
static TBoxtnumberseq_split_each_n_tboxes (const TSequence *seq, int elems_per_box, int *count)
 Return an array of temporal boxes obtained from the instants or segments of a temporal number sequence, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More...
 
TBoxtnumberseq_split_n_tboxes (const TSequence *seq, int box_count, int *count)
 Return an array of N temporal boxes from the instants or segments of a temporal number sequence, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More...
 
TBoxtnumberseq_tboxes (const TSequence *seq, int *count)
 Return an array of temporal boxes obtained from the instants or segments of a temporal number sequence, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More...
 
static void tnumberseqarr_set_tbox (const TSequence **sequences, int count, TBox *box)
 Return in the last argument a temporal box constructed from an array of temporal number sequences. More...
 
void tnumberseqset_set_tbox (const TSequenceSet *ss, TBox *box)
 Return in the last argument the temporal box of a temporal number sequence. More...
 
static TBoxtnumberseqset_split_each_n_tboxes (const TSequenceSet *ss, int elems_per_box, int *count)
 Return an array of temporal boxes obtained from the segments of a temporal number sequence set. More...
 
TBoxtnumberseqset_split_n_tboxes (const TSequenceSet *ss, int box_count, int *count)
 Return an array of N temporal boxes from the segments of a temporal number sequence set. More...
 
TBoxtnumberseqset_tboxes (const TSequenceSet *ss, int *count)
 Return an array of temporal boxes obtained from the segments of a temporal number sequence set. More...
 
void tseqarr_compute_bbox (const TSequence **sequences, int count, void *box)
 Return in the last argument a bounding box constructed from an array of temporal sequences. More...
 
static void tseqarr_set_tstzspan (const TSequence **sequences, int count, Span *s)
 Return in the last argument a timestamptz span constructed from an array of temporal sequences. More...
 
void tsequence_compute_bbox (TSequence *seq)
 Recompute the bounding box of a temporal sequence. More...
 
void tsequence_expand_bbox (TSequence *seq, const TInstant *inst)
 Expand the bounding box of a temporal sequence with an additional instant. More...
 
void tsequence_set_bbox (const TSequence *seq, void *box)
 Return in the last argument the bounding box of a temporal sequence. More...
 
Spantsequence_spans (const TSequence *seq, int *count)
 Return an array of spans obtained from the instants or segments of a temporal sequence, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More...
 
static Spantsequence_split_each_n_spans (const TSequence *seq, int elems_per_span, int *count)
 Return an array of spans of a temporal number sequence obtained by merging consecutive instants or segments, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More...
 
Spantsequence_split_n_spans (const TSequence *seq, int span_count, int *count)
 Return an array of N spans obtained from the instants or segments of a temporal sequence, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More...
 
void tsequenceset_compute_bbox (TSequenceSet *ss)
 (Re)compute the bounding box of a temporal sequence set More...
 
void tsequenceset_expand_bbox (TSequenceSet *ss, const TSequence *seq)
 Expand the bounding box of a temporal sequence set with an additional sequence. More...
 
void tsequenceset_set_bbox (const TSequenceSet *ss, void *box)
 Return in the last argument the bounding box of a temporal sequence set. More...
 
Spantsequenceset_spans (const TSequenceSet *ss, int *count)
 Return an array of spans obtained from the segments of a temporal sequence set. More...
 
static Spantsequenceset_split_each_n_spans (const TSequenceSet *ss, int elems_per_span, int *count)
 Return an array of spans of a temporal number sequence set obtained by merging consecutive segments. More...
 
Spantsequenceset_split_n_spans (const TSequenceSet *ss, int span_count, int *count)
 Return an array of N spans from the segments of a temporal sequence set. More...
 

Detailed Description

Bounding box operators for temporal types.

The bounding box of temporal values are

The operators consider as many dimensions as they are shared in both arguments: only the value dimension, only the time dimension, or both the value and the time dimensions.