MobilityDB 1.3
Loading...
Searching...
No Matches
doublen.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 __DOUBLEN_H__
36#define __DOUBLEN_H__
37
38/* C */
39#include <stdbool.h>
40
41/*****************************************************************************/
42
47typedef struct
48{
49 double a;
50 double b;
51} double2;
52
57typedef struct
58{
59 double a;
60 double b;
61 double c;
62} double3;
63
68typedef struct
69{
70 double a;
71 double b;
72 double c;
73 double d;
74} double4;
75
76/*****************************************************************************/
77
78extern char *double2_out(const double2 *d, int maxdd);
79extern void double2_set(double a, double b, double2 *result);
80extern double2 *double2_add(const double2 *d1, const double2 *d2);
81extern bool double2_eq(const double2 *d1, const double2 *d2);
82
83extern char *double3_out(const double3 *d, int maxdd);
84extern void double3_set(double a, double b, double c, double3 *result);
85extern double3 *double3_add(const double3 *d1, const double3 *d2);
86extern bool double3_eq(const double3 *d1, const double3 *d2);
87
88extern char *double4_out(const double4 *d, int maxdd);
89extern void double4_set(double a, double b, double c, double d, double4 *result);
90extern double4 *double4_add(const double4 *d1, const double4 *d2);
91extern bool double4_eq(const double4 *d1, const double4 *d2);
92
93/*****************************************************************************/
94
95#endif /* __DOUBLEN_H__ */
void double2_set(double a, double b, double2 *result)
Set a double2 value from the double values.
Definition: doublen.c:92
bool double3_eq(const double3 *d1, const double3 *d2)
Return true if the double3 values are equal.
Definition: doublen.c:188
double2 * double2_add(const double2 *d1, const double2 *d2)
Return the addition of the double2 values.
Definition: doublen.c:105
char * double2_out(const double2 *d, int maxdd)
Output function for double2 values.
Definition: doublen.c:75
double4 * double4_add(const double4 *d1, const double4 *d2)
Return the addition of the double4 values.
Definition: doublen.c:248
void double4_set(double a, double b, double c, double d, double4 *result)
Set a double4 value from the double values.
Definition: doublen.c:233
void double3_set(double a, double b, double c, double3 *result)
Set a double3 value from the double values.
Definition: doublen.c:161
double3 * double3_add(const double3 *d1, const double3 *d2)
Return the addition of the double3 values.
Definition: doublen.c:175
char * double4_out(const double4 *d, int maxdd)
Output function for double4 values.
Definition: doublen.c:214
bool double4_eq(const double4 *d1, const double4 *d2)
Return true if the double4 values are equal.
Definition: doublen.c:262
char * double3_out(const double3 *d, int maxdd)
Output function for double3 values.
Definition: doublen.c:143
bool double2_eq(const double2 *d1, const double2 *d2)
Return true if the double2 values are equal.
Definition: doublen.c:117
double b
Definition: doublen.h:50
double a
Definition: doublen.h:49
Internal types used in particular for computing the average and centroid temporal aggregates.
Definition: doublen.h:48
double a
Definition: doublen.h:59
double b
Definition: doublen.h:60
double c
Definition: doublen.h:61
Structure to represent values of the internal type for computing aggregates for 2D temporal points.
Definition: doublen.h:58
double c
Definition: doublen.h:72
double d
Definition: doublen.h:73
double a
Definition: doublen.h:70
double b
Definition: doublen.h:71
Structure to represent values of the internal type for computing aggregates for 3D temporal points.
Definition: doublen.h:69