MobilityDB 1.1
Functions
span_ops.c File Reference
#include <assert.h>
#include <math.h>
#include <postgres.h>
#include <utils/timestamp.h>
#include <meos.h>
#include <meos_internal.h>
#include "general/type_util.h"
Include dependency graph for span_ops.c:

Functions

bool adjacent_bigintspan_bigint (const Span *s, int64 i)
 Return true if an integer span and an integer are adjacent. More...
 
bool adjacent_floatspan_float (const Span *s, double d)
 Return true if a float span and a float are adjacent. More...
 
bool adjacent_intspan_int (const Span *s, int i)
 Return true if an integer span and an integer are adjacent. More...
 
bool adjacent_period_timestamp (const Span *p, TimestampTz t)
 Return true if a float span and a float are adjacent. More...
 
bool adjacent_span_span (const Span *s1, const Span *s2)
 Return true if the spans are adjacent. More...
 
bool adjacent_span_value (const Span *s, Datum d, meosType basetype)
 Return true if a span and a value are adjacent. More...
 
bool after_period_timestamp (const Span *p, TimestampTz t)
 Return true if a timestamp is strictly after a period. More...
 
bool after_timestamp_period (TimestampTz t, const Span *p)
 Return true if a timestamp is strictly before a period. More...
 
Spanbbox_union_span_span (const Span *s1, const Span *s2)
 Return the union of the spans. More...
 
bool before_period_timestamp (const Span *p, TimestampTz t)
 Return true if a float is strictly to the left of a float span. More...
 
bool before_timestamp_period (TimestampTz t, const Span *p)
 Return true if a timestamp is strictly before a period. More...
 
bool contained_bigint_bigintspan (int64 i, const Span *s)
 Return true if an integer is contained by an integer span. More...
 
bool contained_float_floatspan (double d, const Span *s)
 Return true if a float is contained by a float span. More...
 
bool contained_int_intspan (int i, const Span *s)
 Return true if an integer is contained by an integer span. More...
 
bool contained_span_span (const Span *s1, const Span *s2)
 Return true if the first span is contained by the second one. More...
 
bool contained_timestamp_period (TimestampTz t, const Span *p)
 Return true if a timestamp is contained by a period. More...
 
bool contained_value_span (Datum d, meosType basetype, const Span *s)
 Return true if a value is contained by a span. More...
 
bool contains_bigintspan_bigint (const Span *s, int64 i)
 Return true if an integer span contains an integer. More...
 
bool contains_floatspan_float (const Span *s, double d)
 Return true if a float span contains a float. More...
 
bool contains_intspan_int (const Span *s, int i)
 Return true if an integer span contains an integer. More...
 
bool contains_period_timestamp (const Span *p, TimestampTz t)
 Return true if a period contains a timestamp. More...
 
bool contains_span_span (const Span *s1, const Span *s2)
 Return true if the first span contains the second one. More...
 
bool contains_span_value (const Span *s, Datum d, meosType basetype)
 Return true if a span contains a value. More...
 
double distance_bigintspan_bigint (const Span *s, int64 i)
 Return the distance between an integer span and an integer. More...
 
double distance_floatspan_float (const Span *s, double d)
 Return the distance between a float span and a float. More...
 
double distance_intspan_int (const Span *s, int i)
 Return the distance between an integer span and an integer. More...
 
double distance_period_timestamp (const Span *p, TimestampTz t)
 Return the distance in seconds between a period and a timestamp. More...
 
double distance_span_span (const Span *s1, const Span *s2)
 Return the distance between two spans. More...
 
double distance_span_value (const Span *s, Datum d, meosType basetype)
 Return the distance between a span and a value. More...
 
double distance_value_value (Datum l, Datum r, meosType typel, meosType typer)
 Return the distance between the values. More...
 
bool inter_span_span (const Span *s1, const Span *s2, Span *result)
 Set a span with the result of the intersection of two spans. More...
 
bool intersection_bigintspan_bigint (const Span *s, int64 i, int64 *result)
 Return the intersection of a span and a value. More...
 
