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
49extern TSequence *tdiscseq_restrict_value(const TSequence *seq, Datum value,
50 bool atfunc);
51extern TSequence *tdiscseq_restrict_values(const TSequence *seq, const Set *s,
52 bool atfunc);
53extern TSequence *tdiscseq_restrict_minmax(const TSequence *seq, bool min,
54 bool atfunc);
56 TimestampTz t);
58 const Set *s, bool atfunc);
60 const SpanSet *ss, bool atfunc);
61extern int tcontseq_restrict_value_iter(const TSequence *seq, Datum value,
62 bool atfunc, TSequence **result);
63extern TSequenceSet *tcontseq_restrict_minmax(const TSequence *seq, bool min,
64 bool atfunc);
66 TimestampTz t);
68 const Set *s);
70 const SpanSet *ss);
71extern TSequence *tcontseq_at_tstzset(const TSequence *seq, const Set *s);
73 TimestampTz t);
75 const Set *s);
77 const Span *s);
78extern TSequenceSet *tcontseq_restrict_value(const TSequence *seq, Datum value,
79 bool atfunc);
81 const Set *s, bool atfunc);
82extern int tsequence_at_values_iter(const TSequence *seq, const Set *set,
83 TSequence **result);
85 const Span *span, bool atfunc, TSequence **result);
87 const SpanSet *ss, bool atfunc, TSequence **result);
88extern TInstant *tsegment_at_timestamptz(const TInstant *inst1,
89 const TInstant *inst2, interpType interp, TimestampTz t);
91 TSequence **result);
92extern int tcontseq_minus_tstzset_iter(const TSequence *seq, const Set *s,
93 TSequence **result);
94extern int tcontseq_at_tstzspanset1(const TSequence *seq, const SpanSet *ss,
95 TSequence **result);
96extern int tcontseq_minus_tstzspanset_iter(const TSequence *seq, const SpanSet *ss,
97 TSequence **result);
98extern TSequence *tcontseq_at_tstzspan(const TSequence *seq, const Span *s);
101 const SpanSet *ss, bool atfunc);
102extern bool tdiscseq_value_at_timestamptz(const TSequence *seq, TimestampTz t,
103 Datum *result);
105 const Span *span, bool atfunc);
107 const SpanSet *ss, bool atfunc);
109 const Span *span, bool atfunc);
111 const SpanSet *ss, bool atfunc);
112extern double tnumberseq_cont_twavg(const TSequence *seq);
113
114/*****************************************************************************/
115
116#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:161
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:80
Structure to represent span sets.
Definition: meos.h:108
Structure to represent spans (a.k.a.
Definition: meos.h:94
Structure to represent temporal values of instant subtype.
Definition: meos.h:185
Structure to represent temporal values of sequence set subtype.
Definition: meos.h:224
Structure to represent temporal values of sequence subtype.
Definition: meos.h:202
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:2319
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:2165
TInstant * tdiscseq_at_timestamptz(const TSequence *seq, TimestampTz t)
Restriction functions for temporal value.
Definition: temporal_restrict.c:1939
TSequence * tcontseq_at_tstzset(const TSequence *seq, const Set *s)
Restrict a temporal sequence to a timestamptz set.
Definition: temporal_restrict.c:2340
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:2531
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:2658
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
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:2238
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:2707
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:2888
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:2114
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:2406
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:2763
TSequence * tcontseq_delete_timestamptz(const TSequence *seq, TimestampTz t)
Delete a timestamp from a continuous temporal sequence.
Definition: temporal_modif.c:835
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:2546
TSequence * tcontseq_delete_tstzspanset(const TSequence *seq, const SpanSet *ss)
Delete a timestamptz span set from a continuous temporal sequence.
Definition: temporal_modif.c:1077
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:2000
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:2184
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: temporal_restrict.c:1918
TSequence * tcontseq_delete_tstzset(const TSequence *seq, const Set *s)
Delete a timestamptz from a continuous temporal sequence.
Definition: temporal_modif.c:908
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:2797
TSequence * tdiscseq_minus_timestamptz(const TSequence *seq, TimestampTz t)
Restrict a temporal discrete sequence to (the complement of) a timestamptz.
Definition: temporal_restrict.c:1968
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