MobilityDB 1.1
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-2023, 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-2023, 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/* PostgreSQL */
41#include "general/temporal.h"
42
43/*****************************************************************************/
44
47typedef enum
48{
55
56/*****************************************************************************/
57
58extern bool tnumber_mult_tp_at_timestamp(const TInstant *start1,
59 const TInstant *end1, const TInstant *start2, const TInstant *end2,
60 Datum *value, TimestampTz *t);
61extern bool tnumber_div_tp_at_timestamp(const TInstant *start1,
62 const TInstant *end1, const TInstant *start2, const TInstant *end2,
63 Datum *value, TimestampTz *t);
64
65extern Temporal *arithop_tnumber_number(const Temporal *temp, Datum value,
66 meosType basetype, TArithmetic oper,
67 Datum (*func)(Datum, Datum, meosType, meosType), bool invert);
68extern Temporal *arithop_tnumber_tnumber(const Temporal *temp1,
69 const Temporal *temp2, TArithmetic oper,
70 Datum (*func)(Datum, Datum, meosType, meosType),
71 bool (*tpfunc)(const TInstant *, const TInstant *, const TInstant *,
72 const TInstant *, Datum *, TimestampTz *));
73
74extern TSequence *tfloatseq_derivative(const TSequence *seq);
76
77/*****************************************************************************/
78
79#endif
TSequenceSet * tfloatseqset_derivative(const TSequenceSet *ts)
Return the derivative of a temporal sequence set number.
Definition: tnumber_mathfuncs.c:481
TSequence * tfloatseq_derivative(const TSequence *seq)
Return the derivative of a temporal sequence number.
Definition: tnumber_mathfuncs.c:441
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:53
Temporal * arithop_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2, TArithmetic oper, Datum(*func)(Datum, Datum, meosType, meosType), bool(*tpfunc)(const TInstant *, const TInstant *, const TInstant *, const TInstant *, Datum *, TimestampTz *))
Generic arithmetic operator on two temporal numbers.
Definition: tnumber_mathfuncs.c:226
bool tnumber_mult_tp_at_timestamp(const TInstant *start1, const TInstant *end1, const TInstant *start2, const TInstant *end2, Datum *value, TimestampTz *t)
Find the single timestamptz at which the multiplication of two temporal number segments is at a local...
Definition: tnumber_mathfuncs.c:143
bool tnumber_div_tp_at_timestamp(const TInstant *start1, const TInstant *end1, const TInstant *start2, const TInstant *end2, Datum *value, TimestampTz *t)
Find the single timestamptz at which the division of two temporal number segments is at a local minim...
Definition: tnumber_mathfuncs.c:157
Temporal * arithop_tnumber_number(const Temporal *temp, Datum value, meosType basetype, TArithmetic oper, Datum(*func)(Datum, Datum, meosType, meosType), bool invert)
Generic arithmetic operator on a temporal number and a number.
Definition: tnumber_mathfuncs.c:179
TArithmetic
Mathematical operators (+, -, *, /) and functions (round, degrees, ...) for temporal numbers.
Definition: tnumber_mathfuncs.h:48
@ SUB
Definition: tnumber_mathfuncs.h:50
@ MULT
Definition: tnumber_mathfuncs.h:51
@ DIV
Definition: tnumber_mathfuncs.h:52
@ DIST
Definition: tnumber_mathfuncs.h:53
@ ADD
Definition: tnumber_mathfuncs.h:49
int64 TimestampTz
Definition: pg_ext_defs.in.h:19
uintptr_t Datum
Definition: pg_ext_defs.in.h:4
Structure to represent temporal values of instant subtype.
Definition: meos.h:148
Structure to represent temporal values of sequence set subtype.
Definition: meos.h:186
Structure to represent temporal values of instant set or sequence subtype.
Definition: meos.h:165
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: meos.h:136