MobilityDB 1.3
Loading...
Searching...
No Matches
meos_internal.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * This MobilityDB code seq 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 seq 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 __MEOS_INTERNAL_H__
35#define __MEOS_INTERNAL_H__
36
37/* C */
38#include <stddef.h>
39/* JSON-C */
40#include <json-c/json.h>
41/* GSL */
42#include <gsl/gsl_rng.h>
43#include <gsl/gsl_randist.h>
44/* PROJ */
45#include <proj.h>
46/* PostgreSQL */
47/* MEOS */
48#include <meos.h>
49#include "temporal/meos_catalog.h" /* For meosType */
50
51/*****************************************************************************
52 * Validity macros
53 *****************************************************************************/
54
58#if MEOS
59 #define VALIDATE_NOT_NULL(ptr, ret) \
60 do { if (! ensure_not_null((void *) (ptr))) return (ret); } while (0)
61#else
62 #define VALIDATE_NOT_NULL(ptr, ret) \
63 do { assert(ptr); } while (0)
64#endif /* MEOS */
65
66/*****************************************************************************/
67
71#if MEOS
72 #define VALIDATE_INTSET(set, ret) \
73 do { \
74 if (! ensure_not_null((void *) (set)) || \
75 ! ensure_set_isof_type((set), T_INTSET) ) \
76 return (ret); \
77 } while (0)
78#else
79 #define VALIDATE_INTSET(set, ret) \
80 do { \
81 assert(set); \
82 assert((set)->settype == T_INTSET); \
83 } while (0)
84#endif /* MEOS */
85
89#if MEOS
90 #define VALIDATE_BIGINTSET(set, ret) \
91 do { \
92 if (! ensure_not_null((void *) (set)) || \
93 ! ensure_set_isof_type((set), T_BIGINTSET) ) \
94 return (ret); \
95 } while (0)
96#else
97 #define VALIDATE_BIGINTSET(set, ret) \
98 do { \
99 assert(set); \
100 assert((set)->settype == T_BIGINTSET); \
101 } while (0)
102#endif /* MEOS */
103
107#if MEOS
108 #define VALIDATE_FLOATSET(set, ret) \
109 do { \
110 if (! ensure_not_null((void *) (set)) || \
111 ! ensure_set_isof_type((set), T_FLOATSET) ) \
112 return (ret); \
113 } while (0)
114#else
115 #define VALIDATE_FLOATSET(set, ret) \
116 do { \
117 assert(set); \
118 assert((set)->settype == T_FLOATSET); \
119 } while (0)
120#endif /* MEOS */
121
125#if MEOS
126 #define VALIDATE_TEXTSET(set, ret) \
127 do { \
128 if (! ensure_not_null((void *) (set)) || \
129 ! ensure_set_isof_type((set), T_TEXTSET) ) \
130 return (ret); \
131 } while (0)
132#else
133 #define VALIDATE_TEXTSET(set, ret) \
134 do { \
135 assert(set); \
136 assert((set)->settype == T_TEXTSET); \
137 } while (0)
138#endif /* MEOS */
139
143#if MEOS
144 #define VALIDATE_DATESET(set, ret) \
145 do { \
146 if (! ensure_not_null((void *) (set)) || \
147 ! ensure_set_isof_type((set), T_DATESET) ) \
148 return (ret); \
149 } while (0)
150#else
151 #define VALIDATE_DATESET(set, ret) \
152 do { \
153 assert(set); \
154 assert((set)->settype == T_DATESET); \
155 } while (0)
156#endif /* MEOS */
157
161#if MEOS
162 #define VALIDATE_TSTZSET(set, ret) \
163 do { \
164 if (! ensure_not_null((void *) (set)) || \
165 ! ensure_set_isof_type((set), T_TSTZSET) ) \
166 return (ret); \
167 } while (0)
168#else
169 #define VALIDATE_TSTZSET(set, ret) \
170 do { \
171 assert(set); \
172 assert((set)->settype == T_TSTZSET); \
173 } while (0)
174#endif /* MEOS */
175
179#if MEOS
180 #define VALIDATE_NUMSET(set, ret) \
181 do { \
182 if (! ensure_not_null((void *) (set)) || \
183 ! ensure_numset_type((set)->settype) ) \
184 return (ret); \
185 } while (0)
186#else
187 #define VALIDATE_NUMSET(set, ret) \
188 do { \
189 assert(set); \
190 assert(numset_type((set)->settype)); \
191 } while (0)
192#endif /* MEOS */
193
194/*****************************************************************************/
195
199#if MEOS
200 #define VALIDATE_INTSPAN(span, ret) \
201 do { \
202 if (! ensure_not_null((void *) (span)) || \
203 ! ensure_span_isof_type((span), T_INTSPAN) ) \
204 return (ret); \
205 } while (0)
206#else
207 #define VALIDATE_INTSPAN(span, ret) \
208 do { \
209 assert(span); \
210 assert((span)->spantype == T_INTSPAN); \
211 } while (0)
212#endif /* MEOS */
213
217#if MEOS
218 #define VALIDATE_BIGINTSPAN(span, ret) \
219 do { \
220 if (! ensure_not_null((void *) (span)) || \
221 ! ensure_span_isof_type((span), T_BIGINTSPAN) ) \
222 return (ret); \
223 } while (0)
224#else
225 #define VALIDATE_BIGINTSPAN(span, ret) \
226 do { \
227 assert(span); \
228 assert((span)->spantype == T_BIGINTSPAN); \
229 } while (0)
230#endif /* MEOS */
231
235#if MEOS
236 #define VALIDATE_FLOATSPAN(span, ret) \
237 do { \
238 if (! ensure_not_null((void *) (span)) || \
239 ! ensure_span_isof_type((span), T_FLOATSPAN) ) \
240 return (ret); \
241 } while (0)
242#else
243 #define VALIDATE_FLOATSPAN(span, ret) \
244 do { \
245 assert(span); \
246 assert((span)->spantype == T_FLOATSPAN); \
247 } while (0)
248#endif /* MEOS */
249
253#if MEOS
254 #define VALIDATE_DATESPAN(span, ret) \
255 do { \
256 if (! ensure_not_null((void *) (span)) || \
257 ! ensure_span_isof_type((span), T_DATESPAN) ) \
258 return (ret); \
259 } while (0)
260#else
261 #define VALIDATE_DATESPAN(span, ret) \
262 do { \
263 assert(span); \
264 assert((span)->spantype == T_DATESPAN); \
265 } while (0)
266#endif /* MEOS */
267
268
272#if MEOS
273 #define VALIDATE_TSTZSPAN(span, ret) \
274 do { \
275 if (! ensure_not_null((void *) (span)) || \
276 ! ensure_span_isof_type((span), T_TSTZSPAN) ) \
277 return (ret); \
278 } while (0)
279#else
280 #define VALIDATE_TSTZSPAN(span, ret) \
281 do { \
282 assert(span); \
283 assert((span)->spantype == T_TSTZSPAN); \
284 } while (0)
285#endif /* MEOS */
286
290#if MEOS
291 #define VALIDATE_NUMSPAN(span, ret) \
292 do { \
293 if (! ensure_not_null((void *) (span)) || \
294 ! ensure_numspan_type((span)->spantype) ) \
295 return (ret); \
296 } while (0)
297#else
298 #define VALIDATE_NUMSPAN(span, ret) \
299 do { \
300 assert(span); \
301 assert(numspan_type((span)->spantype)); \
302 } while (0)
303#endif /* MEOS */
304
305/*****************************************************************************/
306
310#if MEOS
311 #define VALIDATE_INTSPANSET(ss, ret) \
312 do { \
313 if (! ensure_not_null((void *) (ss)) || \
314 ! ensure_spanset_isof_type((ss), T_INTSPANSET) ) \
315 return (ret); \
316 } while (0)
317#else
318 #define VALIDATE_INTSPANSET(ss, ret) \
319 do { \
320 assert(ss); \
321 assert((ss)->spansettype == T_INTSPANSET); \
322 } while (0)
323#endif /* MEOS */
324
328#if MEOS
329 #define VALIDATE_BIGINTSPANSET(ss, ret) \
330 do { \
331 if (! ensure_not_null((void *) (ss)) || \
332 ! ensure_spanset_isof_type((ss), T_BIGINTSPANSET) ) \
333 return (ret); \
334 } while (0)
335#else
336 #define VALIDATE_BIGINTSPANSET(ss, ret) \
337 do { \
338 assert(ss); \
339 assert((ss)->spansettype == T_BIGINTSPANSET); \
340 } while (0)
341#endif /* MEOS */
342
346#if MEOS
347 #define VALIDATE_FLOATSPANSET(ss, ret) \
348 do { \
349 if (! ensure_not_null((void *) (ss)) || \
350 ! ensure_spanset_isof_type((ss), T_FLOATSPANSET) ) \
351 return (ret); \
352 } while (0)
353#else
354 #define VALIDATE_FLOATSPANSET(ss, ret) \
355 do { \
356 assert(ss); \
357 assert((ss)->spansettype == T_FLOATSPANSET); \
358 } while (0)
359#endif /* MEOS */
360
364#if MEOS
365 #define VALIDATE_DATESPANSET(ss, ret) \
366 do { \
367 if (! ensure_not_null((void *) (ss)) || \
368 ! ensure_spanset_isof_type((ss), T_DATESPANSET) ) \
369 return (ret); \
370 } while (0)
371#else
372 #define VALIDATE_DATESPANSET(ss, ret) \
373 do { \
374 assert(ss); \
375 assert((ss)->spansettype == T_DATESPANSET); \
376 } while (0)
377#endif /* MEOS */
378
382#if MEOS
383 #define VALIDATE_TSTZSPANSET(ss, ret) \
384 do { \
385 if (! ensure_not_null((void *) (ss)) || \
386 ! ensure_spanset_isof_type(ss, T_TSTZSPANSET) ) \
387 return (ret); \
388 } while (0)
389#else
390 #define VALIDATE_TSTZSPANSET(ss, ret) \
391 do { \
392 assert(ss); \
393 assert((ss)->spansettype == T_TSTZSPANSET); \
394 } while (0)
395#endif /* MEOS */
396
400#if MEOS
401 #define VALIDATE_NUMSPANSET(ss, ret) \
402 do { \
403 if (! ensure_not_null((void *) (ss)) || \
404 ! ensure_numspanset_type((ss)->spansettype) ) \
405 return (ret); \
406 } while (0)
407#else
408 #define VALIDATE_NUMSPANSET(ss, ret) \
409 do { \
410 assert(ss); \
411 assert(numspanset_type((ss)->spansettype)); \
412 } while (0)
413#endif /* MEOS */
414
415/*****************************************************************************/
416
422#if MEOS
423 #define VALIDATE_TBOOL(temp, ret) \
424 do { \
425 if (! ensure_not_null((void *) (temp)) || \
426 ! ensure_temporal_isof_type((Temporal *) (temp), T_TBOOL) ) \
427 return (ret); \
428 } while (0)
429#else
430 #define VALIDATE_TBOOL(temp, ret) \
431 do { \
432 assert(temp); \
433 assert(((Temporal *) (temp))->temptype == T_TBOOL); \
434 } while (0)
435#endif /* MEOS */
436
442#if MEOS
443 #define VALIDATE_TINT(temp, ret) \
444 do { \
445 if (! ensure_not_null((void *) (temp)) || \
446 ! ensure_temporal_isof_type((Temporal *) (temp), T_TINT) ) \
447 return (ret); \
448 } while (0)
449#else
450 #define VALIDATE_TINT(temp, ret) \
451 do { \
452 assert(temp); \
453 assert(((Temporal *) (temp))->temptype == T_TINT); \
454 } while (0)
455#endif /* MEOS */
456
462#if MEOS
463 #define VALIDATE_TFLOAT(temp, ret) \
464 do { \
465 if (! ensure_not_null((void *) (temp)) || \
466 ! ensure_temporal_isof_type((Temporal *) (temp), T_TFLOAT) ) \
467 return (ret); \
468 } while (0)
469#else
470 #define VALIDATE_TFLOAT(temp, ret) \
471 do { \
472 assert(temp); \
473 assert(((Temporal *) (temp))->temptype == T_TFLOAT); \
474 } while (0)
475#endif /* MEOS */
476
482#if MEOS
483 #define VALIDATE_TTEXT(temp, ret) \
484 do { \
485 if (! ensure_not_null((void *) (temp)) || \
486 ! ensure_temporal_isof_type((Temporal *) (temp), T_TTEXT) ) \
487 return (ret); \
488 } while (0)
489#else
490 #define VALIDATE_TTEXT(temp, ret) \
491 do { \
492 assert(temp); \
493 assert(((Temporal *) (temp))->temptype == T_TTEXT); \
494 } while (0)
495#endif /* MEOS */
496
502#if MEOS
503 #define VALIDATE_TNUMBER(temp, ret) \
504 do { \
505 if (! ensure_not_null((void *) (temp)) || \
506 ! ensure_tnumber_type(((Temporal *) (temp))->temptype) ) \
507 return (ret); \
508 } while (0)
509#else
510 #define VALIDATE_TNUMBER(temp, ret) \
511 do { \
512 assert(temp); \
513 assert(tnumber_type(((Temporal *) (temp))->temptype)); \
514 } while (0)
515#endif /* MEOS */
516
517/*****************************************************************************
518 * Macros for manipulating the 'flags' element where the less significant
519 * bits are MGTZXIICB, where
520 * M: (GEOM) the reference geometry is stored
521 * G: coordinates are geodetic
522 * T: has T coordinate,
523 * Z: has Z coordinate
524 * X: has value or X coordinate
525 * II: interpolation, whose values are
526 * - 00: INTERP_NONE (undetermined) for TInstant
527 * - 01: DISCRETE
528 * - 10: STEP
529 * - 11: LINEAR
530 * C: continuous base type / Ordered set
531 * B: base type passed by value
532 * Notice that the interpolation flags are only needed for sequence and
533 * sequence set subtypes.
534 *****************************************************************************/
535
536/* The following flag is only used for Set and TInstant */
537#define MEOS_FLAG_BYVAL 0x0001 // 1
538/* The following flag is only used for Set */
539#define MEOS_FLAG_ORDERED 0x0002 // 2
540/* The following flag is only used for Temporal */
541#define MEOS_FLAG_CONTINUOUS 0x0002 // 2
542/* The following two interpolation flags are only used for TSequence and TSequenceSet */
543#define MEOS_FLAGS_INTERP 0x000C // 4 / 8
544/* The following two flags are used for both bounding boxes and temporal types */
545#define MEOS_FLAG_X 0x0010 // 16
546#define MEOS_FLAG_Z 0x0020 // 32
547#define MEOS_FLAG_T 0x0040 // 64
548#define MEOS_FLAG_GEODETIC 0x0080 // 128
549#define MEOS_FLAG_GEOM 0x0100 // 256
550
551#define MEOS_FLAGS_GET_BYVAL(flags) ((bool) (((flags) & MEOS_FLAG_BYVAL)))
552#define MEOS_FLAGS_GET_ORDERED(flags) ((bool) (((flags) & MEOS_FLAG_ORDERED)>>1))
553#define MEOS_FLAGS_GET_CONTINUOUS(flags) ((bool) (((flags) & MEOS_FLAG_CONTINUOUS)>>1))
554#define MEOS_FLAGS_GET_X(flags) ((bool) (((flags) & MEOS_FLAG_X)>>4))
555#define MEOS_FLAGS_GET_Z(flags) ((bool) (((flags) & MEOS_FLAG_Z)>>5))
556#define MEOS_FLAGS_GET_T(flags) ((bool) (((flags) & MEOS_FLAG_T)>>6))
557#define MEOS_FLAGS_GET_GEODETIC(flags) ((bool) (((flags) & MEOS_FLAG_GEODETIC)>>7))
558#define MEOS_FLAGS_GET_GEOM(flags) ((bool) (((flags) & MEOS_FLAG_GEOM)>>8))
559
560#define MEOS_FLAGS_BYREF(flags) ((bool) (((flags) & ! MEOS_FLAG_BYVAL)))
561
562#define MEOS_FLAGS_SET_BYVAL(flags, value) \
563 ((flags) = (value) ? ((flags) | MEOS_FLAG_BYVAL) : ((flags) & ~MEOS_FLAG_BYVAL))
564#define MEOS_FLAGS_SET_ORDERED(flags, value) \
565 ((flags) = (value) ? ((flags) | MEOS_FLAG_ORDERED) : ((flags) & ~MEOS_FLAG_ORDERED))
566#define MEOS_FLAGS_SET_CONTINUOUS(flags, value) \
567 ((flags) = (value) ? ((flags) | MEOS_FLAG_CONTINUOUS) : ((flags) & ~MEOS_FLAG_CONTINUOUS))
568#define MEOS_FLAGS_SET_X(flags, value) \
569 ((flags) = (value) ? ((flags) | MEOS_FLAG_X) : ((flags) & ~MEOS_FLAG_X))
570#define MEOS_FLAGS_SET_Z(flags, value) \
571 ((flags) = (value) ? ((flags) | MEOS_FLAG_Z) : ((flags) & ~MEOS_FLAG_Z))
572#define MEOS_FLAGS_SET_T(flags, value) \
573 ((flags) = (value) ? ((flags) | MEOS_FLAG_T) : ((flags) & ~MEOS_FLAG_T))
574#define MEOS_FLAGS_SET_GEODETIC(flags, value) \
575 ((flags) = (value) ? ((flags) | MEOS_FLAG_GEODETIC) : ((flags) & ~MEOS_FLAG_GEODETIC))
576#define MEOS_FLAGS_SET_GEOM(flags, value) \
577 ((flags) = (value) ? ((flags) | MEOS_FLAG_GEOM) : ((flags) & ~MEOS_FLAG_GEOM))
578
579#define MEOS_FLAGS_GET_INTERP(flags) (((flags) & MEOS_FLAGS_INTERP) >> 2)
580#define MEOS_FLAGS_SET_INTERP(flags, value) ((flags) = (((flags) & ~MEOS_FLAGS_INTERP) | ((value & 0x0003) << 2)))
581
582#define MEOS_FLAGS_DISCRETE_INTERP(flags) ((bool) (MEOS_FLAGS_GET_INTERP((flags)) == DISCRETE))
583#define MEOS_FLAGS_STEP_INTERP(flags) ((bool) (MEOS_FLAGS_GET_INTERP((flags)) == STEP))
584#define MEOS_FLAGS_LINEAR_INTERP(flags) ((bool) (MEOS_FLAGS_GET_INTERP((flags)) == LINEAR))
585#define MEOS_FLAGS_STEP_LINEAR_INTERP(flags) \
586 ((bool) (MEOS_FLAGS_GET_INTERP((flags)) == STEP || MEOS_FLAGS_GET_INTERP((flags)) == LINEAR))
587
588/*****************************************************************************
589 * Macros for speeding up access to component values
590 *****************************************************************************/
591
592/* Macros for speeding up access to component values of sets and span sets */
593
594#if DEBUG_BUILD
595extern void *SET_BBOX_PTR(const Set *s);
596extern size_t *SET_OFFSETS_PTR(const Set *s);
597extern Datum SET_VAL_N(const Set *s, int index);
598extern const Span *SPANSET_SP_N(const SpanSet *ss, int index);
599#else
603#define SET_BBOX_PTR(s) ( (void *)( \
604 ((char *) (s)) + DOUBLE_PAD(sizeof(Set)) ) )
605
609#define SET_OFFSETS_PTR(s) ( (size_t *)( \
610 ((char *) (s)) + DOUBLE_PAD(sizeof(Set)) + DOUBLE_PAD((s)->bboxsize) ) )
611
616#define SET_VAL_N(s, index) ( (Datum) ( \
617 MEOS_FLAGS_GET_BYVAL((s)->flags) ? (SET_OFFSETS_PTR(s))[index] : \
618 PointerGetDatum( ((char *) (s)) + DOUBLE_PAD(sizeof(Set)) + \
619 DOUBLE_PAD((s)->bboxsize) + (sizeof(size_t) * (s)->maxcount) + \
620 (SET_OFFSETS_PTR(s))[index] ) ) )
621
628#define SPANSET_SP_N(ss, index) (const Span *) &((ss)->elems[(index)])
629#endif
630
631/*****************************************************************************/
632
633/* Macros for speeding up access to components of temporal sequences (sets)*/
634
635#if DEBUG_BUILD
636extern size_t *TSEQUENCE_OFFSETS_PTR(const TSequence *seq);
637extern const TInstant *TSEQUENCE_INST_N(const TSequence *seq, int index);
638extern size_t *TSEQUENCESET_OFFSETS_PTR(const TSequenceSet *ss);
639extern const TSequence *TSEQUENCESET_SEQ_N(const TSequenceSet *ss, int index);
640#else
645#define TSEQUENCE_OFFSETS_PTR(seq) ( (size_t *)( \
646 ((char *) &((seq)->period)) + (seq)->bboxsize ) )
647
654#define TSEQUENCE_INST_N(seq, index) ( (const TInstant *)( \
655 ((char *) &((seq)->period)) + (seq)->bboxsize + \
656 (sizeof(size_t) * (seq)->maxcount) + (TSEQUENCE_OFFSETS_PTR(seq))[index] ) )
657
662#define TSEQUENCESET_OFFSETS_PTR(ss) ( (size_t *)( \
663 ((char *) &((ss)->period)) + (ss)->bboxsize ) )
664
671#define TSEQUENCESET_SEQ_N(ss, index) ( (const TSequence *)( \
672 ((char *) &((ss)->period)) + (ss)->bboxsize + \
673 (sizeof(size_t) * (ss)->maxcount) + (TSEQUENCESET_OFFSETS_PTR(ss))[index] ) )
674#endif /* DEBUG_BUILD */
675
676/*****************************************************************************
677 * Internal function accessing the Gnu Scientic Library (GSL)
678 *****************************************************************************/
679
680extern gsl_rng *gsl_get_generation_rng(void);
681extern gsl_rng *gsl_get_aggregation_rng(void);
682
683/*****************************************************************************
684 * Generic type functions
685 *****************************************************************************/
686
687#if MEOS
688#define TimestampTzGetDatum(X) Int64GetDatum(X)
689#define DatumGetTimestampTz(X)((TimestampTz) DatumGetInt64(X))
690#endif /* MEOS */
691
692extern Datum datum_ceil(Datum d);
693extern Datum datum_degrees(Datum d, Datum normalize);
694extern Datum datum_float_round(Datum value, Datum size);
695extern Datum datum_floor(Datum d);
696extern uint32 datum_hash(Datum d, meosType basetype);
697extern uint64 datum_hash_extended(Datum d, meosType basetype, uint64 seed);
698extern Datum datum_radians(Datum d);
699extern void floatspan_round_set(const Span *s, int maxdd, Span *result);
700
701/*****************************************************************************
702 * Functions for set and span types
703 *****************************************************************************/
704
705/* Input and output functions for set and span types */
706
707extern Set *set_in(const char *str, meosType basetype);
708extern char *set_out(const Set *s, int maxdd);
709extern Span *span_in(const char *str, meosType spantype);
710extern char *span_out(const Span *s, int maxdd);
711extern SpanSet *spanset_in(const char *str, meosType spantype);
712extern char *spanset_out(const SpanSet *ss, int maxdd);
713
714/*****************************************************************************/
715
716/* Constructor functions for set and span types */
717
718extern Set *set_make(const Datum *values, int count, meosType basetype, bool order);
719extern Set *set_make_exp(const Datum *values, int count, int maxcount, meosType basetype, bool order);
720extern Set *set_make_free(Datum *values, int count, meosType basetype, bool order);
721extern Span *span_make(Datum lower, Datum upper, bool lower_inc, bool upper_inc, meosType basetype);
722extern void span_set(Datum lower, Datum upper, bool lower_inc, bool upper_inc, meosType basetype, meosType spantype, Span *s);
723extern SpanSet *spanset_make_exp(Span *spans, int count, int maxcount, bool normalize, bool order);
724extern SpanSet *spanset_make_free(Span *spans, int count, bool normalize, bool order);
725
726/*****************************************************************************/
727
728/* Conversion functions for set and span types */
729
730extern Span *set_span(const Set *s);
731extern SpanSet *set_spanset(const Set *s);
732extern void value_set_span(Datum value, meosType basetype, Span *s);
733extern Set *value_set(Datum d, meosType basetype);
734extern Span *value_span(Datum d, meosType basetype);
735extern SpanSet *value_spanset(Datum d, meosType basetype);
736
737/*****************************************************************************/
738
739/* Accessor functions for set and span types */
740
741extern Datum numspan_width(const Span *s);
742extern Datum numspanset_width(const SpanSet *ss, bool boundspan);
743extern Datum set_end_value(const Set *s);
744extern int set_mem_size(const Set *s);
745extern void set_set_subspan(const Set *s, int minidx, int maxidx, Span *result);
746extern void set_set_span(const Set *s, Span *result);
747extern Datum set_start_value(const Set *s);
748extern bool set_value_n(const Set *s, int n, Datum *result);
749extern Datum *set_vals(const Set *s);
750extern Datum *set_values(const Set *s);
751extern Datum spanset_lower(const SpanSet *ss);
752extern int spanset_mem_size(const SpanSet *ss);
753extern const Span **spanset_sps(const SpanSet *ss);
754extern Datum spanset_upper(const SpanSet *ss);
755
756/*****************************************************************************/
757
758/* Transformation functions for set and span types */
759
760extern void datespan_set_tstzspan(const Span *s1, Span *s2);
761extern void floatspan_set_intspan(const Span *s1, Span *s2);
762extern void intspan_set_floatspan(const Span *s1, Span *s2);
763extern Set *numset_shift_scale(const Set *s, Datum shift, Datum width, bool hasshift, bool haswidth);
764extern Span *numspan_expand(const Span *s, Datum value);
765extern Span *numspan_shift_scale(const Span *s, Datum shift, Datum width, bool hasshift, bool haswidth);
766extern SpanSet *numspanset_shift_scale(const SpanSet *ss, Datum shift, Datum width, bool hasshift, bool haswidth);
767extern Set *set_compact(const Set *s);
768extern void span_expand(const Span *s1, Span *s2);
769extern SpanSet *spanset_compact(const SpanSet *ss);
770extern TBox *tbox_expand_value(const TBox *box, Datum value, meosType basetyp);
771extern Set *textcat_textset_text_int(const Set *s, const text *txt, bool invert);
772extern void tstzspan_set_datespan(const Span *s1, Span *s2);
773
774/*****************************************************************************
775 * Comparison functions for set and span types
776 *****************************************************************************/
777
778
779/*****************************************************************************
780 * Bounding box functions for set and span types
781 *****************************************************************************/
782
783/* Topological functions for set and span types */
784
785extern bool adjacent_span_value(const Span *s, Datum value);
786extern bool adjacent_spanset_value(const SpanSet *ss, Datum value);
787extern bool adjacent_value_spanset(Datum value, const SpanSet *ss);
788extern bool contained_value_set(Datum value, const Set *s);
789extern bool contained_value_span(Datum value, const Span *s);
790extern bool contained_value_spanset(Datum value, const SpanSet *ss);
791extern bool contains_set_value(const Set *s, Datum value);
792extern bool contains_span_value(const Span *s, Datum value);
793extern bool contains_spanset_value(const SpanSet *ss, Datum value);
794extern bool ovadj_span_span(const Span *s1, const Span *s2);
795
796/*****************************************************************************/
797
798/* Position functions for set and span types */
799
800extern bool left_set_value(const Set *s, Datum value);
801extern bool left_span_value(const Span *s, Datum value);
802extern bool left_spanset_value(const SpanSet *ss, Datum value);
803extern bool left_value_set(Datum value, const Set *s);
804extern bool left_value_span(Datum value, const Span *s);
805extern bool left_value_spanset(Datum value, const SpanSet *ss);
806extern bool lfnadj_span_span(const Span *s1, const Span *s2);
807extern bool overleft_set_value(const Set *s, Datum value);
808extern bool overleft_span_value(const Span *s, Datum value);
809extern bool overleft_spanset_value(const SpanSet *ss, Datum value);
810extern bool overleft_value_set(Datum value, const Set *s);
811extern bool overleft_value_span(Datum value, const Span *s);
812extern bool overleft_value_spanset(Datum value, const SpanSet *ss);
813extern bool overright_set_value(const Set *s, Datum value);
814extern bool overright_span_value(const Span *s, Datum value);
815extern bool overright_spanset_value(const SpanSet *ss, Datum value);
816extern bool overright_value_set(Datum value, const Set *s);
817extern bool overright_value_span(Datum value, const Span *s);
818extern bool overright_value_spanset(Datum value, const SpanSet *ss);
819extern bool right_value_set(Datum value, const Set *s);
820extern bool right_set_value(const Set *s, Datum value);
821extern bool right_value_span(Datum value, const Span *s);
822extern bool right_value_spanset(Datum value, const SpanSet *ss);
823extern bool right_span_value(const Span *s, Datum value);
824extern bool right_spanset_value(const SpanSet *ss, Datum value);
825
826/*****************************************************************************/
827
828/* Set functions for set and span types */
829
830extern void bbox_union_span_span(const Span *s1, const Span *s2, Span *result);
831extern bool inter_span_span(const Span *s1, const Span *s2, Span *result);
832extern Set *intersection_set_value(const Set *s, Datum value);
833extern Span *intersection_span_value(const Span *s, Datum value);
834extern SpanSet *intersection_spanset_value(const SpanSet *ss, Datum value);
835extern Set *intersection_value_set(Datum value, const Set *s);
836extern Span *intersection_value_span(Datum value, const Span *s);
837extern SpanSet *intersection_value_spanset(Datum value, const SpanSet *ss);
838extern int mi_span_span(const Span *s1, const Span *s2, Span *result);
839extern Set *minus_set_value(const Set *s, Datum value);
840extern SpanSet *minus_span_value(const Span *s, Datum value);
841extern SpanSet *minus_spanset_value(const SpanSet *ss, Datum value);
842extern Set *minus_value_set(Datum value, const Set *s);
843extern SpanSet *minus_value_span(Datum value, const Span *s);
844extern SpanSet *minus_value_spanset(Datum value, const SpanSet *ss);
845extern Span *super_union_span_span(const Span *s1, const Span *s2);
846extern Set *union_set_value(const Set *s, Datum value);
847extern SpanSet *union_span_value(const Span *s, Datum value);
848extern SpanSet *union_spanset_value(const SpanSet *ss, Datum value);
849extern Set *union_value_set(Datum value, const Set *s);
850extern SpanSet *union_value_span(Datum value, const Span *s);
851extern SpanSet *union_value_spanset(Datum value, const SpanSet *ss);
852
853/*****************************************************************************/
854
855/* Distance functions for set and span types */
856
857extern Datum distance_set_set(const Set *s1, const Set *s2);
858extern Datum distance_set_value(const Set *s, Datum value);
859extern Datum distance_span_span(const Span *s1, const Span *s2);
860extern Datum distance_span_value(const Span *s, Datum value);
861extern Datum distance_spanset_span(const SpanSet *ss, const Span *s);
862extern Datum distance_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2);
863extern Datum distance_spanset_value(const SpanSet *ss, Datum value);
864extern Datum distance_value_value(Datum l, Datum r, meosType basetype);
865
866/*****************************************************************************/
867
868/* Aggregate functions for set and span types */
869
870extern Span *spanbase_extent_transfn(Span *state, Datum value, meosType basetype);
871extern Set *value_union_transfn(Set *state, Datum value, meosType basetype);
872
873/******************************************************************************
874 * Functions for box types
875 *****************************************************************************/
876
877/* Constructor functions for box types */
878
879extern TBox *number_tstzspan_to_tbox(Datum d, meosType basetype, const Span *s);
881extern void tbox_set(const Span *s, const Span *p, TBox *box);
882
883/*****************************************************************************/
884
885/* Conversion functions for box types */
886
887extern void float_set_tbox(double d, TBox *box);
888extern void int_set_tbox(int i, TBox *box);
889extern void number_set_tbox(Datum d, meosType basetype, TBox *box);
890extern TBox *number_tbox(Datum value, meosType basetype);
891extern void numset_set_tbox(const Set *s, TBox *box);
892extern void numspan_set_tbox(const Span *span, TBox *box);
893extern void numspanset_set_tbox(const SpanSet *ss, TBox *box);
894extern void timestamptz_set_tbox(TimestampTz t, TBox *box);
895extern void tstzset_set_tbox(const Set *s, TBox *box);
896extern void tstzspan_set_tbox(const Span *s, TBox *box);
897extern void tstzspanset_set_tbox(const SpanSet *ss, TBox *box);
898
899/*****************************************************************************/
900
901/* Accessor functions for box types */
902
903
904/*****************************************************************************/
905
906/* Transformation functions for box types */
907
908extern TBox *tbox_shift_scale_value(const TBox *box, Datum shift, Datum width, bool hasshift, bool haswidth);
909extern void tbox_expand(const TBox *box1, TBox *box2);
910
911/*****************************************************************************/
912
913/* Set functions for box types */
914
915extern bool inter_tbox_tbox(const TBox *box1, const TBox *box2, TBox *result);
916
917/*****************************************************************************
918 * Functions for temporal types
919 *****************************************************************************/
920
921/* Input and output functions for temporal types */
922
923extern TInstant *tboolinst_from_mfjson(json_object *mfjson);
924extern TInstant *tboolinst_in(const char *str);
925extern TSequence *tboolseq_from_mfjson(json_object *mfjson);
926extern TSequence *tboolseq_in(const char *str, interpType interp);
927extern TSequenceSet *tboolseqset_from_mfjson(json_object *mfjson);
928extern TSequenceSet *tboolseqset_in(const char *str);
929extern Temporal *temporal_in(const char *str, meosType temptype);
930extern char *temporal_out(const Temporal *temp, int maxdd);
931extern char **temparr_out(const Temporal **temparr, int count, int maxdd);
932extern TInstant *tfloatinst_from_mfjson(json_object *mfjson);
933extern TInstant *tfloatinst_in(const char *str);
934extern TSequence *tfloatseq_from_mfjson(json_object *mfjson, interpType interp);
935extern TSequence *tfloatseq_in(const char *str, interpType interp);
936extern TSequenceSet *tfloatseqset_from_mfjson(json_object *mfjson, interpType interp);
937extern TSequenceSet *tfloatseqset_in(const char *str);
938extern TInstant *tinstant_from_mfjson(json_object *mfjson, bool spatial, int32_t srid, meosType temptype);
939extern TInstant *tinstant_in(const char *str, meosType temptype);
940extern char *tinstant_out(const TInstant *inst, int maxdd);
941extern TInstant *tintinst_from_mfjson(json_object *mfjson);
942extern TInstant *tintinst_in(const char *str);
943extern TSequence *tintseq_from_mfjson(json_object *mfjson);
944extern TSequence *tintseq_in(const char *str, interpType interp);
945extern TSequenceSet *tintseqset_from_mfjson(json_object *mfjson);
946extern TSequenceSet *tintseqset_in(const char *str);
947extern TSequence *tsequence_from_mfjson(json_object *mfjson, bool spatial, int32_t srid, meosType temptype, interpType interp);
948extern TSequence *tsequence_in(const char *str, meosType temptype, interpType interp);
949extern char *tsequence_out(const TSequence *seq, int maxdd);
950extern TSequenceSet *tsequenceset_from_mfjson(json_object *mfjson, bool spatial, int32_t srid, meosType temptype, interpType interp);
951extern TSequenceSet *tsequenceset_in(const char *str, meosType temptype, interpType interp);
952extern char *tsequenceset_out(const TSequenceSet *ss, int maxdd);
953extern TInstant *ttextinst_from_mfjson(json_object *mfjson);
954extern TInstant *ttextinst_in(const char *str);
955extern TSequence *ttextseq_from_mfjson(json_object *mfjson);
956extern TSequence *ttextseq_in(const char *str, interpType interp);
957extern TSequenceSet *ttextseqset_from_mfjson(json_object *mfjson);
958extern TSequenceSet *ttextseqset_in(const char *str);
959extern Temporal *temporal_from_mfjson(const char *mfjson, meosType temptype);
960
961/*****************************************************************************/
962
963/* Constructor functions for temporal types */
964
965extern Temporal *temporal_from_base_temp(Datum value, meosType temptype, const Temporal *temp);
966extern TInstant *tinstant_copy(const TInstant *inst);
967extern TInstant *tinstant_make(Datum value, meosType temptype, TimestampTz t);
968extern TInstant *tinstant_make_free(Datum value, meosType temptype, TimestampTz t);
969extern TSequence *tsequence_copy(const TSequence *seq);
970extern TSequence *tsequence_from_base_temp(Datum value, meosType temptype, const TSequence *seq);
971extern TSequence *tsequence_from_base_tstzset(Datum value, meosType temptype, const Set *s);
972extern TSequence *tsequence_from_base_tstzspan(Datum value, meosType temptype, const Span *s, interpType interp);
973extern TSequence *tsequence_make_exp(const TInstant **instants, int count, int maxcount, bool lower_inc, bool upper_inc, interpType interp, bool normalize);
974extern TSequence *tsequence_make_free(TInstant **instants, int count, bool lower_inc, bool upper_inc, interpType interp, bool normalize);
976extern TSequenceSet *tseqsetarr_to_tseqset(TSequenceSet **seqsets, int count, int totalseqs);
977extern TSequenceSet *tsequenceset_from_base_temp(Datum value, meosType temptype, const TSequenceSet *ss);
978extern TSequenceSet *tsequenceset_from_base_tstzspanset(Datum value, meosType temptype, const SpanSet *ss, interpType interp);
979extern TSequenceSet *tsequenceset_make_exp(const TSequence **sequences, int count, int maxcount, bool normalize);
980extern TSequenceSet *tsequenceset_make_free(TSequence **sequences, int count, bool normalize);
981
982/*****************************************************************************/
983
984/* Conversion functions for temporal types */
985
986extern void temporal_set_tstzspan(const Temporal *temp, Span *s);
987extern void tinstant_set_tstzspan(const TInstant *inst, Span *s);
988extern void tnumber_set_tbox(const Temporal *temp, TBox *box);
989extern void tnumberinst_set_tbox(const TInstant *inst, TBox *box);
990extern void tnumberseq_set_tbox(const TSequence *seq, TBox *box);
991extern void tnumberseqset_set_tbox(const TSequenceSet *ss, TBox *box);
992extern void tsequence_set_tstzspan(const TSequence *seq, Span *s);
993extern void tsequenceset_set_tstzspan(const TSequenceSet *ss, Span *s);
994
995/*****************************************************************************/
996
997/* Accessor functions for temporal types */
998
999extern const TInstant *temporal_end_inst(const Temporal *temp);
1000extern Datum temporal_end_value(const Temporal *temp);
1001extern const TInstant *temporal_inst_n(const Temporal *temp, int n);
1002extern const TInstant **temporal_instants_p(const Temporal *temp, int *count);
1003extern Datum temporal_max_value(const Temporal *temp);
1004extern size_t temporal_mem_size(const Temporal *temp);
1005extern Datum temporal_min_value(const Temporal *temp);
1006extern const TSequence **temporal_sequences_p(const Temporal *temp, int *count);
1007extern void temporal_set_bbox(const Temporal *temp, void *box);
1008extern const TInstant *temporal_start_inst(const Temporal *temp);
1009extern Datum temporal_start_value(const Temporal *temp);
1010extern Datum *temporal_values_p(const Temporal *temp, int *count);
1011extern bool temporal_value_n(const Temporal *temp, int n, Datum *result);
1012extern Datum *temporal_values(const Temporal *temp, int *count);
1013extern uint32 tinstant_hash(const TInstant *inst);
1014extern const TInstant **tinstant_insts(const TInstant *inst, int *count);
1015extern void tinstant_set_bbox(const TInstant *inst, void *box);
1016extern SpanSet *tinstant_time(const TInstant *inst);
1017extern TimestampTz *tinstant_timestamps(const TInstant *inst, int *count);
1018extern Datum tinstant_value_p(const TInstant *inst);
1019extern Datum tinstant_value(const TInstant *inst);
1020extern bool tinstant_value_at_timestamptz(const TInstant *inst, TimestampTz t, Datum *result);
1021extern Datum *tinstant_values_p(const TInstant *inst, int *count);
1022extern void tnumber_set_span(const Temporal *temp, Span *span);
1023extern SpanSet *tnumberinst_valuespans(const TInstant *inst);
1024extern SpanSet *tnumberseq_valuespans(const TSequence *seq);
1026extern Interval *tsequence_duration(const TSequence *seq);
1028extern uint32 tsequence_hash(const TSequence *seq);
1029extern const TInstant **tsequence_insts_p(const TSequence *seq);
1030extern const TInstant *tsequence_max_inst(const TSequence *seq);
1031extern Datum tsequence_max_val(const TSequence *seq);
1032extern const TInstant *tsequence_min_inst(const TSequence *seq);
1033extern Datum tsequence_min_val(const TSequence *seq);
1034extern TSequence **tsequence_segments(const TSequence *seq, int *count);
1035extern const TSequence **tsequence_seqs(const TSequence *seq, int *count);
1037extern SpanSet *tsequence_time(const TSequence *seq);
1038extern TimestampTz *tsequence_timestamps(const TSequence *seq, int *count);
1039extern bool tsequence_value_at_timestamptz(const TSequence *seq, TimestampTz t, bool strict, Datum *result);
1040extern Datum *tsequence_values_p(const TSequence *seq, int *count);
1041extern Interval *tsequenceset_duration(const TSequenceSet *ss, bool boundspan);
1043extern uint32 tsequenceset_hash(const TSequenceSet *ss);
1044extern const TInstant *tsequenceset_inst_n(const TSequenceSet *ss, int n);
1045extern const TInstant **tsequenceset_insts_p(const TSequenceSet *ss);
1046extern const TInstant *tsequenceset_max_inst(const TSequenceSet *ss);
1047extern Datum tsequenceset_max_val(const TSequenceSet *ss);
1048extern const TInstant *tsequenceset_min_inst(const TSequenceSet *ss);
1049extern Datum tsequenceset_min_val(const TSequenceSet *ss);
1050extern int tsequenceset_num_instants(const TSequenceSet *ss);
1051extern int tsequenceset_num_timestamps(const TSequenceSet *ss);
1052extern TSequence **tsequenceset_segments(const TSequenceSet *ss, int *count);
1053extern const TSequence **tsequenceset_sequences_p(const TSequenceSet *ss);
1055extern SpanSet *tsequenceset_time(const TSequenceSet *ss);
1056extern bool tsequenceset_timestamptz_n(const TSequenceSet *ss, int n, TimestampTz *result);
1057extern TimestampTz *tsequenceset_timestamps(const TSequenceSet *ss, int *count);
1058extern bool tsequenceset_value_at_timestamptz(const TSequenceSet *ss, TimestampTz t, bool strict, Datum *result);
1059extern bool tsequenceset_value_n(const TSequenceSet *ss, int n, Datum *result);
1060extern Datum *tsequenceset_values_p(const TSequenceSet *ss, int *count);
1061
1062/*****************************************************************************/
1063
1064/* Transformation functions for temporal types */
1065
1066extern void temporal_restart(Temporal *temp, int count);
1067extern TSequence *temporal_tsequence(const Temporal *temp, interpType interp);
1068extern TSequenceSet *temporal_tsequenceset(const Temporal *temp, interpType interp);
1069extern TInstant *tinstant_shift_time(const TInstant *inst, const Interval *interv);
1070extern TSequence *tinstant_to_tsequence(const TInstant *inst, interpType interp);
1072extern TSequenceSet *tinstant_to_tsequenceset(const TInstant *inst, interpType interp);
1073extern Temporal *tnumber_shift_scale_value(const Temporal *temp, Datum shift, Datum width, bool hasshift, bool haswidth);
1074extern TInstant *tnumberinst_shift_value(const TInstant *inst, Datum shift);
1075extern TSequence *tnumberseq_shift_scale_value(const TSequence *seq, Datum shift, Datum width, bool hasshift, bool haswidth);
1076extern TSequenceSet *tnumberseqset_shift_scale_value(const TSequenceSet *ss, Datum start, Datum width, bool hasshift, bool haswidth);
1077extern void tsequence_restart(TSequence *seq, int count);
1078extern Temporal *tsequence_set_interp(const TSequence *seq, interpType interp);
1079extern TSequence *tsequence_shift_scale_time(const TSequence *seq, const Interval *shift, const Interval *duration);
1080extern TSequence *tsequence_subseq(const TSequence *seq, int from, int to, bool lower_inc, bool upper_inc);
1081extern TInstant *tsequence_to_tinstant(const TSequence *seq);
1085extern void tsequenceset_restart(TSequenceSet *ss, int count);
1086extern Temporal *tsequenceset_set_interp(const TSequenceSet *ss, interpType interp);
1087extern TSequenceSet *tsequenceset_shift_scale_time(const TSequenceSet *ss, const Interval *start, const Interval *duration);
1093
1094/*****************************************************************************/
1095
1096/* Modification functions for temporal types */
1097
1098extern Temporal *tinstant_merge(const TInstant *inst1, const TInstant *inst2);
1099extern Temporal *tinstant_merge_array(const TInstant **instants, int count);
1100extern Temporal *tsequence_append_tinstant(TSequence *seq, const TInstant *inst, double maxdist, const Interval *maxt, bool expand);
1101extern Temporal *tsequence_append_tsequence(const TSequence *seq1, const TSequence *seq2, bool expand);
1103extern Temporal *tsequence_delete_tstzset(const TSequence *seq, const Set *s, bool connect);
1104extern Temporal *tsequence_delete_tstzspan(const TSequence *seq, const Span *s, bool connect);
1105extern Temporal *tsequence_delete_tstzspanset(const TSequence *seq, const SpanSet *ss, bool connect);
1106extern Temporal *tsequence_insert(const TSequence *seq1, const TSequence *seq2, bool connect);
1107extern Temporal *tsequence_merge(const TSequence *seq1, const TSequence *seq2);
1108extern Temporal *tsequence_merge_array(const TSequence **sequences, int count);
1109extern TSequenceSet *tsequenceset_append_tinstant(TSequenceSet *ss, const TInstant *inst, double maxdist, const Interval *maxt, bool expand);
1110extern TSequenceSet *tsequenceset_append_tsequence(TSequenceSet *ss, const TSequence *seq, bool expand);
1112extern TSequenceSet *tsequenceset_delete_tstzset(const TSequenceSet *ss, const Set *s);
1113extern TSequenceSet *tsequenceset_delete_tstzspan(const TSequenceSet *ss, const Span *s);
1115extern TSequenceSet *tsequenceset_insert(const TSequenceSet *ss1, const TSequenceSet *ss2);
1116extern TSequenceSet *tsequenceset_merge(const TSequenceSet *ss1, const TSequenceSet *ss2);
1117extern TSequenceSet *tsequenceset_merge_array(const TSequenceSet **seqsets, int count);
1118
1119/*****************************************************************************/
1120
1121/* Bounding box functions for temporal types */
1122
1123extern void tsequence_expand_bbox(TSequence *seq, const TInstant *inst);
1124extern void tsequence_set_bbox(const TSequence *seq, void *box);
1125extern void tsequenceset_expand_bbox(TSequenceSet *ss, const TSequence *seq);
1126extern void tsequenceset_set_bbox(const TSequenceSet *ss, void *box);
1127
1128/*****************************************************************************/
1129
1130/* Restriction functions for temporal types */
1131
1132extern TSequence *tdiscseq_restrict_minmax(const TSequence *seq, bool min, bool atfunc);
1133extern TSequenceSet *tcontseq_restrict_minmax(const TSequence *seq, bool min, bool atfunc);
1134extern bool temporal_bbox_restrict_set(const Temporal *temp, const Set *set);
1135extern Temporal *temporal_restrict_minmax(const Temporal *temp, bool min, bool atfunc);
1136extern Temporal *temporal_restrict_timestamptz(const Temporal *temp, TimestampTz t, bool atfunc);
1137extern Temporal *temporal_restrict_tstzset(const Temporal *temp, const Set *s, bool atfunc);
1138extern Temporal *temporal_restrict_tstzspan(const Temporal *temp, const Span *s, bool atfunc);
1139extern Temporal *temporal_restrict_tstzspanset(const Temporal *temp, const SpanSet *ss, bool atfunc);
1140extern Temporal *temporal_restrict_value(const Temporal *temp, Datum value, bool atfunc);
1141extern Temporal *temporal_restrict_values(const Temporal *temp, const Set *set, bool atfunc);
1142extern bool temporal_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, Datum *result);
1143extern TInstant *tinstant_restrict_tstzspan(const TInstant *inst, const Span *period, bool atfunc);
1144extern TInstant *tinstant_restrict_tstzspanset(const TInstant *inst, const SpanSet *ss, bool atfunc);
1145extern TInstant *tinstant_restrict_timestamptz(const TInstant *inst, TimestampTz t, bool atfunc);
1146extern TInstant *tinstant_restrict_tstzset(const TInstant *inst, const Set *s, bool atfunc);
1147extern TInstant *tinstant_restrict_value(const TInstant *inst, Datum value, bool atfunc);
1148extern TInstant *tinstant_restrict_values(const TInstant *inst, const Set *set, bool atfunc);
1149extern Temporal *tnumber_restrict_span(const Temporal *temp, const Span *span, bool atfunc);
1150extern Temporal *tnumber_restrict_spanset(const Temporal *temp, const SpanSet *ss, bool atfunc);
1151extern TInstant *tnumberinst_restrict_span(const TInstant *inst, const Span *span, bool atfunc);
1152extern TInstant *tnumberinst_restrict_spanset(const TInstant *inst, const SpanSet *ss, bool atfunc);
1153extern TSequenceSet *tnumberseqset_restrict_span(const TSequenceSet *ss, const Span *span, bool atfunc);
1154extern TSequenceSet *tnumberseqset_restrict_spanset(const TSequenceSet *ss, const SpanSet *spanset, bool atfunc);
1156extern Temporal *tsequence_restrict_tstzspan(const TSequence *seq, const Span *s, bool atfunc);
1157extern Temporal *tsequence_restrict_tstzspanset(const TSequence *seq, const SpanSet *ss, bool atfunc);
1158extern TSequenceSet *tsequenceset_restrict_minmax(const TSequenceSet *ss, bool min, bool atfunc);
1159extern TSequenceSet *tsequenceset_restrict_tstzspan(const TSequenceSet *ss, const Span *s, bool atfunc);
1160extern TSequenceSet *tsequenceset_restrict_tstzspanset(const TSequenceSet *ss, const SpanSet *ps, bool atfunc);
1161extern Temporal *tsequenceset_restrict_timestamptz(const TSequenceSet *ss, TimestampTz t, bool atfunc);
1162extern Temporal *tsequenceset_restrict_tstzset(const TSequenceSet *ss, const Set *s, bool atfunc);
1163extern TSequenceSet *tsequenceset_restrict_value(const TSequenceSet *ss, Datum value, bool atfunc);
1164extern TSequenceSet *tsequenceset_restrict_values(const TSequenceSet *ss, const Set *s, bool atfunc);
1165
1166/*****************************************************************************/
1167
1168/* Traditional comparison functions for temporal types */
1169
1170extern int tinstant_cmp(const TInstant *inst1, const TInstant *inst2);
1171extern bool tinstant_eq(const TInstant *inst1, const TInstant *inst2);
1172extern int tsequence_cmp(const TSequence *seq1, const TSequence *seq2);
1173extern bool tsequence_eq(const TSequence *seq1, const TSequence *seq2);
1174extern int tsequenceset_cmp(const TSequenceSet *ss1, const TSequenceSet *ss2);
1175extern bool tsequenceset_eq(const TSequenceSet *ss1, const TSequenceSet *ss2);
1176
1177/*****************************************************************************/
1178
1179/* Ever/always functions for temporal types */
1180
1181extern int always_eq_base_temporal(Datum value, const Temporal *temp);
1182extern int always_eq_temporal_base(const Temporal *temp, Datum value);
1183extern int always_ne_base_temporal(Datum value, const Temporal *temp);
1184extern int always_ne_temporal_base(const Temporal *temp, Datum value);
1185extern int always_ge_base_temporal(Datum value, const Temporal *temp);
1186extern int always_ge_temporal_base(const Temporal *temp, Datum value);
1187extern int always_gt_base_temporal(Datum value, const Temporal *temp);
1188extern int always_gt_temporal_base(const Temporal *temp, Datum value);
1189extern int always_le_base_temporal(Datum value, const Temporal *temp);
1190extern int always_le_temporal_base(const Temporal *temp, Datum value);
1191extern int always_lt_base_temporal(Datum value, const Temporal *temp);
1192extern int always_lt_temporal_base(const Temporal *temp, Datum value);
1193extern int ever_eq_base_temporal(Datum value, const Temporal *temp);
1194extern int ever_eq_temporal_base(const Temporal *temp, Datum value);
1195extern int ever_ne_base_temporal(Datum value, const Temporal *temp);
1196extern int ever_ne_temporal_base(const Temporal *temp, Datum value);
1197extern int ever_ge_base_temporal(Datum value, const Temporal *temp);
1198extern int ever_ge_temporal_base(const Temporal *temp, Datum value);
1199extern int ever_gt_base_temporal(Datum value, const Temporal *temp);
1200extern int ever_gt_temporal_base(const Temporal *temp, Datum value);
1201extern int ever_le_base_temporal(Datum value, const Temporal *temp);
1202extern int ever_le_temporal_base(const Temporal *temp, Datum value);
1203extern int ever_lt_base_temporal(Datum value, const Temporal *temp);
1204extern int ever_lt_temporal_base(const Temporal *temp, Datum value);
1205
1206/*****************************************************************************/
1207
1208/* Mathematical functions for temporal types */
1209
1210extern TSequence *tfloatseq_derivative(const TSequence *seq);
1212extern TInstant *tnumberinst_abs(const TInstant *inst);
1213extern TSequence *tnumberseq_abs(const TSequence *seq);
1215extern TSequence *tnumberseq_delta_value(const TSequence *seq);
1219
1220/*****************************************************************************/
1221
1222/* Distance functions for temporal types */
1223
1224extern Temporal *distance_tnumber_number(const Temporal *temp, Datum value);
1225extern double nad_tbox_tbox(const TBox *box1, const TBox *box2);
1226extern double nad_tnumber_number(const Temporal *temp, Datum value);
1227extern double nad_tnumber_tbox(const Temporal *temp, const TBox *box);
1228extern double nad_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2);
1229
1230/*****************************************************************************/
1231
1232/* Local aggregate functions for temporal types */
1233
1234extern double tnumberseq_integral(const TSequence *seq);
1235extern double tnumberseq_twavg(const TSequence *seq);
1236extern double tnumberseqset_integral(const TSequenceSet *ss);
1237extern double tnumberseqset_twavg(const TSequenceSet *ss);
1238
1239/*****************************************************************************/
1240
1241/* Compact functions for final append aggregate */
1242
1243extern Temporal *temporal_compact(const Temporal *temp);
1244extern TSequence *tsequence_compact(const TSequence *seq);
1246
1247/*****************************************************************************/
1248
1249/* Aggregate functions for temporal types */
1250
1251extern void skiplist_free(SkipList *list);
1252extern Temporal *temporal_app_tinst_transfn(Temporal *state, const TInstant *inst, interpType interp, double maxdist, const Interval *maxt);
1254
1255/*****************************************************************************/
1256
1257/* Tile functions for span and temporal types */
1258
1259extern Span *span_bins(const Span *s, Datum size, Datum origin, int *count);
1260extern Span *spanset_bins(const SpanSet *ss, Datum size, Datum origin, int *count);
1261extern Span *tnumber_value_bins(const Temporal *temp, Datum size, Datum origin, int *count);
1262extern TBox *tnumber_value_time_boxes(const Temporal *temp, Datum vsize, const Interval *duration, Datum vorigin, TimestampTz torigin, int *count);
1263extern Temporal **tnumber_value_split(const Temporal *temp, Datum vsize, Datum vorigin, Datum **bins, int *count);
1264extern TBox *tbox_get_value_time_tile(Datum value, TimestampTz t, Datum vsize, const Interval *duration, Datum vorigin, TimestampTz torigin, meosType basetype, meosType spantype);
1265extern Temporal **tnumber_value_time_split(const Temporal *temp, Datum size, const Interval *duration, Datum vorigin, TimestampTz torigin, Datum **value_bins, TimestampTz **time_bins, int *count);
1266
1267/*****************************************************************************/
1268
1269/* Similarity functions for temporal types */
1270
1271
1272/*****************************************************************************/
1273
1274#endif /* __MEOS_INTERNAL_H__ */
TBox * number_timestamptz_to_tbox(Datum d, meosType basetype, TimestampTz t)
Return a temporal box from an integer and a timestamptz.
Definition: tbox.c:232
TBox * number_tstzspan_to_tbox(Datum d, meosType basetype, const Span *s)
Return a temporal box from an integer and a timestamptz span.
Definition: tbox.c:279
void tbox_set(const Span *s, const Span *p, TBox *box)
Return in the last argument a temporal box constructed from a number span and a timestamptz span.
Definition: tbox.c:186
void int_set_tbox(int i, TBox *box)
Return in the last argument a temporal box constructed from an integer.
Definition: tbox.c:403
void number_set_tbox(Datum d, meosType basetype, TBox *box)
Return in the last argument a temporal box constructed from a number.
Definition: tbox.c:367
void numset_set_tbox(const Set *s, TBox *box)
Return in the last argument a temporal box constructed from a number set.
Definition: tbox.c:493
TBox * number_tbox(Datum value, meosType basetype)
Convert a number into a temporal box.
Definition: tbox.c:385
void numspan_set_tbox(const Span *span, TBox *box)
Return in the last argument a temporal box constructed from a number span.
Definition: tbox.c:566
void timestamptz_set_tbox(TimestampTz t, TBox *box)
Return in the last argument a temporal box constructed from a timestamptz.
Definition: tbox.c:461
void tstzspan_set_tbox(const Span *s, TBox *box)
Return in the last argument a temporal box constructed from a timestamptz span.
Definition: tbox.c:581
void float_set_tbox(double d, TBox *box)
Return in the last argument a temporal box constructed from a float.
Definition: tbox.c:431
void tstzset_set_tbox(const Set *s, TBox *box)
Return in the last argument a temporal box constructed from a timestamptz set.
Definition: tbox.c:510
bool inter_tbox_tbox(const TBox *box1, const TBox *box2, TBox *result)
Return in the last argument the intersection of two temporal boxes.
Definition: tbox.c:1636
TBox * tbox_shift_scale_value(const TBox *box, Datum shift, Datum width, bool hasshift, bool haswidth)
Return a temporal box with the value span shifted and/or scaled by the values.
Definition: tbox.c:1080
void tbox_expand(const TBox *box1, TBox *box2)
Return the second temporal box expanded with the first one.
Definition: tbox.c:1190
TBox * tbox_expand_value(const TBox *box, Datum value, meosType basetyp)
Return a temporal box with the value span expanded/decreased by a value.
Definition: tbox.c:1267
const Span ** spanset_sps(const SpanSet *ss)
Return an array of pointers to the spans of a span set.
Definition: spanset.c:1020
Datum spanset_upper(const SpanSet *ss)
Return the lower bound a span set.
Definition: spanset.c:575
Datum * set_values(const Set *s)
Return the array of (copies of) values of a set.
Definition: set.c:711
Datum * set_vals(const Set *s)
Return the array of (pointers to the) values of a set.
Definition: set.c:695
Datum numspan_width(const Span *s)
Return the width of a span.
Definition: span.c:754
bool set_value_n(const Set *s, int n, Datum *result)
Return in the last argument a copy of the n-th value of a set.
Definition: set.c:678
Datum set_start_value(const Set *s)
Return a copy of the start value of a set.
Definition: set.c:648
Datum numspanset_width(const SpanSet *ss, bool boundspan)
Return the width of a span set.
Definition: spanset.c:619
int set_mem_size(const Set *s)
Return the size in bytes of a set.
Definition: set.c:620
Datum set_end_value(const Set *s)
Return a copy of the end value of a set.
Definition: set.c:661
Datum spanset_lower(const SpanSet *ss)
Return the lower bound a span set.
Definition: spanset.c:561
int spanset_mem_size(const SpanSet *ss)
Return the size in bytes of a span set.
Definition: spanset.c:533
Span * spanbase_extent_transfn(Span *state, Datum value, meosType basetype)
Transition function for span extent aggregate of values.
Definition: span_aggfuncs.c:58
Set * value_union_transfn(Set *state, Datum value, meosType basetype)
Transition function for set union aggregate of values.
Definition: set_aggfuncs_meos.c:206
Set * set_make(const Datum *values, int count, meosType basetype, bool order)
Return a set from an array of values.
Definition: set.c:471
Span * span_make(Datum lower, Datum upper, bool lower_inc, bool upper_inc, meosType basetype)
Return a span from the bounds.
Definition: span.c:421
void span_set(Datum lower, Datum upper, bool lower_inc, bool upper_inc, meosType basetype, meosType spantype, Span *s)
Return in the last argument a span constructed from the given arguments.
Definition: span.c:442
SpanSet * spanset_make_exp(Span *spans, int count, int maxcount, bool normalize, bool order)
Return a span set from an array of disjoint spans enabling the data structure to expand.
Definition: spanset.c:269
Set * set_make_free(Datum *values, int count, meosType basetype, bool order)
Return a set from the array of values and free the input array after the creation.
Definition: set.c:488
Set * set_make_exp(const Datum *values, int count, int maxcount, meosType basetype, bool order)
Return a set from an array of values enabling the data structure to expand.
Definition: set.c:325
SpanSet * spanset_make_free(Span *spans, int count, bool normalize, bool order)
Return a span set from an array of spans and free the input array of spans after the creation.
Definition: spanset.c:353
Set * value_set(Datum d, meosType basetype)
Convert a value into a set.
Definition: set.c:527
SpanSet * set_spanset(const Set *s)
Convert a set into a span set.
Definition: spanset.c:405
void set_set_span(const Set *s, Span *result)
Return in the last argument the bounding span of a set.
Definition: span.c:563
SpanSet * value_spanset(Datum d, meosType basetype)
Convert a value into a span set.
Definition: spanset.c:389
void intspan_set_floatspan(const Span *s1, Span *s2)
Return the second span initialized with the first one transformed to a float span.
Definition: span.c:610
void value_set_span(Datum value, meosType basetype, Span *s)
Return in the last argument a span constructed from a value.
Definition: span.c:516
void floatspan_set_intspan(const Span *s1, Span *s2)
Return the second span initialized with the first one transformed to an integer span.
Definition: span.c:642
void tstzspan_set_datespan(const Span *s1, Span *s2)
Return the last span initialized with the first one transformed to a date span.
Definition: span.c:708
void datespan_set_tstzspan(const Span *s1, Span *s2)
Return the second span initialized with the first one transformed to a timetstamptz span.
Definition: span.c:673
void set_set_subspan(const Set *s, int minidx, int maxidx, Span *result)
Return in the last argument the bounding span of a set.
Definition: span.c:547
Span * set_span(const Set *s)
Convert a set into a span.
Definition: span.c:576
Span * value_span(Datum d, meosType basetype)
Convert a value into a span.
Definition: span.c:531
Datum distance_spanset_value(const SpanSet *ss, Datum value)
Return the distance between a span set and a value.
Definition: spanset_ops.c:1300
Datum distance_spanset_span(const SpanSet *ss, const Span *s)
Return the distance between a span set and a span.
Definition: spanset_ops.c:1315
Datum distance_set_value(const Set *s, Datum value)
Return the distance between a set and a value.
Definition: set_ops.c:654
Datum distance_span_span(const Span *s1, const Span *s2)
Return the distance between two spans as a double.
Definition: span_ops.c:953
Datum distance_spanset_spanset(const SpanSet *ss1, const SpanSet *ss2)
Return the distance between two span sets.
Definition: spanset_ops.c:1331
Datum distance_span_value(const Span *s, Datum value)
Return the distance between a span and a value as a double.
Definition: span_ops.c:923
Datum distance_set_set(const Set *s1, const Set *s2)
Return the distance between two sets.
Definition: set_ops.c:670
Datum distance_value_value(Datum l, Datum r, meosType basetype)
Return the distance between two values.
Definition: span_ops.c:890
char * set_out(const Set *s, int maxdd)
Return the Well-Known Text (WKT) representation of a set.
Definition: set.c:213
char * spanset_out(const SpanSet *ss, int maxdd)
Return the Well-Known Text (WKT) representation of a span set.
Definition: spanset.c:227
SpanSet * spanset_in(const char *str, meosType spantype)
Return a span set from its Well-Known Text (WKT) representation.
Definition: spanset.c:213
Set * set_in(const char *str, meosType basetype)
Return a set from its Well-Known Text (WKT) representation.
Definition: set.c:163
char * span_out(const Span *s, int maxdd)
Return the Well-Known Text (WKT) representation of a span.
Definition: span.c:391
Span * span_in(const char *str, meosType spantype)
Return a span from its Well-Known Text (WKT) representation.
Definition: span.c:355
bool right_value_span(Datum value, const Span *s)
Return true if a value is to the right of a span.
Definition: span_ops.c:362
bool overleft_span_value(const Span *s, Datum value)
Return true if a span does not extend to the right of a value.
Definition: span_ops.c:416
bool left_set_value(const Set *s, Datum value)
Return true if a set is to the left of a value.
Definition: set_ops.c:317
bool left_value_set(Datum value, const Set *s)
Return true if a value is to the left of a set.
Definition: set_ops.c:304
bool lfnadj_span_span(const Span *s1, const Span *s2)
Return true if the first span is to the left and not adjacent to the second one.
Definition: span_ops.c:344
bool right_value_spanset(Datum value, const SpanSet *ss)
Return true if a value is to the right of a span set.
Definition: spanset_ops.c:525
bool overleft_value_span(Datum value, const Span *s)
Return true if a value does not extend to the right of a span.
Definition: span_ops.c:402
bool overleft_set_value(const Set *s, Datum value)
Return true if a set does not extend to the right of a value.
Definition: set_ops.c:403
bool overleft_value_set(Datum value, const Set *s)
Return true if a value does not extend to the right of a set.
Definition: set_ops.c:390
bool left_spanset_value(const SpanSet *ss, Datum value)
Return true if a span set is to the left of a value.
Definition: spanset_ops.c:477
bool overright_span_value(const Span *s, Datum value)
Return true if a span does not extend to the left of a value.
Definition: span_ops.c:469
bool overleft_value_spanset(Datum value, const SpanSet *ss)
Return true if a value does not extend to the right of a span set.
Definition: spanset_ops.c:604
bool left_value_spanset(Datum value, const SpanSet *ss)
Return true if a value is to the left of a span set.
Definition: spanset_ops.c:449
bool overright_spanset_value(const SpanSet *ss, Datum value)
Return true if a span set does not extend to the left of a value.
Definition: spanset_ops.c:699
bool left_span_value(const Span *s, Datum value)
Return true if a span is to the left of a value.
Definition: span_ops.c:312
bool overright_set_value(const Set *s, Datum value)
Return true if a set does not extend to the left of a value.
Definition: set_ops.c:450
bool overright_value_spanset(Datum value, const SpanSet *ss)
Return true if a value does not extend to the left of a span set.
Definition: spanset_ops.c:670
bool left_value_span(Datum value, const Span *s)
Return true if a value is to the left of a span.
Definition: span_ops.c:298
bool right_span_value(const Span *s, Datum value)
Return true if a span is to the right of a value.
Definition: span_ops.c:374
bool overright_value_span(Datum value, const Span *s)
Return true if a value does not extend to the left of a span.
Definition: span_ops.c:455
bool right_set_value(const Set *s, Datum value)
Return true if a set is to the right of a value.
Definition: set_ops.c:362
bool overleft_spanset_value(const SpanSet *ss, Datum value)
Return true if a span set does not extend to the right of a value.
Definition: spanset_ops.c:591
bool right_spanset_value(const SpanSet *ss, Datum value)
Return true if a span set is to the right of a value.
Definition: spanset_ops.c:550
bool right_value_set(Datum value, const Set *s)
Return true if a value is to the right of a set.
Definition: set_ops.c:350
bool overright_value_set(Datum value, const Set *s)
Return true if a value does not extend to the the left of a set.
Definition: set_ops.c:437
Set * minus_value_set(Datum value, const Set *s)
Return the difference of a value and a set.
Definition: set_ops.c:595
SpanSet * minus_value_span(Datum value, const Span *s)
Return the difference of a value and a span.
Definition: span_ops.c:684
int mi_span_span(const Span *s1, const Span *s2, Span *result)
Return in the last argument the difference of two spans.
Definition: span_ops.c:762
void bbox_union_span_span(const Span *s1, const Span *s2, Span *result)
Return in the last argument the bounding box union of two spans.
Definition: span_ops.c:506
SpanSet * union_value_span(Datum value, const Span *s)
Return the union of a value and a span.
Definition: span_ops.c:555
Span * intersection_span_value(const Span *s, Datum value)
Return the intersection of a span and a value.
Definition: span_ops.c:608
SpanSet * minus_value_spanset(Datum value, const SpanSet *ss)
Return the difference of a value and a span set.
Definition: spanset_ops.c:1096
Set * intersection_value_set(Datum value, const Set *s)
Return the union of a value and a set.
Definition: set_ops.c:563
Set * union_set_value(const Set *s, Datum value)
Return the union of a set and a value.
Definition: set_ops.c:483
SpanSet * intersection_spanset_value(const SpanSet *ss, Datum value)
Return the intersection of a span set and a value.
Definition: spanset_ops.c:954
SpanSet * intersection_value_spanset(Datum value, const SpanSet *ss)
Return the intersection of a value and a span set.
Definition: spanset_ops.c:969
SpanSet * union_spanset_value(const SpanSet *ss, Datum value)
Return the union of a span set and a value.
Definition: spanset_ops.c:748
SpanSet * union_value_spanset(Datum value, const SpanSet *ss)
Return the union of a value and a span set.
Definition: spanset_ops.c:763
Set * union_value_set(Datum value, const Set *s)
Return the union of a value and a set.
Definition: set_ops.c:517
bool inter_span_span(const Span *s1, const Span *s2, Span *result)
Return in the last argument the intersection of two spans.
Definition: span_ops.c:637
SpanSet * minus_span_value(const Span *s, Datum value)
Return the difference of a span and a value.
Definition: span_ops.c:744
SpanSet * union_span_value(const Span *s, Datum value)
Return the union of a span and a value.
Definition: span_ops.c:540
Set * intersection_set_value(const Set *s, Datum value)
Return the intersection of a set and a value.
Definition: set_ops.c:548
Span * intersection_value_span(Datum value, const Span *s)
Return the union of a value and a span.
Definition: span_ops.c:623
Set * minus_set_value(const Set *s, Datum value)
Return the difference of a set and a value.
Definition: set_ops.c:610
SpanSet * minus_spanset_value(const SpanSet *ss, Datum value)
Return the difference of a span set and a value.
Definition: spanset_ops.c:1178
Span * super_union_span_span(const Span *s1, const Span *s2)
Return the bounding union of two spans.
Definition: span_ops.c:524
bool adjacent_spanset_value(const SpanSet *ss, Datum value)
Return true if a span set and a value are adjacent.
Definition: spanset_ops.c:345
bool contains_spanset_value(const SpanSet *ss, Datum value)
Return true if a span set contains a value.
Definition: spanset_ops.c:59
bool contains_span_value(const Span *s, Datum value)
Return true if a span contains a value.
Definition: span_ops.c:120
bool adjacent_value_spanset(Datum value, const SpanSet *ss)
Return true if a span set and a value are adjacent.
Definition: spanset_ops.c:361
bool contained_value_set(Datum value, const Set *s)
Return true if a value is contained in a set.
Definition: set_ops.c:241
bool contains_set_value(const Set *s, Datum value)
Return true if a set contains a value.
Definition: set_ops.c:186
bool adjacent_span_value(const Span *s, Datum value)
Return true if a span and a value are adjacent.
Definition: span_ops.c:255
bool contained_value_span(Datum value, const Span *s)
Return true if a value is contained in a span.
Definition: span_ops.c:181
bool ovadj_span_span(const Span *s1, const Span *s2)
Return true if two spans overlap or are adjacent.
Definition: span_ops.c:231
bool contained_value_spanset(Datum value, const SpanSet *ss)
Return true if a value is contained in a span set.
Definition: spanset_ops.c:194
SpanSet * numspanset_shift_scale(const SpanSet *ss, Datum shift, Datum width, bool hasshift, bool haswidth)
Return a number set shifted and/or scaled by two intervals.
Definition: spanset.c:1190
void span_expand(const Span *s1, Span *s2)
Return the second span expanded with the first one.
Definition: span.c:940
SpanSet * spanset_compact(const SpanSet *ss)
Return a copy of a span set without any extra storage space.
Definition: spanset.c:1083
void floatspan_round_set(const Span *s, int maxdd, Span *result)
Return in the last argument a float span with the precision set to a number of decimal places.
Definition: span.c:803
Span * numspan_shift_scale(const Span *s, Datum shift, Datum width, bool hasshift, bool haswidth)
Return a number span shifted and/or scaled by two values.
Definition: span.c:1302
Set * numset_shift_scale(const Set *s, Datum shift, Datum width, bool hasshift, bool haswidth)
Return a number set shifted and/or scaled by two values.
Definition: set.c:922
Set * set_compact(const Set *s)
Return a copy of a set ordered, without duplicates, and without any additional free space.
Definition: set.c:758
Span * numspan_expand(const Span *s, Datum value)
Return a number span with its bounds expanded/decreased by a value.
Definition: span.c:967
TimestampTz tsequence_end_timestamptz(const TSequence *seq)
Return the end timestamptz of a temporal sequence.
Definition: tsequence.c:2161
Datum tsequence_min_val(const TSequence *seq)
Return (a pointer to) the minimum base value of a temporal sequence.
Definition: tsequence.c:1941
int tsequenceset_num_instants(const TSequenceSet *ss)
Return the number of distinct instants of a temporal sequence set.
Definition: tsequenceset.c:1026
Datum tinstant_value_p(const TInstant *inst)
Return (a pointer to) the base value of a temporal instant.
Definition: tinstant.c:69
const TInstant * tsequenceset_inst_n(const TSequenceSet *ss, int n)
Return a pointer to the n-th distinct instant of a temporal sequence set.
Definition: tsequenceset.c:1056
double tnumberseqset_twavg(const TSequenceSet *ss)
Return the time-weighted average of a temporal number.
Definition: tsequenceset.c:2079
const TInstant ** tinstant_insts(const TInstant *inst, int *count)
Return the singleton array of instants of a temporal instant.
Definition: tinstant.c:391
const TSequence ** tsequenceset_sequences_p(const TSequenceSet *ss)
Return an array of pointers to the sequences of a temporal sequence set.
Definition: tsequenceset.c:990
Datum * tinstant_values_p(const TInstant *inst, int *count)
Return the singleton (pointer to the) base value of a temporal instant.
Definition: tinstant.c:309
double tnumberseq_integral(const TSequence *seq)
Return the integral (area under the curve) of a temporal sequence number.
Definition: tsequence.c:2835
void tnumber_set_span(const Temporal *temp, Span *span)
Return in the last argument the value span of a temporal number.
Definition: temporal.c:1117
TSequence ** tsequence_segments(const TSequence *seq, int *count)
Return the array of segments of a temporal sequence.
Definition: tsequence.c:2102
void tsequence_set_tstzspan(const TSequence *seq, Span *s)
Return in the last argument the time span of a temporal sequence.
Definition: tsequence.c:2013
TSequence ** tsequenceset_segments(const TSequenceSet *ss, int *count)
Return the array of segments of a temporal sequence set.
Definition: tsequenceset.c:1007
const TInstant * tsequence_min_inst(const TSequence *seq)
Return a pointer to the instant with minimum base value of a temporal sequence.
Definition: tsequence.c:1914
TimestampTz tsequenceset_end_timestamptz(const TSequenceSet *ss)
Return the end timestamptz of a temporal sequence set.
Definition: tsequenceset.c:1136
SpanSet * tnumberinst_valuespans(const TInstant *inst)
Return the base values of a temporal instant number as a span set.
Definition: tinstant.c:325
void tinstant_set_tstzspan(const TInstant *inst, Span *s)
Return in the last argument the time span of a temporal instant.
Definition: tinstant.c:356
TimestampTz tsequence_start_timestamptz(const TSequence *seq)
Return the start timestamptz of a temporal sequence.
Definition: tsequence.c:2148
Datum * temporal_values(const Temporal *temp, int *count)
Return the array of copies of the distinct base values of a temporal value.
Definition: temporal.c:1879
int tsequenceset_num_timestamps(const TSequenceSet *ss)
Return the number of distinct timestamptz values of a temporal sequence set.
Definition: tsequenceset.c:1151
SpanSet * tnumberseq_valuespans(const TSequence *seq)
Return the base values of a temporal number sequence as a span set.
Definition: tsequence.c:1826
Datum temporal_max_value(const Temporal *temp)
Return a copy of the maximum base value of a temporal value.
Definition: temporal.c:2025
Interval * tsequence_duration(const TSequence *seq)
Return the duration of a temporal sequence.
Definition: tsequence.c:2000
Datum * temporal_values_p(const Temporal *temp, int *count)
Return the array of pointers to the base values of a temporal value.
Definition: temporal.c:1854
const TInstant * tsequence_max_inst(const TSequence *seq)
Return a pointer to the instant with minimum base value of a temporal sequence.
Definition: tsequence.c:1929
void temporal_set_tstzspan(const Temporal *temp, Span *s)
Return in the last argument the time span of a temporal value.
Definition: temporal.c:1074
double tnumberseqset_integral(const TSequenceSet *ss)
Return the integral (area under the curve) of a temporal number.
Definition: tsequenceset.c:2044
bool tsequence_value_at_timestamptz(const TSequence *seq, TimestampTz t, bool strict, Datum *result)
Return in the last argument a copy of the value of a temporal sequence at a timestamptz.
Definition: tsequence.c:2246
bool tsequenceset_value_n(const TSequenceSet *ss, int n, Datum *result)
Return in the last argument a copy of the n-th value of a temporal sequence set.
Definition: tsequenceset.c:878
Datum tinstant_value(const TInstant *inst)
Return a copy of the base value of a temporal instant.
Definition: tinstant.c:85
SpanSet * tnumberseqset_valuespans(const TSequenceSet *ss)
Return the base values of a temporal number sequence set as a number span set.
Definition: tsequenceset.c:713
const TInstant * temporal_end_inst(const Temporal *temp)
Return a pointer to the end instant of a temporal value.
Definition: temporal.c:2488
uint32 tinstant_hash(const TInstant *inst)
Return the 32-bit hash value of a temporal instant.
Definition: tinstant.c:597
TimestampTz * tsequence_timestamps(const TSequence *seq, int *count)
Return the array of timestamps of a temporal sequence.
Definition: tsequence.c:2193
const TInstant * temporal_inst_n(const Temporal *temp, int n)
Return a pointer to the n-th instant of a temporal value.
Definition: temporal.c:2534
void tsequenceset_set_tstzspan(const TSequenceSet *ss, Span *s)
Return in the last argument the time span of a temporal sequence set.
Definition: tsequenceset.c:976
SpanSet * tinstant_time(const TInstant *inst)
Return the time frame of a temporal instant as a span set.
Definition: tinstant.c:343
const TSequence ** temporal_sequences_p(const Temporal *temp, int *count)
Return an array of pointers to the sequences of a temporal sequence (set)
Definition: temporal.c:2298
double tnumberseq_twavg(const TSequence *seq)
Return the time-weighted average of a temporal sequence number.
Definition: tsequence.c:2910
Datum temporal_start_value(const Temporal *temp)
Return a copy of the start base value of a temporal value.
Definition: temporal.c:1951
bool tsequenceset_timestamptz_n(const TSequenceSet *ss, int n, TimestampTz *result)
Return in the last argument the n-th distinct timestamptz of a temporal sequence set.
Definition: tsequenceset.c:1182
Datum temporal_min_value(const Temporal *temp)
Return a copy of the minimum base value of a temporal value.
Definition: temporal.c:1997
const TSequence ** tsequence_seqs(const TSequence *seq, int *count)
Return a singleton array of pointers to the sequence of a temporal sequence.
Definition: tsequence.c:2029
const TInstant * tsequenceset_max_inst(const TSequenceSet *ss)
Return a pointer to the instant with maximum base value of a temporal sequence set.
Definition: tsequenceset.c:802
Datum tsequenceset_min_val(const TSequenceSet *ss)
Return (a pointer to) the minimum base value of a temporal sequence set.
Definition: tsequenceset.c:815
const TInstant * tsequenceset_min_inst(const TSequenceSet *ss)
Return a pointer to the instant with minimum base value of a temporal sequence set.
Definition: tsequenceset.c:787
Interval * tsequenceset_duration(const TSequenceSet *ss, bool boundspan)
Return the duration of a temporal sequence set.
Definition: tsequenceset.c:944
Datum tsequenceset_max_val(const TSequenceSet *ss)
Return (a pointer to) the maximum base value of a temporal sequence set.
Definition: tsequenceset.c:843
SpanSet * tsequenceset_time(const TSequenceSet *ss)
Return the time frame a temporal sequence set as a timestamptz span set.
Definition: tsequenceset.c:927
uint32 tsequence_hash(const TSequence *seq)
Return the 32-bit hash value of a temporal sequence.
Definition: tsequence.c:3007
Datum * tsequence_values_p(const TSequence *seq, int *count)
Return the array of (pointer to the) distinct values of a temporal sequence.
Definition: tsequence.c:1799
const TInstant ** temporal_instants_p(const Temporal *temp, int *count)
Return an array of pointers to the distinct instants of a temporal value.
Definition: temporal.c:2581
bool tsequenceset_value_at_timestamptz(const TSequenceSet *ss, TimestampTz t, bool strict, Datum *result)
Return in the last argument a copy of the value of a temporal sequence set at a timestamptz.
Definition: tsequenceset.c:1263
bool tinstant_value_at_timestamptz(const TInstant *inst, TimestampTz t, Datum *result)
Return in the last argument a copy of the the value of a temporal instant at a timestamptz.
Definition: tinstant.c:412
TimestampTz tsequenceset_start_timestamptz(const TSequenceSet *ss)
Return the start timestamptz of a temporal sequence set.
Definition: tsequenceset.c:1122
const TInstant ** tsequenceset_insts_p(const TSequenceSet *ss)
Return an array of pointers to the instants of a temporal sequence set.
Definition: tsequenceset.c:1101
const TInstant * temporal_start_inst(const Temporal *temp)
Return a pointer to the start instant of a temporal value.
Definition: temporal.c:2448
TimestampTz * tsequenceset_timestamps(const TSequenceSet *ss, int *count)
Return the array of distinct timestamps of a temporal sequence set.
Definition: tsequenceset.c:1233
const TInstant ** tsequence_insts_p(const TSequence *seq)
Return the array of pointers to distinct instants of a temporal sequence.
Definition: tsequence.c:2132
Datum * tsequenceset_values_p(const TSequenceSet *ss, int *count)
Return the array of (pointers to the) distinct values of a temporal sequence set.
Definition: tsequenceset.c:684
size_t temporal_mem_size(const Temporal *temp)
Return the size in bytes of a temporal value.
Definition: temporal.c:1780
void temporal_set_bbox(const Temporal *temp, void *box)
Return in the last argument the bounding box of a temporal value.
Definition: temporal.c:1827
Datum temporal_end_value(const Temporal *temp)
Return a copy of the end base value of a temporal value.
Definition: temporal.c:1972
bool temporal_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, Datum *result)
Return in the last argument a copy of the value of a temporal value at a timestamptz.
Definition: temporal_restrict.c:459
TimestampTz * tinstant_timestamps(const TInstant *inst, int *count)
Return the singleton array of timestamps of a temporal instant.
Definition: tinstant.c:373
bool temporal_value_n(const Temporal *temp, int n, Datum *result)
Return in the last argument a copy of the n-th value of a temporal value.
Definition: temporal.c:2057
SpanSet * tsequence_time(const TSequence *seq)
Return the time frame of a temporal sequence as a span set.
Definition: tsequence.c:1857
uint32 tsequenceset_hash(const TSequenceSet *ss)
Return the 32-bit hash value of a temporal sequence set.
Definition: tsequenceset.c:2180
Datum tsequence_max_val(const TSequence *seq)
Return (a pointer to) the maximum base value of a temporal sequence.
Definition: tsequence.c:1968
Temporal * temporal_app_tseq_transfn(Temporal *state, const TSequence *seq)
Transition function for append temporal sequence aggregate.
Definition: temporal_aggfuncs.c:1338
Temporal * temporal_app_tinst_transfn(Temporal *state, const TInstant *inst, interpType interp, double maxdist, const Interval *maxt)
Transition function for append temporal instant aggregate.
Definition: temporal_aggfuncs.c:1306
void skiplist_free(SkipList *list)
Delete the skiplist and free its allocated memory.
Definition: skiplist.c:219
void tsequenceset_set_bbox(const TSequenceSet *ss, void *box)
Return in the last argument the bounding box of a temporal sequence set.
Definition: temporal_boxops.c:282
void tinstant_set_bbox(const TInstant *inst, void *box)
Return in the last argument the bounding box of a temporal instant.
Definition: temporal_boxops.c:212
void tsequence_expand_bbox(TSequence *seq, const TInstant *inst)
Expand the bounding box of a temporal sequence with an additional instant.
Definition: temporal_boxops.c:442
void tnumberseq_set_tbox(const TSequence *seq, TBox *box)
Return int the last argument the temporal box of a temporal number sequence.
Definition: temporal_boxops.c:237
void tnumberseqset_set_tbox(const TSequenceSet *ss, TBox *box)
Return in the last argument the temporal box of a temporal number sequence.
Definition: temporal_boxops.c:267
void tnumberinst_set_tbox(const TInstant *inst, TBox *box)
Return in the last argument the temporal box of a temporal number instant.
Definition: temporal_boxops.c:188
void tsequence_set_bbox(const TSequence *seq, void *box)
Return in the last argument the bounding box of a temporal sequence.
Definition: temporal_boxops.c:251
void tnumber_set_tbox(const Temporal *temp, TBox *box)
Return in the last argument the temporal box of a temporal number.
Definition: temporal_boxops.c:297
void tsequenceset_expand_bbox(TSequenceSet *ss, const TSequence *seq)
Expand the bounding box of a temporal sequence set with an additional sequence.
Definition: temporal_boxops.c:468
int always_ne_base_temporal(Datum value, const Temporal *temp)
Return true if a temporal value is always different from a base value.
Definition: temporal_compops.c:414
int always_gt_base_temporal(Datum value, const Temporal *temp)
Return true if a temporal value is always greater than a base value.
Definition: temporal_compops.c:454
int ever_ge_base_temporal(Datum value, const Temporal *temp)
Return true if a temporal value is ever greater than or equal to a base value.
Definition: temporal_compops.c:304
int ever_le_base_temporal(Datum value, const Temporal *temp)
Return true if a temporal value is ever less than or equal to a base value.
Definition: temporal_compops.c:277
int ever_le_temporal_base(const Temporal *temp, Datum value)
Return true if a temporal value is ever less than or equal to a base value.
Definition: temporal_compops.c:195
int always_ge_base_temporal(Datum value, const Temporal *temp)
Return true if a temporal value is always greater than or equal to a base value.
Definition: temporal_compops.c:468
int always_ge_temporal_base(const Temporal *temp, Datum value)
Return true if a temporal value is always greater than or equal to a base value.
Definition: temporal_compops.c:386
int ever_ne_temporal_base(const Temporal *temp, Datum value)
Return true if a temporal value is ever different from a base value.
Definition: temporal_compops.c:168
int always_le_temporal_base(const Temporal *temp, Datum value)
Return true if a temporal value is always less than or equal to a base value.
Definition: temporal_compops.c:359
int always_gt_temporal_base(const Temporal *temp, Datum value)
Return true if a temporal value is always greater than a base value.
Definition: temporal_compops.c:372
int always_ne_temporal_base(const Temporal *temp, Datum value)
Return true if a temporal value is always different from a base value.
Definition: temporal_compops.c:332
int ever_ne_base_temporal(Datum value, const Temporal *temp)
Return true if a temporal value is ever different from a base value.
Definition: temporal_compops.c:250
int ever_lt_base_temporal(Datum value, const Temporal *temp)
Return true if a temporal value is ever less than a base value.
Definition: temporal_compops.c:263
int ever_gt_base_temporal(Datum value, const Temporal *temp)
Return true if a temporal value is ever greater than a base value.
Definition: temporal_compops.c:290
int ever_gt_temporal_base(const Temporal *temp, Datum value)
Return true if a temporal value is ever greater than a base value.
Definition: temporal_compops.c:208
int always_eq_base_temporal(Datum value, const Temporal *temp)
Return true if a temporal value is always equal to a base value.
Definition: temporal_compops.c:401
int ever_eq_temporal_base(const Temporal *temp, Datum value)
Return true if a temporal value is ever equal to a base value.
Definition: temporal_compops.c:155
int always_lt_temporal_base(const Temporal *temp, Datum value)
Return true if a temporal value is always less than a base value.
Definition: temporal_compops.c:345
int ever_eq_base_temporal(Datum value, const Temporal *temp)
Return true if a temporal value is ever equal to a base value.
Definition: temporal_compops.c:237
int ever_lt_temporal_base(const Temporal *temp, Datum value)
Return true if a temporal value is ever less than a base value.
Definition: temporal_compops.c:181
int always_lt_base_temporal(Datum value, const Temporal *temp)
Return true if a temporal value is always less than a base value.
Definition: temporal_compops.c:427
int always_le_base_temporal(Datum value, const Temporal *temp)
Return true if a temporal value is always less than or equal to a base value.
Definition: temporal_compops.c:441
int always_eq_temporal_base(const Temporal *temp, Datum value)
Return true if a temporal value is always equal to a base value.
Definition: temporal_compops.c:319
int ever_ge_temporal_base(const Temporal *temp, Datum value)
Return true if a temporal value is ever greater than or equal to a base value.
Definition: temporal_compops.c:222
bool tinstant_eq(const TInstant *inst1, const TInstant *inst2)
Return true if two temporal instants are equal.
Definition: tinstant.c:540
int tsequence_cmp(const TSequence *seq1, const TSequence *seq2)
Return -1, 0, or 1 depending on whether the first temporal sequence is less than, equal,...
Definition: tsequence.c:2965
int tsequenceset_cmp(const TSequenceSet *ss1, const TSequenceSet *ss2)
Return -1, 0, or 1 depending on whether the first temporal sequence set is less than,...
Definition: tsequenceset.c:2143
bool tsequenceset_eq(const TSequenceSet *ss1, const TSequenceSet *ss2)
Return true if two temporal sequence sets are equal.
Definition: tsequenceset.c:2110
bool tsequence_eq(const TSequence *seq1, const TSequence *seq2)
Return true if two temporal sequences are equal.
Definition: tsequence.c:2930
int tinstant_cmp(const TInstant *inst1, const TInstant *inst2)
Return -1, 0, or 1 depending on whether the first temporal instant is less than, equal,...
Definition: tinstant.c:564
TSequenceSet * tsequenceset_make_free(TSequence **sequences, int count, bool normalize)
Return a temporal sequence set from an array of temporal sequences and free the array and the sequenc...
Definition: tsequenceset.c:424
TSequenceSet * tsequenceset_make_exp(const TSequence **sequences, int count, int maxcount, bool normalize)
Return a temporal sequence set from an array of temporal sequences.
Definition: tsequenceset.c:313
TSequenceSet * tsequenceset_copy(const TSequenceSet *ss)
Return a copy of a temporal sequence set.
Definition: tsequenceset.c:608
TSequence * tsequence_from_base_tstzspan(Datum value, meosType temptype, const Span *s, interpType interp)
Return a temporal sequence from a base value and a timestamptz span.
Definition: tsequence.c:1311
TInstant * tinstant_copy(const TInstant *inst)
Return a copy of a temporal instant.
Definition: tinstant.c:288
TSequenceSet * tsequenceset_from_base_tstzspanset(Datum value, meosType temptype, const SpanSet *ss, interpType interp)
Return a temporal sequence set from a base value and a span set.
Definition: tsequenceset.c:659
TSequence * tsequence_from_base_tstzset(Datum value, meosType temptype, const Set *s)
Return a temporal discrete sequence from a base value and a timestamptz set.
Definition: tsequence.c:1289
TSequence * tsequence_copy(const TSequence *seq)
Return a copy of a temporal sequence.
Definition: tsequence.c:1268
Temporal * temporal_from_base_temp(Datum value, meosType temptype, const Temporal *temp)
Return a temporal value from a base value and the time frame of another temporal value.
Definition: temporal.c:943
TSequence * tsequence_make_exp(const TInstant **instants, int count, int maxcount, bool lower_inc, bool upper_inc, interpType interp, bool normalize)
Return a temporal sequence from an array of temporal instants enabling the data structure to expand.
Definition: tsequence.c:1146
TInstant * tinstant_make(Datum value, meosType temptype, TimestampTz t)
Return a temporal instant from the arguments.
Definition: tinstant.c:203
TSequence * tsequence_make_free(TInstant **instants, int count, bool lower_inc, bool upper_inc, interpType interp, bool normalize)
Return a temporal sequence from an array of temporal instants and free the array and the instants aft...
Definition: tsequence.c:1218
Temporal * distance_tnumber_number(const Temporal *temp, Datum value)
Return the temporal distance between a temporal number and a number.
Definition: tnumber_distance.c:179
double nad_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2)
Return the nearest approach distance between two temporal numbers.
Definition: tnumber_distance.c:341
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:299
double nad_tbox_tbox(const TBox *box1, const TBox *box2)
Return the nearest approach distance between the temporal boxes.
Definition: tnumber_distance.c:270
double nad_tnumber_number(const Temporal *temp, Datum value)
Return the nearest approach distance between a temporal number and a number.
Definition: tnumber_distance.c:245
TSequence * tsequence_from_mfjson(json_object *mfjson, bool spatial, int32_t srid, meosType temptype, interpType interp)
Return a temporal sequence from its MF-JSON representation.
Definition: type_in.c:855
Temporal * temporal_in(const char *str, meosType temptype)
Return a temporal value from its Well-Known Text (WKT) representation.
Definition: temporal.c:805
TSequenceSet * tintseqset_from_mfjson(json_object *mfjson)
Return a temporal integer sequence set from its MF-JSON representation.
Definition: type_in_meos.c:176
TSequenceSet * tboolseqset_from_mfjson(json_object *mfjson)
Return a temporal boolean sequence set from its MF-JSON representation.
Definition: type_in_meos.c:163
TInstant * ttextinst_from_mfjson(json_object *mfjson)
Return a temporal text instant from its MF-JSON representation.
Definition: type_in_meos.c:97
TSequence * tfloatseq_in(const char *str, interpType interp)
Return a temporal float sequence from its Well-Known Text (WKT) representation.
Definition: tsequence_meos.c:99
char * tsequenceset_out(const TSequenceSet *ss, int maxdd)
Return the Well-Known Text (WKT) representation of a temporal sequence set.
Definition: tsequenceset.c:2028
TInstant * tintinst_in(const char *str)
Return a temporal integer instant from its Well-Known Text (WKT) representation.
Definition: tinstant_meos.c:78
TInstant * tintinst_from_mfjson(json_object *mfjson)
Return a temporal integer instant from its MF-JSON representation.
Definition: type_in_meos.c:73
TSequence * ttextseq_from_mfjson(json_object *mfjson)
Return a temporal text sequence from its MF-JSON representation.
Definition: type_in_meos.c:148
TSequenceSet * tfloatseqset_in(const char *str)
Return a temporal float sequence set from its Well-Known Text (WKT) representation.
Definition: tsequenceset_meos.c:164
TSequenceSet * tsequenceset_in(const char *str, meosType temptype, interpType interp)
Return a temporal sequence set from its Well-Known Text (WKT) representation.
Definition: tsequenceset.c:1983
TSequenceSet * tboolseqset_in(const char *str)
Return a temporal boolean sequence set from its Well-Known Text (WKT) representation.
Definition: tsequenceset_meos.c:138
TSequenceSet * ttextseqset_from_mfjson(json_object *mfjson)
Return a temporal text sequence set from its MF-JSON representation.
Definition: type_in_meos.c:201
TInstant * tinstant_from_mfjson(json_object *mfjson, bool spatial, int32_t srid, meosType temptype)
Return a temporal instant from its MF-JSON representation.
Definition: type_in.c:751
TSequence * tboolseq_in(const char *str, interpType interp)
Return a temporal boolean sequence from its Well-Known Text (WKT) representation.
Definition: tsequence_meos.c:73
TSequenceSet * tintseqset_in(const char *str)
Return a temporal integer sequence set from its Well-Known Text (WKT) representation.
Definition: tsequenceset_meos.c:151
TSequence * tfloatseq_from_mfjson(json_object *mfjson, interpType interp)
Return a temporal float sequence from its MF-JSON representation.
Definition: type_in_meos.c:136
TSequence * tintseq_from_mfjson(json_object *mfjson)
Return a temporal integer sequence from its MF-JSON representation.
Definition: type_in_meos.c:123
char ** temparr_out(const Temporal **temparr, int count, int maxdd)
Return the Well-Known Text (WKT) representation of an array of temporal values.
Definition: temporal.c:849
Temporal * temporal_from_mfjson(const char *mfjson, meosType temptype)
Return a temporal object from its MF-JSON representation.
Definition: type_in.c:975
TInstant * tboolinst_from_mfjson(json_object *mfjson)
Return a temporal boolean instant from its MF-JSON representation.
Definition: type_in_meos.c:61
TSequence * ttextseq_in(const char *str, interpType interp)
Return a temporal text sequence from its Well-Known Text (WKT) representation.
Definition: tsequence_meos.c:112
TInstant * tfloatinst_from_mfjson(json_object *mfjson)
Return a temporal float instant from its MF-JSON representation.
Definition: type_in_meos.c:85
char * tsequence_out(const TSequence *seq, int maxdd)
Return the Well-Known Text (WKT) representation of a temporal sequence.
Definition: tsequence.c:835
char * tinstant_out(const TInstant *inst, int maxdd)
Return the Well-Known Text (WKT) representation of a temporal instant.
Definition: tinstant.c:175
TSequenceSet * tsequenceset_from_mfjson(json_object *mfjson, bool spatial, int32_t srid, meosType temptype, interpType interp)
Return a temporal sequence set from its MF-JSON representation.
Definition: type_in.c:903
TSequence * tsequence_in(const char *str, meosType temptype, interpType interp)
Return a temporal sequence from its Well-Known Text (WKT) representation.
Definition: tsequence.c:767
char * temporal_out(const Temporal *temp, int maxdd)
Return the Well-Known Text (WKT) representation of a temporal value.
Definition: temporal.c:819
TSequenceSet * ttextseqset_in(const char *str)
Return a temporal text sequence set from its Well-Known Text (WKT) representation.
Definition: tsequenceset_meos.c:180
TInstant * ttextinst_in(const char *str)
Return a temporal text instant from its Well-Known Text (WKT) representation.
Definition: tinstant_meos.c:102
TSequence * tboolseq_from_mfjson(json_object *mfjson)
Return a temporal boolean sequence from its MF-JSON representation.
Definition: type_in_meos.c:111
TInstant * tboolinst_in(const char *str)
Return a temporal boolean instant from its Well-Known Text (WKT) representation.
Definition: tinstant_meos.c:66
TInstant * tfloatinst_in(const char *str)
Return a temporal float instant from its Well-Known Text (WKT) representation.
Definition: tinstant_meos.c:90
TSequence * tintseq_in(const char *str, interpType interp)
Return a temporal integer sequence from its Well-Known Text (WKT) representation.
Definition: tsequence_meos.c:86
TSequenceSet * tfloatseqset_from_mfjson(json_object *mfjson, interpType interp)
Return a temporal float sequence set from its MF-JSON representation.
Definition: type_in_meos.c:189
TInstant * tinstant_in(const char *str, meosType temptype)
Return a temporal instant from its Well-Known Text (WKT) representation.
Definition: tinstant.c:137
TSequenceSet * tfloatseqset_derivative(const TSequenceSet *ss)
Return the derivative of a temporal float sequence set.
Definition: tnumber_mathfuncs.c:636
TSequenceSet * tnumberseqset_abs(const TSequenceSet *ss)
Return the absolute value of a temporal number sequence set.
Definition: tnumber_mathfuncs.c:322
TSequence * tnumberseq_angular_difference(const TSequence *seq)
Return the temporal angular difference of a temporal number sequence.
Definition: tnumber_mathfuncs.c:519
TSequence * tnumberseq_abs(const TSequence *seq)
Return the absolute value of a temporal number sequence.
Definition: tnumber_mathfuncs.c:308
TSequenceSet * tnumberseqset_delta_value(const TSequenceSet *ss)
Return the delta value of a temporal number sequence set.
Definition: tnumber_mathfuncs.c:418
TInstant * tnumberinst_abs(const TInstant *inst)
Return the absolute value of a temporal number instant.
Definition: tnumber_mathfuncs.c:222
TSequence * tfloatseq_derivative(const TSequence *seq)
Return the derivative of a temporal float sequence.
Definition: tnumber_mathfuncs.c:593
TSequence * tnumberseq_delta_value(const TSequence *seq)
Return the delta value of a temporal number sequence.
Definition: tnumber_mathfuncs.c:382
TSequence * tnumberseqset_angular_difference(const TSequenceSet *ss)
Return the angular difference of a temporal number sequence set.
Definition: tnumber_mathfuncs.c:540
Temporal * tsequence_merge_array(const TSequence **sequences, int count)
Merge an array of temporal sequences.
Definition: temporal_modif.c:424
Temporal * tsequence_merge(const TSequence *seq1, const TSequence *seq2)
Merge two temporal sequences.
Definition: temporal_modif.c:241
TSequenceSet * tsequenceset_append_tsequence(TSequenceSet *ss, const TSequence *seq, bool expand)
Append a sequence to a temporal sequence set.
Definition: temporal_modif.c:2098
TSequenceSet * tsequenceset_merge(const TSequenceSet *ss1, const TSequenceSet *ss2)
Merge two temporal sequence sets.
Definition: temporal_modif.c:458
TSequenceSet * tsequenceset_delete_tstzspan(const TSequenceSet *ss, const Span *s)
Delete a timestamptz span from a temporal sequence set.
Definition: temporal_modif.c:1410
TSequenceSet * tsequenceset_merge_array(const TSequenceSet **seqsets, int count)
Merge an array of temporal sequence sets.
Definition: temporal_modif.c:475
Temporal * tsequence_delete_tstzspanset(const TSequence *seq, const SpanSet *ss, bool connect)
Delete a timestamptz span set from a temporal value.
Definition: temporal_modif.c:1135
TSequenceSet * tsequenceset_delete_tstzspanset(const TSequenceSet *ss, const SpanSet *ps)
Delete a timestamptz span from a temporal sequence set.
Definition: temporal_modif.c:1427
Temporal * tsequence_append_tsequence(const TSequence *seq1, const TSequence *seq2, bool expand)
Append a sequence to a temporal sequence.
Definition: temporal_modif.c:1912
Temporal * tinstant_merge_array(const TInstant **instants, int count)
Merge an array of temporal instants.
Definition: temporal_modif.c:202
Temporal * tsequence_delete_timestamptz(const TSequence *seq, TimestampTz t, bool connect)
Delete a timestamptz from a temporal value.
Definition: temporal_modif.c:885
TSequenceSet * tsequenceset_delete_timestamptz(const TSequenceSet *ss, TimestampTz t)
Delete a timestamptz from a temporal sequence set.
Definition: temporal_modif.c:1326
Temporal * tsequence_delete_tstzset(const TSequence *seq, const Set *s, bool connect)
Delete a timestamptz set from a temporal value.
Definition: temporal_modif.c:993
Temporal * tinstant_merge(const TInstant *inst1, const TInstant *inst2)
Merge two temporal instants.
Definition: temporal_modif.c:76
Temporal * tsequence_delete_tstzspan(const TSequence *seq, const Span *s, bool connect)
Delete a timestamptz span from a temporal sequence.
Definition: temporal_modif.c:1060
Temporal * tsequence_insert(const TSequence *seq1, const TSequence *seq2, bool connect)
Insert the second temporal value into the first one.
Definition: temporal_modif.c:812
TSequenceSet * tsequenceset_append_tinstant(TSequenceSet *ss, const TInstant *inst, double maxdist, const Interval *maxt, bool expand)
Append an instant to a temporal sequence set.
Definition: temporal_modif.c:1997
TSequenceSet * tsequenceset_delete_tstzset(const TSequenceSet *ss, const Set *s)
Delete a timestamptz span from a temporal sequence set.
Definition: temporal_modif.c:1365
Temporal * tsequence_append_tinstant(TSequence *seq, const TInstant *inst, double maxdist, const Interval *maxt, bool expand)
Append an instant to a temporal sequence accounting for potential gaps.
Definition: temporal_modif.c:1727
TSequenceSet * tsequenceset_insert(const TSequenceSet *ss1, const TSequenceSet *ss2)
Insert the second temporal value into the first one.
Definition: temporal_modif.c:1155
TInstant * tinstant_restrict_tstzset(const TInstant *inst, const Set *s, bool atfunc)
Restrict a temporal instant to (the complement of) a timestamptz set.
Definition: temporal_restrict.c:833
TSequenceSet * tsequenceset_restrict_value(const TSequenceSet *ss, Datum value, bool atfunc)
Restrict a temporal sequence set to (the complement of) a base value.
Definition: temporal_restrict.c:2855
TInstant * tnumberinst_restrict_span(const TInstant *inst, const Span *span, bool atfunc)
Restrict a temporal number instant to (the complement of) a span of base values.
Definition: temporal_restrict.c:744
Temporal * tsequenceset_restrict_timestamptz(const TSequenceSet *ss, TimestampTz t, bool atfunc)
Restrict a temporal sequence set to (the complement of) a timestamptz.
Definition: temporal_restrict.c:3019
Temporal * temporal_restrict_tstzspan(const Temporal *temp, const Span *s, bool atfunc)
Restrict a temporal value to (the complement of) a timestamptz span.
Definition: temporal_restrict.c:525
Temporal * temporal_restrict_tstzset(const Temporal *temp, const Set *s, bool atfunc)
Restrict a temporal value to (the complement of) a timestamp set.
Definition: temporal_restrict.c:489
TSequenceSet * tsequenceset_restrict_tstzspan(const TSequenceSet *ss, const Span *s, bool atfunc)
Restrict a temporal sequence set to (the complement of) a timestamptz span.
Definition: temporal_restrict.c:3163
TSequenceSet * tnumberseqset_restrict_spanset(const TSequenceSet *ss, const SpanSet *spanset, bool atfunc)
Restrict a temporal number to (the complement of) an array of spans of base values.
Definition: temporal_restrict.c:2969
Temporal * temporal_restrict_value(const Temporal *temp, Datum value, bool atfunc)
Restrict a temporal value to (the complement of) a base value.
Definition: temporal_restrict.c:152
TSequenceSet * tnumberseqset_restrict_span(const TSequenceSet *ss, const Span *span, bool atfunc)
Restrict a temporal number to a span of base values.
Definition: temporal_restrict.c:2937
Temporal * tnumber_restrict_span(const Temporal *temp, const Span *span, bool atfunc)
Restrict a temporal value to (the complement of) a span of base values.
Definition: temporal_restrict.c:294
TInstant * tinstant_restrict_value(const TInstant *inst, Datum value, bool atfunc)
Restrict a temporal instant to (the complement of) a base value.
Definition: temporal_restrict.c:664
TInstant * tnumberinst_restrict_spanset(const TInstant *inst, const SpanSet *ss, bool atfunc)
Restrict a temporal number instant to (the complement of) a span set.
Definition: temporal_restrict.c:780
Temporal * temporal_restrict_values(const Temporal *temp, const Set *set, bool atfunc)
Restrict a temporal value to (the complement of) a set of base values.
Definition: temporal_restrict.c:242
TInstant * tinstant_restrict_tstzspanset(const TInstant *inst, const SpanSet *ss, bool atfunc)
Restrict a temporal instant to (the complement of) a span set.
Definition: temporal_restrict.c:884
TSequenceSet * tsequenceset_restrict_values(const TSequenceSet *ss, const Set *s, bool atfunc)
Restrict a temporal sequence set to (the complement of) an array of base values.
Definition: temporal_restrict.c:2886
Temporal * temporal_restrict_minmax(const Temporal *temp, bool min, bool atfunc)
Restrict a temporal value to (the complement of) a minimum base value.
Definition: temporal_restrict.c:390
TInstant * tinstant_restrict_timestamptz(const TInstant *inst, TimestampTz t, bool atfunc)
Restrict a temporal instant to (the complement of) a timestamptz.
Definition: temporal_restrict.c:800
Temporal * temporal_restrict_tstzspanset(const Temporal *temp, const SpanSet *ss, bool atfunc)
Restrict a temporal value to (the complement of) a span set.
Definition: temporal_restrict.c:552
TSequenceSet * tsequenceset_restrict_tstzspanset(const TSequenceSet *ss, const SpanSet *ps, bool atfunc)
Restrict a temporal sequence set to (the complement of) a timestamptz span set.
Definition: temporal_restrict.c:3252
TInstant * tinstant_restrict_values(const TInstant *inst, const Set *set, bool atfunc)
Restrict a temporal instant to a set of base values.
Definition: temporal_restrict.c:708
TInstant * tsequence_at_timestamptz(const TSequence *seq, TimestampTz t)
Restrict a temporal sequence to a timestamptz.
Definition: temporal_restrict.c:2216
TSequenceSet * tcontseq_restrict_minmax(const TSequence *seq, bool min, bool atfunc)
Restrict a temporal continuous sequence to (the complement of) its minimum/maximum base value.
Definition: temporal_restrict.c:1901
TSequence * tdiscseq_restrict_minmax(const TSequence *seq, bool min, bool atfunc)
Restrict a temporal discrete sequence to (the complement of) its minimum/maximum base value.
Definition: temporal_restrict.c:1882
Temporal * tsequence_restrict_tstzspan(const TSequence *seq, const Span *s, bool atfunc)
Restrict a temporal value to (the complement of) a timestamptz span.
Definition: temporal_restrict.c:2683
Temporal * tsequence_restrict_tstzspanset(const TSequence *seq, const SpanSet *ss, bool atfunc)
Restrict a temporal sequence to (the complement of) a timestamptz span set.
Definition: temporal_restrict.c:2832
TSequenceSet * tsequenceset_restrict_minmax(const TSequenceSet *ss, bool min, bool atfunc)
Restrict a temporal sequence set to (the complement of) its minimum/maximum base value.
Definition: temporal_restrict.c:3003
Temporal * tnumber_restrict_spanset(const Temporal *temp, const SpanSet *ss, bool atfunc)
Restrict a temporal value to (the complement of) a span set.
Definition: temporal_restrict.c:339
Temporal * tsequenceset_restrict_tstzset(const TSequenceSet *ss, const Set *s, bool atfunc)
Restrict a temporal sequence set to (the complement of) a timestamptz set.
Definition: temporal_restrict.c:3078
Temporal * temporal_restrict_timestamptz(const Temporal *temp, TimestampTz t, bool atfunc)
Restrict a temporal value to a timestamp.
Definition: temporal_restrict.c:419
bool temporal_bbox_restrict_set(const Temporal *temp, const Set *set)
Return true if the bounding boxes of a temporal value and a set overlap.
Definition: temporal_restrict.c:212
TInstant * tinstant_restrict_tstzspan(const TInstant *inst, const Span *period, bool atfunc)
Restrict a temporal instant to (the complement of) a timestamptz span.
Definition: temporal_restrict.c:850
TSequenceSet * tsequenceset_shift_scale_time(const TSequenceSet *ss, const Interval *start, const Interval *duration)
Return a temporal sequence set shifted and/or scaled by two intervals.
Definition: tsequenceset.c:1711
TSequenceSet * tsequenceset_to_linear(const TSequenceSet *ss)
Return a temporal sequence set with continuous base type from step to linear interpolation.
Definition: tsequenceset.c:1616
TSequence * tsequence_shift_scale_time(const TSequence *seq, const Interval *shift, const Interval *duration)
Return a temporal sequence shifted and/or scaled by two intervals.
Definition: tsequence.c:1767
TSequence * temporal_tsequence(const Temporal *temp, interpType interp)
Return a temporal value transformed to a temporal sequence.
Definition: temporal.c:1513
Temporal * temporal_compact(const Temporal *temp)
Return a copy of a temporal value without any extra storage space.
Definition: temporal.c:1441
TSequenceSet * temporal_tsequenceset(const Temporal *temp, interpType interp)
Return a temporal value transformed to a temporal sequence set.
Definition: temporal.c:1579
TInstant * tsequence_to_tinstant(const TSequence *seq)
Return a temporal sequence transformed into a temporal instant.
Definition: tinstant.c:433
TSequence * tinstant_to_tsequence_free(TInstant *inst, interpType interp)
Return a temporal instant transformed into a temporal sequence.
Definition: tsequence.c:1461
TSequence * tsequenceset_to_discrete(const TSequenceSet *ss)
Return a temporal sequence set transformed into a temporal discrete sequence.
Definition: tsequenceset.c:1545
void temporal_restart(Temporal *temp, int count)
Return a temporal sequence (set) that keepsg only the last n instants or sequences.
Definition: temporal.c:1465
TSequence * tinstant_to_tsequence(const TInstant *inst, interpType interp)
Return a temporal instant transformed into a temporal sequence.
Definition: tsequence.c:1447
void tsequence_restart(TSequence *seq, int count)
Return a temporal sequence restarted by keeping only the last n instants.
Definition: tsequence.c:1381
Temporal * tsequence_set_interp(const TSequence *seq, interpType interp)
Return a temporal value transformed to the given interpolation.
Definition: tsequence.c:1637
TSequence * tsequence_subseq(const TSequence *seq, int from, int to, bool lower_inc, bool upper_inc)
Return a subsequence of a temporal sequence specified by two instants.
Definition: tsequence.c:1418
Temporal * tsequenceset_set_interp(const TSequenceSet *ss, interpType interp)
Return a temporal value transformed to the given interpolation.
Definition: tsequenceset.c:1645
TSequence * tnumberseq_shift_scale_value(const TSequence *seq, Datum shift, Datum width, bool hasshift, bool haswidth)
Return a temporal sequence whose value dimension is shifted and/or scaled by two values.
Definition: tsequence.c:1735
TSequenceSet * tinstant_to_tsequenceset(const TInstant *inst, interpType interp)
Return a temporal instant transformed into a temporal sequence set.
Definition: tsequenceset.c:1435
TSequenceSet * tsequence_to_tsequenceset_free(TSequence *seq)
Return a temporal sequence transformed into a temporal sequence set.
Definition: tsequenceset.c:1482
TSequenceSet * tsequenceset_to_step(const TSequenceSet *ss)
Return a temporal sequence set with continuous base type from linear to step interpolation.
Definition: tsequenceset.c:1571
Temporal * tnumber_shift_scale_value(const Temporal *temp, Datum shift, Datum width, bool hasshift, bool haswidth)
Return a temporal number with the value dimension shifted and/or scaled by two values.
Definition: temporal.c:1674
TSequence * tsequenceset_to_tsequence(const TSequenceSet *ss)
Return a temporal sequence set transformed into a temporal sequence value.
Definition: tsequenceset.c:1522
void tsequenceset_restart(TSequenceSet *ss, int count)
Return a temporal sequence set restared by keeping only the last n sequences.
Definition: tsequenceset.c:1393
TSequence * tsequence_compact(const TSequence *seq)
Return a copy of a temporal sequence without any extra storage space.
Definition: tsequence.c:1341
TInstant * tnumberinst_shift_value(const TInstant *inst, Datum shift)
Return a temporal instant whose value is shifted by a value.
Definition: tinstant.c:472
TInstant * tsequenceset_to_tinstant(const TSequenceSet *ss)
Return a temporal sequence set transformed into a temporal instant.
Definition: tinstant.c:452
TSequenceSet * tsequence_to_tsequenceset_interp(const TSequence *seq, interpType interp)
Return a temporal sequence transformed into a temporal sequence set.
Definition: tsequenceset.c:1498
TSequenceSet * tsequenceset_compact(const TSequenceSet *ss)
Return a copy of a temporal sequence set without any extra storage space.
Definition: tsequenceset.c:1320
TInstant * tinstant_shift_time(const TInstant *inst, const Interval *interv)
Return a temporal instant shifted by an interval.
Definition: tinstant.c:491
TSequenceSet * tsequence_to_tsequenceset(const TSequence *seq)
Return a temporal sequence transformed into a temporal sequence set.
Definition: tsequenceset.c:1462
TSequenceSet * tnumberseqset_shift_scale_value(const TSequenceSet *ss, Datum start, Datum width, bool hasshift, bool haswidth)
Return a temporal sequence set where the value dimension is shifted and/or scaled by two values.
Definition: tsequenceset.c:1672
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:55
set(CBUFFER_SRCS cbuffer.c tcbuffer.c tcbuffer_boxops.c tcbuffer_compops.c tcbuffer_distance.c tcbuffer_spatialfuncs.c tcbuffer_spatialrels.c tcbuffer_tempspatialrels.c) if(1) list(APPEND CBUFFER_SRCS cbufferset_meos.c) endif() add_library(cbuffer OBJECT $
Definition: CMakeLists.txt:1
interpType
Enumeration that defines the interpolation types used in MEOS.
Definition: meos.h:161
External API of the Mobility Engine Open Source (MEOS) library.
#define SET_VAL_N(s, index)
Return the n-th value of a set.
Definition: meos_internal.h:616
#define TSEQUENCESET_SEQ_N(ss, index)
Return the n-th sequence of a temporal sequence set.
Definition: meos_internal.h:671
#define TSEQUENCESET_OFFSETS_PTR(ss)
Return a pointer to the offsets array of a temporal sequence set.
Definition: meos_internal.h:662
void tstzspanset_set_tbox(const SpanSet *ss, TBox *box)
#define SET_OFFSETS_PTR(s)
Return a pointer to the offsets array of a set.
Definition: meos_internal.h:609
Temporal ** tnumber_value_split(const Temporal *temp, Datum vsize, Datum vorigin, Datum **bins, int *count)
Split a temporal number into an array of fragments according to value bins.
Definition: temporal_tile_meos.c:1193
TSequence * tsequence_from_base_temp(Datum value, meosType temptype, const TSequence *seq)
Return a temporal sequence from a base value and the time frame of another temporal sequence.
Definition: temporal.c:897
Datum datum_ceil(Datum d)
Return a number rounded up to the nearest integer.
Definition: temporal.c:1302
Datum datum_float_round(Datum value, Datum size)
Return a float number rounded to a given number of decimal places.
Definition: temporal.c:1281
TBox * tbox_get_value_time_tile(Datum value, TimestampTz t, Datum vsize, const Interval *duration, Datum vorigin, TimestampTz torigin, meosType basetype, meosType spantype)
Return a tile in a multidimensional grid for temporal numbers.
Definition: temporal_tile.c:816
Datum datum_radians(Datum d)
Return a double converted from degrees to radians.
Definition: temporal.c:1386
Datum datum_floor(Datum d)
Return a number rounded down to the nearest integer.
Definition: temporal.c:1293
Span * spanset_bins(const SpanSet *ss, Datum size, Datum origin, int *count)
Return the bins from a span set.
Definition: temporal_tile.c:478
gsl_rng * gsl_get_aggregation_rng(void)
Get the random generator used by temporal aggregation.
Definition: meos.c:103
uint32 datum_hash(Datum d, meosType basetype)
Return the 32-bit hash of a value.
Definition: type_util.c:389
TInstant * tinstant_make_free(Datum value, meosType temptype, TimestampTz t)
Return a temporal instant created from the values and free the base value after the creation.
Definition: tinstant.c:275
Temporal ** tnumber_value_time_split(const Temporal *temp, Datum size, const Interval *duration, Datum vorigin, TimestampTz torigin, Datum **value_bins, TimestampTz **time_bins, int *count)
Return a temporal value split according to a base value and possibly a temporal grid.
Definition: temporal_tile_meos.c:1231
TSequenceSet * tsequenceset_from_base_temp(Datum value, meosType temptype, const TSequenceSet *ss)
Return a temporal sequence set from a base value and the time frame of another temporal sequence set.
Definition: temporal.c:916
#define TSEQUENCE_INST_N(seq, index)
Return the n-th instant of a temporal sequence.
Definition: meos_internal.h:654
#define SET_BBOX_PTR(s)
Return a pointer to the bounding box of a set (if any)
Definition: meos_internal.h:603
TSequenceSet * tseqsetarr_to_tseqset(TSequenceSet **seqsets, int count, int totalseqs)
Return an array of temporal sequences converted from an array of temporal sequence sets.
Definition: tsequenceset.c:629
#define SPANSET_SP_N(ss, index)
Return the n-th span of a span set.
Definition: meos_internal.h:628
gsl_rng * gsl_get_generation_rng(void)
Get the random generator used by the data generator.
Definition: meos.c:92
Span * span_bins(const Span *s, Datum size, Datum origin, int *count)
Return the bins from a span.
Definition: temporal_tile.c:429
Set * textcat_textset_text_int(const Set *s, const text *txt, bool invert)
Return the concatenation of a text set and a set (internal function)
Definition: set.c:899
Span * tnumber_value_bins(const Temporal *temp, Datum size, Datum origin, int *count)
Return the bins of a temporal number.
Definition: temporal_tile.c:582
void numspanset_set_tbox(const SpanSet *ss, TBox *box)
Datum datum_degrees(Datum d, Datum normalize)
Return a double converted from radians to degrees.
Definition: temporal.c:1376
TBox * tnumber_value_time_boxes(const Temporal *temp, Datum vsize, const Interval *duration, Datum vorigin, TimestampTz torigin, int *count)
Return the temporal boxes of a temporal number split with respect to a value and possibly a time grid...
Definition: temporal_tile.c:895
#define TSEQUENCE_OFFSETS_PTR(seq)
Return a pointer to the offsets array of a temporal sequence.
Definition: meos_internal.h:645
uint64 datum_hash_extended(Datum d, meosType basetype, uint64 seed)
Return the 64-bit hash of a value using a seed.
Definition: type_util.c:438
int64 TimestampTz
Definition: postgres_ext_defs.in.h:22
unsigned int uint32
Definition: postgres_ext_defs.in.h:16
uintptr_t Datum
Definition: postgres_ext_defs.in.h:7
unsigned long int uint64
Definition: postgres_ext_defs.in.h:17
Definition: postgres_ext_defs.in.h:27
Structure to represent sets of values.
Definition: meos.h:80
Structure to represent skiplists that keep the current state of an aggregation.
Definition: meos.h:272
Structure to represent span sets.
Definition: meos.h:108
Structure to represent spans (a.k.a.
Definition: meos.h:94
Structure to represent temporal boxes.
Definition: meos.h:124
Structure to represent temporal values of instant subtype.
Definition: meos.h:185
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
Definition: pgtz.h:42
Definition: postgres_ext_defs.in.h:34
#define connect(s, name, namelen)
Definition: win32_port.h:463