MobilityDB 1.3
Loading...
Searching...
No Matches
tnumber_mathfuncs.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 __TEMPORAL_MATHFUNCS_H__
36#define __TEMPORAL_MATHFUNCS_H__
37
38/* PostgreSQL */
39#include <postgres.h>
40/* MEOS */
41#include <meos.h>
42#include "temporal/temporal.h"
43#include "temporal/meos_catalog.h"
44
45/*****************************************************************************/
46
49typedef enum
50{
57
58/*****************************************************************************/
59
60extern int tfloat_arithop_turnpt(Datum start1, Datum end1, Datum start2,
61 Datum end2, Datum param UNUSED, TimestampTz lower, TimestampTz upper,
62 TimestampTz *t1, TimestampTz *t2);
63
64extern Temporal *arithop_tnumber_number(const Temporal *temp, Datum value,
65 TArithmetic oper, Datum (*func)(Datum, Datum, meosType), bool invert);
66extern Temporal *arithop_tnumber_tnumber(const Temporal *temp1,
67 const Temporal *temp2, TArithmetic oper,
68 Datum (*func)(Datum, Datum, meosType), tpfunc_temp tpfunc);
69
70extern TSequence *tfloatseq_derivative(const TSequence *seq);
72
73/*****************************************************************************/
74
75#endif
TSequenceSet * tfloatseqset_derivative(const TSequenceSet *ss)
Return the derivative of a temporal float sequence set.
Definition: tnumber_mathfuncs.c:636
TSequence * tfloatseq_derivative(const TSequence *seq)
Return the derivative of a temporal float sequence.
Definition: tnumber_mathfuncs.c:593
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:55
int(* tpfunc_temp)(Datum, Datum, Datum, Datum, Datum, TimestampTz, TimestampTz, TimestampTz *, TimestampTz *)
Definition: temporal.h:290
#define UNUSED
Definition: temporal.h:75
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 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
Temporal * arithop_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2, TArithmetic oper, Datum(*func)(Datum, Datum, meosType), tpfunc_temp tpfunc)
Generic arithmetic operator on two temporal numbers.
Definition: tnumber_mathfuncs.c:162
int tfloat_arithop_turnpt(Datum start1, Datum end1, Datum start2, Datum end2, Datum param UNUSED, TimestampTz lower, TimestampTz upper, TimestampTz *t1, TimestampTz *t2)
Find the single timestamptz at which the operation of two temporal float segments is at a local minim...
Definition: tnumber_mathfuncs.c:67
Temporal * arithop_tnumber_number(const Temporal *temp, Datum value, TArithmetic oper, Datum(*func)(Datum, Datum, meosType), bool invert)
Generic arithmetic operator on a temporal number and a number.
Definition: tnumber_mathfuncs.c:113
TArithmetic
Mathematical operators (+, -, *, /) and functions (round, degrees, ...) for temporal numbers.
Definition: tnumber_mathfuncs.h:50
@ SUB
Definition: tnumber_mathfuncs.h:52
@ MULT
Definition: tnumber_mathfuncs.h:53
@ DIV
Definition: tnumber_mathfuncs.h:54
@ DIST
Definition: tnumber_mathfuncs.h:55
@ ADD
Definition: tnumber_mathfuncs.h:51