MobilityDB 1.1
tnumber_distance.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
34#ifndef __TNUMBER_DISTANCE_H__
35#define __TNUMBER_DISTANCE_H__
36
37/* MEOS */
38#include "general/meos_catalog.h"
39#include "general/temporal.h"
40
41/*****************************************************************************/
42
43/* Distance functions */
44
45extern Temporal *distance_tnumber_number(const Temporal *temp, Datum value,
46 meosType valuetype, meosType restype);
48 const Temporal *temp2, meosType restype);
49
50extern Datum number_distance(Datum l, Datum r, meosType typel,
51 meosType typer);
52
53/* Nearest approach distance */
54
55extern double nad_tnumber_number(const Temporal *temp, Datum value,
56 meosType basetype);
57extern double nad_tbox_tbox(const TBox *box1, const TBox *box2);
58extern double nad_tnumber_tbox(const Temporal *temp, const TBox *box);
59
60// NAI and shortestline functions are not yet implemented
61// Are they useful ?
62
63/*****************************************************************************/
64
65#endif
double nad_tnumber_number(const Temporal *temp, Datum value, meosType basetype)
Return the nearest approach distance between a temporal number and a number.
Definition: tnumber_distance.c:208
Temporal * distance_tnumber_number(const Temporal *temp, Datum value, meosType valuetype, meosType restype)
Distance functions for temporal numbers.
Definition: tnumber_distance.c:86
double nad_tnumber_tbox(const Temporal *temp, const TBox *box)
Return the nearest approach distance between a temporal number and a temporal box.
Definition: tnumber_distance.c:280
double nad_tbox_tbox(const TBox *box1, const TBox *box2)
Return the nearest approach distance between the temporal boxes.
Definition: tnumber_distance.c:250
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:53
uintptr_t Datum
Definition: pg_ext_defs.in.h:4
Structure to represent temporal boxes.
Definition: meos.h:97
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: meos.h:136
Temporal * distance_tnumber_tnumber1(const Temporal *temp1, const Temporal *temp2, meosType restype)
Return the temporal distance between two temporal numbers.
Definition: tnumber_distance.c:160
Datum number_distance(Datum l, Datum r, meosType typel, meosType typer)
Distance functions for temporal numbers.
Definition: tnumber_distance.c:55