MobilityDB 1.3
Loading...
Searching...
No Matches
tsequenceset.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 __TSEQUENCESET_H__
35#define __TSEQUENCESET_H__
36
37/* PostgreSQL */
38#include <postgres.h>
39/* MEOS */
40#include <meos.h>
41#include "temporal/temporal.h"
42
43/*****************************************************************************/
44
45/* General functions */
46
48 TimestampTz t, int *loc);
49extern TSequence **tseqarr_normalize(const TSequence **sequences, int count,
50 int *newcount);
51extern double datum_distance(Datum value1, Datum value2, meosType basetype,
52 int16 flags);
53extern int *ensure_valid_tinstarr_gaps(const TInstant **instants, int count,
54 bool merge, double maxdist, const Interval *maxt, int *nsplits);
55extern bool ensure_valid_tseqarr(const TSequence **sequences, int count);
56
57/* Synchronize functions */
58
60 const TSequence *seq, SyncMode mode,
61 TSequenceSet **inter1, TSequenceSet **inter2);
63 const TSequenceSet *ss2, SyncMode mode,
64 TSequenceSet **inter1, TSequenceSet **inter2);
65
66/* Intersection functions */
67
69 const TInstant *inst, TInstant **inter1, TInstant **inter2);
70extern bool intersection_tinstant_tsequenceset(const TInstant *inst,
71 const TSequenceSet *ss, TInstant **inter1, TInstant **inter2);
73 const TSequence *is, TSequence **inter1, TSequence **inter2);
75 const TSequenceSet *ss, TSequence **inter1, TSequence **inter2);
77 const TSequenceSet *ss, SyncMode mode,
78 TSequenceSet **inter1, TSequenceSet **inter2);
79
80/* Input/output functions */
81
82extern char *tsequenceset_to_string(const TSequenceSet *ss, int maxdd,
83 outfunc value_out);
84
85/*****************************************************************************/
86
87#endif
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:55
SyncMode
Enumeration for the intersection/synchronization functions.
Definition: temporal.h:150
char *(* outfunc)(Datum value, meosType type, int maxdd)
Definition: temporal.h:277
External API of the Mobility Engine Open Source (MEOS) library.
int64 TimestampTz
Definition: postgres_ext_defs.in.h:22
signed short int16
Definition: postgres_ext_defs.in.h:10
uintptr_t Datum
Definition: postgres_ext_defs.in.h:7
Definition: postgres_ext_defs.in.h:27
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
bool intersection_tinstant_tsequenceset(const TInstant *inst, const TSequenceSet *ss, TInstant **inter1, TInstant **inter2)
Temporally intersect two temporal values.
Definition: tsequenceset.c:1882
bool intersection_tsequenceset_tinstant(const TSequenceSet *ss, const TInstant *inst, TInstant **inter1, TInstant **inter2)
Temporally intersect two temporal values.
Definition: tsequenceset.c:1859
int * ensure_valid_tinstarr_gaps(const TInstant **instants, int count, bool merge, double maxdist, const Interval *maxt, int *nsplits)
Ensure that all temporal instants of the array have increasing timestamp (or may be equal if the merg...
Definition: tsequenceset.c:455
double datum_distance(Datum value1, Datum value2, meosType basetype, int16 flags)
Return the distance between two datums.
Definition: tsequenceset.c:174
bool ensure_valid_tseqarr(const TSequence **sequences, int count)
Ensure that all temporal sequences of the array have increasing timestamp, and if they are temporal p...
Definition: tsequenceset.c:216
bool synchronize_tsequenceset_tsequence(const TSequenceSet *ss, const TSequence *seq, SyncMode mode, TSequenceSet **inter1, TSequenceSet **inter2)
Temporally intersect or synchronize a temporal sequence set and a temporal sequence.
Definition: tsequenceset.c:1754
bool tsequenceset_find_timestamptz(const TSequenceSet *ss, TimestampTz t, int *loc)
Basic functions for temporal sequence sets.
Definition: tsequenceset.c:92
bool intersection_tsequenceset_tdiscseq(const TSequenceSet *ss, const TSequence *is, TSequence **inter1, TSequence **inter2)
Temporally intersect two temporal values.
Definition: tsequenceset.c:1895
bool synchronize_tsequenceset_tsequenceset(const TSequenceSet *ss1, const TSequenceSet *ss2, SyncMode mode, TSequenceSet **inter1, TSequenceSet **inter2)
Temporally intersect or synchronize two temporal sequence sets.
Definition: tsequenceset.c:1802
TSequence ** tseqarr_normalize(const TSequence **sequences, int count, int *newcount)
Normalize the array of temporal sequences.
Definition: tsequenceset.c:133
bool intersection_tsequence_tsequenceset(const TSequence *seq, const TSequenceSet *ss, SyncMode mode, TSequenceSet **inter1, TSequenceSet **inter2)
Temporally intersect or synchronize two temporal values.
Definition: tsequenceset.c:1963
char * tsequenceset_to_string(const TSequenceSet *ss, int maxdd, outfunc value_out)
Return the Well-Known Text (WKT) representation of a temporal sequence set.
Definition: tsequenceset.c:1998
bool intersection_tdiscseq_tsequenceset(const TSequence *is, const TSequenceSet *ss, TSequence **inter1, TSequence **inter2)
Temporally intersect two temporal values.
Definition: tsequenceset.c:1949