bool intersection_floatspan_float (const Span *s, double d, double *result)
 Return the intersection of a span and a value. More...
 
bool intersection_intspan_int (const Span *s, int i, int *result)
 Return the intersection of a span and a value. More...
 
bool intersection_period_timestamp (const Span *p, TimestampTz t, TimestampTz *result)
 Return the intersection of a period and a timestamp. More...
 
Spanintersection_span_span (const Span *s1, const Span *s2)
 Return the intersection of two spans. More...
 
bool intersection_span_value (const Span *s, Datum d, meosType basetype, Datum *result)
 Return the intersection of a span and a value. More...
 
bool left_bigint_bigintspan (int64 i, const Span *s)
 Return true if a big integer is strictly to the left of a big integer span. More...
 
bool left_bigintspan_bigint (const Span *s, int64 i)
 Return true if an integer span is strictly to the left of an integer. More...
 
bool left_float_floatspan (double d, const Span *s)
 Return true if a float is strictly to the left of a float span. More...
 
bool left_floatspan_float (const Span *s, double d)
 Return true if a float span is strictly to the left of a float. More...
 
bool left_int_intspan (int i, const Span *s)
 Return true if an integer is strictly to the left of an integer span. More...
 
bool left_intspan_int (const Span *s, int i)
 Return true if an integer span is strictly to the left of an integer. More...
 
bool left_span_span (const Span *s1, const Span *s2)
 Return true if the first span is strictly to the left of the second one. More...
 
bool left_span_value (const Span *s, Datum d, meosType basetype)
 Return true if a span is strictly to the left of a value. More...
 
bool left_value_span (Datum d, meosType basetype, const Span *s)
 Return true if a value is strictly to the left of a span. More...
 
bool minus_bigint_bigintspan (int64 i, const Span *s, int64 *result)
 Return the difference of a value and a span. More...
 
SpanSetminus_bigintspan_bigint (const Span *s, int64 i)
 Return the difference of a span and a value. More...
 
bool minus_float_floatspan (double d, const Span *s, double *result)
 Return the difference of a value and a span. More...
 
SpanSetminus_floatspan_float (const Span *s, double d)
 Return the difference of a span and a value. More...
 
bool minus_int_intspan (int i, const Span *s, int *result)
 Return the difference of a value and a span. More...
 
SpanSetminus_intspan_int (const Span *s, int i)
 Return the difference of a span and a value. More...
 
SpanSetminus_period_timestamp (const Span *p, TimestampTz t)
 Return the difference of a period and a timestamp. More...
 
SpanSetminus_span_span (const Span *s1, const Span *s2)
 Return the difference of two spans. More...
 
int minus_span_span1 (const Span *s1, const Span *s2, Span **result)
 Return the difference of the two spans. More...
 
SpanSetminus_span_value (const Span *s, Datum d, meosType basetype)
 Return the difference of a span and a value. More...
 
int minus_span_value1 (const Span *s, Datum d, meosType basetype, Span **result)
 Return the difference of a span and a value. More...
 
bool minus_timestamp_period (TimestampTz t, const Span *p, TimestampTz *result)
 Return the difference of a timestamp and a period. More...
 
bool minus_value_span (Datum d, meosType basetype, const Span *s, Datum *result)
 Return the difference of a value and a span. More...
 
bool overafter_period_timestamp (const Span *p, TimestampTz t)
 Return true if a period is not before a timestamp. More...
 
bool overafter_timestamp_period (TimestampTz t, const Span *p)
 Return true if a timestamp is not before a period. More...
 
bool overbefore_period_timestamp (const Span *p, TimestampTz t)
 Return true if a period is not after a timestamp. More...
 
bool overbefore_timestamp_period (TimestampTz t, const Span *p)
 Return true if a timestamp is not after a period. More...
 
bool overlaps_span_span (const Span *s1, const Span *s2)
 Return true if the spans overlap. More...
 
bool overleft_bigint_bigintspan (int64 i, const Span *s)
 Return true if an integer does not extend to the right of an integer span. More...
 
