MobilityDB 1.3
Loading...
Searching...
No Matches
Functions
set.c File Reference

General functions for set values composed of an ordered list of distinct values. More...

#include "temporal/set.h"
#include <assert.h>
#include <float.h>
#include <limits.h>
#include <postgres.h>
#include <utils/timestamp.h>
#include <liblwgeom.h>
#include <meos.h>
#include <meos_internal.h>
#include <meos_internal_geo.h>
#include "temporal/span.h"
#include "temporal/ttext_funcs.h"
#include "temporal/type_parser.h"
#include "temporal/type_util.h"
#include "geo/tgeo_spatialfuncs.h"
#include "geo/tspatial_boxops.h"

Functions

Setdateset_to_tstzset (const Set *s)
 Convert a date set into a timestamptz set. More...
 
bool ensure_set_isof_type (const Set *s, meosType settype)
 Ensure that a set is of a given set type. More...
 
bool ensure_valid_set_set (const Set *s1, const Set *s2)
 Ensure that a temporal number and a temporal box have the same span type. More...
 
Setfloatset_ceil (const Set *s)
 Return a float set rounded up to the nearest integer @csqlfn Floatset_ceil() More...
 
Setfloatset_degrees (const Set *s, bool normalize)
 Convert a float set with the values into degrees. More...
 
Setfloatset_floor (const Set *s)
 Return a float set rounded down to the nearest integer @csqlfn Floatset_floor() More...
 
Setfloatset_func (const Set *s, Datum(*func)(Datum))
 Return a float set obtained by applying a function to each element. More...
 
Setfloatset_radians (const Set *s)
 Convert a float set with the values into radians. More...
 
Setfloatset_to_intset (const Set *s)
 Convert a float set into an integer set. More...
 
Setintset_to_floatset (const Set *s)
 Convert an integer set into a float set. More...
 
Setnumset_shift_scale (const Set *s, Datum shift, Datum width, bool hasshift, bool haswidth)
 Return a number set shifted and/or scaled by two values. More...
 
static bool set_basetype_quotes (meosType type)
 Return true if the base type value is output enclosed into quotes. More...
 
static size_t set_bbox_size (meosType settype)
 Return the size of a bounding box of a temporal type. More...
 
int set_cmp (const Set *s1, const Set *s2)
 Return -1, 0, or 1 depending on whether the first set is less than, equal, or greater than the second one. More...
 
Setset_compact (const Set *s)
 Return a copy of a set ordered, without duplicates, and without any additional free space. More...
 
Setset_copy (const Set *s)
 Return a copy of a set. More...
 
Datum set_end_value (const Set *s)
 Return a copy of the end value of a set. More...
 
bool set_eq (const Set *s1, const Set *s2)
 Return true if the two sets are equal. More...
 
bool set_find_value (const Set *s, Datum d, int *loc)
 Return the location of a value in a set using binary search. More...
 
bool set_ge (const Set *s1, const Set *s2)
 Return true if the first set is greater than or equal to the second one. More...
 
bool set_gt (const Set *s1, const Set *s2)
 Return true if the first set is greater than the second one. More...
 
uint32 set_hash (const Set *s)
 Return the 32-bit hash of a set. More...
 
uint64 set_hash_extended (const Set *s, uint64 seed)
 Return the 64-bit hash of a set using a seed. More...
 
Setset_in (const char *str, meosType settype)
 Return a set from its Well-Known Text (WKT) representation. More...
 
bool set_le (const Set *s1, const Set *s2)
 Return true if the first set is less than or equal to the second one. More...
 
bool set_lt (const Set *s1, const Set *s2)
 Return true if the first set is less than the second one. More...
 
Setset_make (const Datum *values, int count, meosType basetype, bool order)
 Return a set from an array of values. More...
 
Setset_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. More...
 
Setset_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. More...
 
int set_mem_size (const Set *s)
 Return the size in bytes of a set. More...
 
bool set_ne (const Set *s1, const Set *s2)
 Return true if the first set is not equal to the second one. More...
 
int set_num_values (const Set *s)
 Return the number of values of a set. More...
 
char * set_out (const Set *s, int maxdd)
 Return the Well-Known Text (WKT) representation of a set. More...
 
char * set_out_fn (const Set *s, int maxdd, outfunc value_out)
 Return the output representation of a set given by a function. More...
 
Setset_round (const Set *s, int maxdd)
 Return a set with the precision of the values set to a number of decimal places. More...
 
Datum set_start_value (const Set *s)
 Return a copy of the start value of a set. More...
 
SetUnnestStateset_unnest_state_make (const Set *set)
 Create the initial state that persists across multiple calls of the function. More...
 
void set_unnest_state_next (SetUnnestState *state)
 Increment the current state to the next unnest value. More...
 
Datumset_vals (const Set *s)
 Return the array of (pointers to the) values of a set. More...
 
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. More...
 
Datumset_values (const Set *s)
 Return the array of (copies of) values of a set. More...
 
Settextcat_textset_text_int (const Set *s, const text *txt, bool invert)
 Return the concatenation of a text set and a set (internal function) More...
 
Settextset_func (const Set *s, Datum(*func)(Datum))
 Return a float set obtained by applying a function to each element. More...
 
Settextset_initcap (const Set *s)
 Return a text set transformed to initcap. More...
 
Settextset_lower (const Set *s)
 Return a text set transformed to lowercase. More...
 
Settextset_upper (const Set *s)
 Return a text set transformed to uppercase. More...
 
Settstzset_shift_scale (const Set *s, const Interval *shift, const Interval *duration)
 Return a timestamptz set shifted and/or scaled by two intervals. More...
 
Settstzset_to_dateset (const Set *s)
 Convert a timestamptz set into a date set. More...
 
Setvalue_set (Datum value, meosType basetype)
 Convert a value into a set. More...
 

Detailed Description

General functions for set values composed of an ordered list of distinct values.