MobilityDB  1.0
tnumber_distance.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * This MobilityDB code is provided under The PostgreSQL License.
4  *
5  * Copyright (c) 2016-2021, Université libre de Bruxelles and MobilityDB
6  * contributors
7  *
8  * MobilityDB includes portions of PostGIS version 3 source code released
9  * under the GNU General Public License (GPLv2 or later).
10  * Copyright (c) 2001-2021, PostGIS contributors
11  *
12  * Permission to use, copy, modify, and distribute this software and its
13  * documentation for any purpose, without fee, and without a written
14  * agreement is hereby granted, provided that the above copyright notice and
15  * this paragraph and the following two paragraphs appear in all copies.
16  *
17  * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
18  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
19  * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
20  * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
21  * OF SUCH DAMAGE.
22  *
23  * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
24  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25  * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
26  * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
27  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
28  *
29  *****************************************************************************/
30 
36 #ifndef __TNUMBER_DISTANCE_H__
37 #define __TNUMBER_DISTANCE_H__
38 
39 #include <postgres.h>
40 #include <catalog/pg_type.h>
41 #include <float.h>
42 
43 #include "temporal.h"
44 
45 /*****************************************************************************/
46 
47 /* Distance functions */
48 
49 extern Datum distance_base_tnumber(PG_FUNCTION_ARGS);
50 extern Datum distance_tnumber_base(PG_FUNCTION_ARGS);
51 extern Datum distance_tnumber_tnumber(PG_FUNCTION_ARGS);
52 
53 /* Nearest approach distance */
54 
55 extern Datum NAD_base_tnumber(PG_FUNCTION_ARGS);
56 extern Datum NAD_tnumber_base(PG_FUNCTION_ARGS);
57 extern Datum NAD_tbox_tbox(PG_FUNCTION_ARGS);
58 extern Datum NAD_tbox_tnumber(PG_FUNCTION_ARGS);
59 extern Datum NAD_tnumber_tbox(PG_FUNCTION_ARGS);
60 extern Datum NAD_tnumber_tnumber(PG_FUNCTION_ARGS);
61 
62 extern double NAD_tbox_tbox_internal(const TBOX *box1, const TBOX *box2);
63 
64 // NAI and shortestline functions are not yet implemented
65 // Are they useful ?
66 
67 /*****************************************************************************/
68 
69 #endif
Datum NAD_tnumber_tnumber(PG_FUNCTION_ARGS)
Returns the nearest approach distance between the temporal numbers.
Definition: tnumber_distance.c:388
Datum distance_tnumber_tnumber(PG_FUNCTION_ARGS)
Returns the temporal distance between the two temporal points.
Definition: tnumber_distance.c:179
Datum distance_base_tnumber(PG_FUNCTION_ARGS)
Returns the temporal distance between the value and the temporal number.
Definition: tnumber_distance.c:114
Datum NAD_base_tnumber(PG_FUNCTION_ARGS)
Returns the temporal distance between the value and the temporal number.
Definition: tnumber_distance.c:221
Basic functions for temporal types of any subtype.
Datum NAD_tnumber_tbox(PG_FUNCTION_ARGS)
Returns the nearest approach distance between the temporal number and the temporal box...
Definition: tnumber_distance.c:372
Datum NAD_tnumber_base(PG_FUNCTION_ARGS)
Returns the temporal distance between the temporal number and the value.
Definition: tnumber_distance.c:237
Structure to represent temporal boxes.
Definition: tbox.h:53
Datum distance_tnumber_base(PG_FUNCTION_ARGS)
Returns the temporal distance between the temporal number and the value.
Definition: tnumber_distance.c:133
Datum NAD_tbox_tbox(PG_FUNCTION_ARGS)
Returns the nearest approach distance between the temporal boxes.
Definition: tnumber_distance.c:297
double NAD_tbox_tbox_internal(const TBOX *box1, const TBOX *box2)
Returns the nearest approach distance between the temporal boxes (internal function) ...
Definition: tnumber_distance.c:252
Datum NAD_tbox_tnumber(PG_FUNCTION_ARGS)
Returns the nearest approach distance between the temporal box and the temporal number.
Definition: tnumber_distance.c:355