bool overleft_bigintspan_bigint (const Span *s, int64 i)
 Return true if an integer span does not extend to the right of an integer. More...
 
bool overleft_float_floatspan (double d, const Span *s)
 Return true if a float does not extend to the right of a float span. More...
 
bool overleft_floatspan_float (const Span *s, double d)
 Return true if a float span does not extend to the right of a float. More...
 
bool overleft_int_intspan (int i, const Span *s)
 Return true if an integer does not extend to the right of an integer span. More...
 
bool overleft_intspan_int (const Span *s, int i)
 Return true if an integer span does not extend to the right of an integer. More...
 
bool overleft_span_span (const Span *s1, const Span *s2)
 Return true if the first span does not extend to the right of the second one. More...
 
bool overleft_span_value (const Span *s, Datum d, meosType basetype)
 Return true if a span does not extend to the right of a value. More...
 
bool overleft_value_span (Datum d, meosType basetype, const Span *s)
 Return true if a value does not extend to the right of a span. More...
 
bool overright_bigint_bigintspan (int64 i, const Span *s)
 Return true if an integer does not extend to the left of an integer span. More...
 
bool overright_bigintspan_bigint (const Span *s, int64 i)
 
bool overright_float_floatspan (double d, const Span *s)
 Return true if a float does not extend to the left of a float span. More...
 
bool overright_floatspan_float (const Span *s, double d)
 Return true if a float span does not extend to the left of a float. More...
 
bool overright_int_intspan (int i, const Span *s)
 Return true if an integer does not extend to the left of an integer span. More...
 
bool overright_intspan_int (const Span *s, int i)
 Return true if an integer span does not extend to the left of an integer. More...
 
bool overright_span_span (const Span *s1, const Span *s2)
 Return true if the first span does not extend to the left of the second one. More...
 
bool overright_span_value (const Span *s, Datum d, meosType basetype)
 Return true if a span does not extend to the left of a value. More...
 
bool overright_value_span (Datum d, meosType basetype, const Span *s)
 Return true if a value does not extend to the left of a span. More...
 
bool right_bigint_bigintspan (int64 i, const Span *s)
 Return true if an integer is strictly to the right of an integer span. More...
 
bool right_bigintspan_bigint (const Span *s, int64 i)
 Return true if an integer span is strictly to the right of an integer. More...
 
bool right_float_floatspan (double d, const Span *s)
 Return true if a float is strictly to the right of a float span. More...
 
bool right_floatspan_float (const Span *s, double d)
 Return true if a float is strictly to the right of a float span. More...
 
bool right_int_intspan (int i, const Span *s)
 Return true if an integer is strictly to the right of an integer span. More...
 
bool right_intspan_int (const Span *s, int i)
 Return true if an integer span is strictly to the right of an integer. More...
 
bool right_span_span (const Span *s1, const Span *s2)
 Return true if the first span is strictly to right the of the second one. More...
 
bool right_span_value (const Span *s, Datum d, meosType basetype)
 Return true if a span is strictly to the right of a value. More...
 
bool right_value_span (Datum d, meosType basetype, const Span *s)
 Return true if a value is strictly to the right of a span. More...
 
Datum span_value_max (Datum l, Datum r, meosType type)
 Return the minimum value of two span base values. More...
 
Datum span_value_min (Datum l, Datum r, meosType type)
 Operators for span types. More...
 
bool union_bigintspan_bigint (const Span *s, int64 i)
 Return the union of a span and a value. More...
 
bool union_floatspan_float (const Span *s, double d)
 Return the union of a span and a value. More...
 
bool union_intspan_int (const Span *s, int i)
 Return the union of a span and a value. More...
 
SpanSetunion_period_timestamp (const Span *p, TimestampTz t)
 Return the union of a period and a timestamp. More...
 
SpanSetunion_span_span (const Span *s1, const Span *s2)
 Return the union of two spans. More...
 
SpanSetunion_span_value (const Span *s, Datum d, meosType basetype)
 Return the union of a span and a value. More...