MobilityDB 1.3
Loading...
Searching...
No Matches
lifting.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
35#ifndef __LIFTING_H__
36#define __LIFTING_H__
37
38/* MEOS */
39#include <meos.h>
40#include "temporal/temporal.h"
41#include "temporal/meos_catalog.h"
42
53#define MAX_PARAMS 1
54#define MAX_ARGS 2
55
56typedef struct
57{
61 meosType argtype[MAX_ARGS];
63 bool reslinear;
64 bool invert;
65 bool discont;
66 bool ever;
70
71/*****************************************************************************/
72
73extern TInstant *tfunc_tinstant(const TInstant *inst,
74 LiftedFunctionInfo *lfinfo);
75extern TSequence *tfunc_tsequence(const TSequence *seq,
76 LiftedFunctionInfo *lfinfo);
78 LiftedFunctionInfo *lfinfo);
79extern Temporal *tfunc_temporal(const Temporal *temp,
80 LiftedFunctionInfo *lfinfo);
81
82extern TInstant *tfunc_tinstant_base(const TInstant *inst, Datum value,
83 LiftedFunctionInfo *lfinfo);
84extern TSequence *tfunc_tsequence_base(const TSequence *seq, Datum value,
85 LiftedFunctionInfo *lfinfo);
87 LiftedFunctionInfo *lfinfo);
88extern Temporal *tfunc_temporal_base(const Temporal *temp, Datum value,
89 LiftedFunctionInfo *lfinfo);
90
91extern TInstant *tfunc_tinstant_tinstant(const TInstant *inst1,
92 const TInstant *inst2, LiftedFunctionInfo *lfinfo);
94 const TSequence *seq2, LiftedFunctionInfo *lfinfo);
96 const TSequence *seq2, LiftedFunctionInfo *lfinfo);
98 const TSequenceSet *ss2, LiftedFunctionInfo *lfinfo);
99extern Temporal *tfunc_temporal_temporal(const Temporal *temp1,
100 const Temporal *temp2, LiftedFunctionInfo *lfinfo);
101
102/*****************************************************************************/
103
104extern int eafunc_temporal_base(const Temporal *temp, Datum value,
105 LiftedFunctionInfo *lfinfo);
106extern int eafunc_temporal_temporal(const Temporal *temp1,
107 const Temporal *temp2, LiftedFunctionInfo *lfinfo);
108
109/*****************************************************************************/
110
111#endif
TSequence * tfunc_tsequence(const TSequence *seq, LiftedFunctionInfo *lfinfo)
Apply a lifted function to a temporal sequence.
Definition: lifting.c:232
TSequenceSet * tfunc_tsequenceset_tsequenceset(const TSequenceSet *ss1, const TSequenceSet *ss2, LiftedFunctionInfo *lfinfo)
Synchronize two temporal values and apply to them a lifted function.
Definition: lifting.c:1543
TInstant * tfunc_tinstant(const TInstant *inst, LiftedFunctionInfo *lfinfo)
Apply a lifted function with the optional arguments to a temporal instant.
Definition: lifting.c:220
TSequenceSet * tfunc_tsequenceset(const TSequenceSet *ss, LiftedFunctionInfo *lfinfo)
Apply a lifted function to a temporal sequence set.
Definition: lifting.c:247
#define MAX_ARGS
Definition: lifting.h:54
Temporal * tfunc_tcontseq_tcontseq(const TSequence *seq1, const TSequence *seq2, LiftedFunctionInfo *lfinfo)
Synchronize two temporal values and apply to them a lifted function.
Definition: lifting.c:1441
Temporal * tfunc_temporal_temporal(const Temporal *temp1, const Temporal *temp2, LiftedFunctionInfo *lfinfo)
Synchronize two temporal values and apply to them a lifted function.
Definition: lifting.c:1593
TSequenceSet * tfunc_tsequenceset_base(const TSequenceSet *ss, Datum value, LiftedFunctionInfo *lfinfo)
Apply a lifted function to a temporal value and a base value.
Definition: lifting.c:634
TSequence * tfunc_tsequence_base(const TSequence *seq, Datum value, LiftedFunctionInfo *lfinfo)
Apply a lifted function to a temporal value and a base value.
Definition: lifting.c:327
int eafunc_temporal_temporal(const Temporal *temp1, const Temporal *temp2, LiftedFunctionInfo *lfinfo)
Synchronize two temporal values and apply to them a lifted function.
Definition: lifting.c:2541
TInstant * tfunc_tinstant_base(const TInstant *inst, Datum value, LiftedFunctionInfo *lfinfo)
Apply a lifted function to a temporal value and the base value.
Definition: lifting.c:313
int eafunc_temporal_base(const Temporal *temp, Datum value, LiftedFunctionInfo *lfinfo)
Apply a lifted function to a temporal value and a base value.
Definition: lifting.c:1873
#define MAX_PARAMS
Generic functions for lifting functions and operators on temporal types.
Definition: lifting.h:53
Temporal * tfunc_temporal_base(const Temporal *temp, Datum value, LiftedFunctionInfo *lfinfo)
Apply a lifted function to a temporal value and a base value (dispatch function)
Definition: lifting.c:668
Temporal * tfunc_temporal(const Temporal *temp, LiftedFunctionInfo *lfinfo)
Apply a lifted function to a temporal value (dispatch function)
Definition: lifting.c:261
TInstant * tfunc_tinstant_tinstant(const TInstant *inst1, const TInstant *inst2, LiftedFunctionInfo *lfinfo)
Synchronize two temporal values and apply to them a lifted function.
Definition: lifting.c:714
TSequence * tfunc_tdiscseq_tdiscseq(const TSequence *seq1, const TSequence *seq2, LiftedFunctionInfo *lfinfo)
Synchronize two temporal values and apply to them a lifted function.
Definition: lifting.c:829
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:55
int(* tpfunc_base)(Datum, Datum, Datum, TimestampTz, TimestampTz, TimestampTz *, TimestampTz *)
Definition: temporal.h:286
Datum(* varfunc)(Datum,...)
Definition: temporal.h:283
int(* tpfunc_temp)(Datum, Datum, Datum, Datum, Datum, TimestampTz, TimestampTz, TimestampTz *, TimestampTz *)
Definition: temporal.h:290
External API of the Mobility Engine Open Source (MEOS) library.
uintptr_t Datum
Definition: postgres_ext_defs.in.h:7
bool reslinear
True if the result has linear interpolation.
Definition: lifting.h:63
tpfunc_base tpfn_base
Turning point function for temporal and base types.
Definition: lifting.h:67
tpfunc_temp tpfn_temp
Turning point function for two temporal types.
Definition: lifting.h:68
int numparam
Number of parameters of the function.
Definition: lifting.h:59
bool discont
True if the function has instantaneous discontinuities.
Definition: lifting.h:65
bool ever
True/false when computing the ever/always semantics.
Definition: lifting.h:66
meosType restype
Type of the result of the function.
Definition: lifting.h:62
varfunc func
Variadic function that is lifted.
Definition: lifting.h:58
bool invert
True if the arguments of the function must be inverted.
Definition: lifting.h:64
Definition: lifting.h:57
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
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: meos.h:173