MobilityDB 1.3
Loading...
Searching...
No Matches
temporal_restrict.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * This MobilityDB code is provided under The PostgreSQL License.
4 * Copyright (c) 2016-2025, Université libre de Bruxelles and MobilityDB
5 * contributors
6 *
7 * MobilityDB includes portions of PostGIS version 3 source code released
8 * under the GNU General Public License (GPLv2 or later).
9 * Copyright (c) 2001-2025, PostGIS contributors
10 *
11 * Permission to use, copy, modify, and distribute this software and its
12 * documentation for any purpose, without fee, and without a written
13 * agreement is hereby granted, provided that the above copyright notice and
14 * this paragraph and the following two paragraphs appear in all copies.
15 *
16 * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
17 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
18 * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
19 * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
20 * OF SUCH DAMAGE.
21 *
22 * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
23 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
25 * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
26 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
27 *
28 *****************************************************************************/
29
34#ifndef __TEMPORAL_RESTRICT_H__
35#define __TEMPORAL_RESTRICT_H__
36
37/* PostgreSQL */
38#include <postgres.h>
39/* MEOS */
40#include <meos.h>
41#include "temporal/meos_catalog.h"
42#include "temporal/temporal.h"
43
44/*****************************************************************************/
45
46/* Restriction Functions */
47
48extern TSequence *tcontseq_after_timestamptz(const TSequence *seq, TimestampTz t, bool strict);
49extern TSequence *tcontseq_before_timestamptz(const TSequence *seq, TimestampTz t, bool strict);
50extern TSequence *tdiscseq_after_timestamptz(const TSequence *seq, TimestampTz t, bool strict);
51extern TSequence *tdiscseq_before_timestamptz(const TSequence *seq, TimestampTz t, bool strict);
52
54extern TSequence *tdiscseq_restrict_value(const TSequence *seq, Datum value,
55 bool atfunc);
56extern TSequence *tdiscseq_restrict_values(const TSequence *seq, const Set *s,
57 bool atfunc);
58extern TSequence *tdiscseq_restrict_minmax(const TSequence *seq, bool min,
59 bool atfunc);
61 TimestampTz t);
63 const Set *s, bool atfunc);
65 const SpanSet *ss, bool atfunc);
66extern int tcontseq_restrict_value_iter(const TSequence *seq, Datum value,
67 bool atfunc, TSequence **result);
68extern TSequenceSet *tcontseq_restrict_minmax(const TSequence *seq, bool min,
69 bool atfunc);
71 TimestampTz t);
73 const Set *s);
75 const SpanSet *ss);
76extern TSequence *tcontseq_at_tstzset(const TSequence *seq, const Set *s);
78 TimestampTz t);
80 const Set *s);
82 const Span *s);
83extern TSequenceSet *tcontseq_restrict_value(const TSequence *seq, Datum value,
84 bool atfunc);
86 const Set *s, bool atfunc);
87extern int tsequence_at_values_iter(const TSequence *seq, const Set *set,
88 TSequence **result);
90 const Span *span, bool atfunc, TSequence **result);
92 const SpanSet *ss, bool atfunc, TSequence **result);
93extern TInstant *tsegment_at_timestamptz(const TInstant *inst1,
94 const TInstant *inst2, interpType interp, TimestampTz t);
96 TSequence **result);
97extern int tcontseq_minus_tstzset_iter(const TSequence *seq, const Set *s,
98 TSequence **result);
99extern int tcontseq_at_tstzspanset1(const TSequence *seq, const SpanSet *ss,
100 TSequence **result);
101extern int tcontseq_minus_tstzspanset_iter(const TSequence *seq, const SpanSet *ss,
102 TSequence **result);
103extern TSequence *tcontseq_at_tstzspan(const TSequence *seq, const Span *s);
106 const SpanSet *ss, bool atfunc);
107extern bool tdiscseq_value_at_timestamptz(const TSequence *seq, TimestampTz t,
108 Datum *result);
110 const Span *span, bool atfunc);
112 const SpanSet *ss, bool atfunc);
114 const Span *span, bool atfunc);
116 const SpanSet *ss, bool atfunc);
117extern double tnumberseq_cont_twavg(const TSequence *seq);
118
119/*****************************************************************************/
120
121#endif /* __TEMPORAL_RESTRICT_H__ */
TSequenceSet * tcontseq_restrict_minmax(const TSequence *seq, bool min, bool atfunc)
Restrict a temporal continuous sequence to (the complement of) its minimum/maximum base value.
Definition: temporal_restrict.c:1901
TSequence * tdiscseq_restrict_minmax(const TSequence *seq, bool min, bool atfunc)
Restrict a temporal discrete sequence to (the complement of) its minimum/maximum base value.
Definition: temporal_restrict.c:1882
set(CBUFFER_SRCS cbuffer.c tcbuffer.c tcbuffer_boxops.c tcbuffer_compops.c tcbuffer_distance.c tcbuffer_spatialfuncs.c tcbuffer_spatialrels.c tcbuffer_tempspatialrels.c) if(1) list(APPEND CBUFFER_SRCS cbufferset_meos.c) endif() add_library(cbuffer OBJECT $
Definition: CMakeLists.txt:1
interpType
Enumeration that defines the interpolation types used in MEOS.
Definition: meos.h:171
External API of the Mobility Engine Open Source (MEOS) library.
int64 TimestampTz
Definition: postgres_ext_defs.in.h:22
uintptr_t Datum
Definition: postgres_ext_defs.in.h:7
Structure to represent sets of values.
Definition: meos.h:90
Structure to represent span sets.
Definition: meos.h:118
Structure to represent spans (a.k.a.
Definition: meos.h:104
Structure to represent temporal values of instant subtype.
Definition: meos.h:195
Structure to represent temporal values of sequence set subtype.
Definition: meos.h:234
Structure to represent temporal values of sequence subtype.
Definition: meos.h:212
int tcontseq_restrict_value_iter(const TSequence *seq, Datum value, bool atfunc, TSequence **result)
Restrict a temporal sequence to (the complement of) a base value (iterator function)
Definition: temporal_restrict.c:1142
TSequenceSet * tcontseq_minus_timestamptz(const TSequence *seq, TimestampTz t)
Restrict a temporal sequence to the complement of a timestamptz.
Definition: temporal_restrict.c:2299
TSequence * tdiscseq_before_timestamptz(const TSequence *seq, TimestampTz t, bool strict)
Restrict a temporal discrete sequence to the instants after or equal to a timestamptz.
Definition: temporal_restrict.c:3323
TSequenceSet * tnumberseq_cont_restrict_span(const TSequence *seq, const Span *span, bool atfunc)
Restrict a temporal sequence number to (the complement of) a span.
Definition: temporal_restrict.c:1744
TInstant * tsegment_at_timestamptz(const TInstant *inst1, const TInstant *inst2, interpType interp, TimestampTz t)
Restrict the segment of a temporal sequence to a timestamptz.
Definition: temporal_restrict.c:2144
TInstant * tdiscseq_at_timestamptz(const TSequence *seq, TimestampTz t)
Restrict a temporal discrete sequence to (the complement of) a timestamptz.
Definition: temporal_restrict.c:1918
TSequence * tcontseq_at_tstzset(const TSequence *seq, const Set *s)
Restrict a temporal sequence to a timestamptz set.
Definition: temporal_restrict.c:2319
int tsequence_at_values_iter(const TSequence *seq, const Set *set, TSequence **result)
Restrict a temporal sequence to a set of base values (iterator function)
Definition: temporal_restrict.c:1227
TSequenceSet * tcontseq_minus_tstzset(const TSequence *seq, const Set *s)
Restrict a temporal sequence to the complement of a timestamptz set.
Definition: temporal_restrict.c:2510
TSequenceSet * tcontseq_minus_tstzspan(const TSequence *seq, const Span *s)
Restrict a temporal sequence to the complement of a timestamptz span.
Definition: temporal_restrict.c:2637
TSequenceSet * tnumberseq_cont_restrict_spanset(const TSequence *seq, const SpanSet *ss, bool atfunc)
Restrict a temporal number to (the complement of) an array of spans.
Definition: temporal_restrict.c:1852
TSequence * tdiscseq_after_timestamptz(const TSequence *seq, TimestampTz t, bool strict)
Restrict a temporal discrete sequence to the instants before or equal to a timestamptz.
Definition: temporal_restrict.c:3494
int tcontseq_minus_timestamp_iter(const TSequence *seq, TimestampTz t, TSequence **result)
Restrict a temporal sequence to the complement of a timestamptz (iterator function)
Definition: temporal_restrict.c:2217
TSequence * tcontseq_after_timestamptz(const TSequence *seq, TimestampTz t, bool strict)
Restriction functions for temporal value.
Definition: temporal_restrict.c:3525
int tcontseq_at_tstzspanset1(const TSequence *seq, const SpanSet *ss, TSequence **result)
Restrict a temporal sequence to a timestamptz span set.
Definition: temporal_restrict.c:2685
TSequenceSet * tcontseq_restrict_value(const TSequence *seq, Datum value, bool atfunc)
Restrict a temporal sequence to (the complement of) a base value.
Definition: temporal_restrict.c:1200
double tnumberseq_cont_twavg(const TSequence *seq)
Return the time-weighted average of a temporal sequence number.
Definition: tsequence.c:2792
TSequence * tdiscseq_restrict_tstzspanset(const TSequence *seq, const SpanSet *ss, bool atfunc)
Restrict a discrete temporal sequence to (the complement of) a timestamptz span set.
Definition: temporal_restrict.c:2093
TSequence * tcontseq_before_timestamptz(const TSequence *seq, TimestampTz t, bool strict)
Keep the instants of a continuous temporal sequence before or equal to a timestamptz.
Definition: temporal_restrict.c:3351
int tcontseq_minus_tstzset_iter(const TSequence *seq, const Set *s, TSequence **result)
Restrict a temporal sequence to the complement of a timestamptz set (iterator function)
Definition: temporal_restrict.c:2385
int tcontseq_minus_tstzspanset_iter(const TSequence *seq, const SpanSet *ss, TSequence **result)
Restrict a temporal sequence to the complement of a timestamptz span set (iterator function)
Definition: temporal_restrict.c:2741
TSequence * tcontseq_delete_timestamptz(const TSequence *seq, TimestampTz t)
Delete a timestamp from a continuous temporal sequence.
Definition: temporal_modif.c:774
TSequence * tdiscseq_restrict_values(const TSequence *seq, const Set *s, bool atfunc)
Restrict a temporal discrete sequence to (the complement of) an array of base values.
Definition: temporal_restrict.c:954
int tnumberseq_cont_restrict_spanset_iter(const TSequence *seq, const SpanSet *ss, bool atfunc, TSequence **result)
Restrict a temporal number to (the complement of) an array of spans of base values (iterator function...
Definition: temporal_restrict.c:1774
TSequence * tcontseq_at_tstzspan(const TSequence *seq, const Span *s)
Restrict a continuous temporal sequence to a timestamptz span.
Definition: temporal_restrict.c:2525
TSequence * tcontseq_delete_tstzspanset(const TSequence *seq, const SpanSet *ss)
Delete a timestamptz span set from a continuous temporal sequence.
Definition: temporal_modif.c:1016
TSequence * tdiscseq_restrict_tstzset(const TSequence *seq, const Set *s, bool atfunc)
Restrict a temporal discrete sequence to (the complement of) a timestamptz set.
Definition: temporal_restrict.c:1979
TSequence * tnumberseq_disc_restrict_spanset(const TSequence *seq, const SpanSet *ss, bool atfunc)
Restrict a temporal discrete sequence number to (the complement of) an array of spans of base values.
Definition: temporal_restrict.c:1356
int tnumberseq_cont_restrict_span_iter(const TSequence *seq, const Span *span, bool atfunc, TSequence **result)
Restrict a temporal number to (the complement of) a span (iterator function)
Definition: temporal_restrict.c:1684
TSequence * tdiscseq_restrict_value(const TSequence *seq, Datum value, bool atfunc)
Restrict a temporal discrete sequence to (the complement of) a base value.
Definition: temporal_restrict.c:907
TInstant * tcontseq_at_timestamptz(const TSequence *seq, TimestampTz t)
Restrict a temporal continuous sequence to a timestamptz.
Definition: temporal_restrict.c:2163
bool tdiscseq_value_at_timestamptz(const TSequence *seq, TimestampTz t, Datum *result)
Return in the last argument the value of a temporal discrete sequence at a timestamptz.
Definition: tsequence.c:2099
TSequence * tcontseq_delete_tstzset(const TSequence *seq, const Set *s)
Delete a timestamptz from a continuous temporal sequence.
Definition: temporal_modif.c:847
TSequence * tnumberseq_disc_restrict_span(const TSequence *seq, const Span *span, bool atfunc)
Restrict a temporal discrete number sequence to (the complement of) a span of base values.
Definition: temporal_restrict.c:1324
TSequenceSet * tcontseq_restrict_tstzspanset(const TSequence *seq, const SpanSet *ss, bool atfunc)
Restrict a temporal sequence to (the complement of) a timestamptz span set.
Definition: temporal_restrict.c:2775
TSequence * tdiscseq_minus_timestamptz(const TSequence *seq, TimestampTz t)
Restrict a temporal discrete sequence to (the complement of) a timestamptz.
Definition: temporal_restrict.c:1947
TSequenceSet * tcontseq_restrict_values(const TSequence *seq, const Set *s, bool atfunc)
Restrict a temporal sequence to (the complement of) a set of base values.
Definition: temporal_restrict.c:1281