]> granicus.if.org Git - postgresql/commitdiff
Remove the << >> &< and &> operators for contrib/cube, which were
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 27 Jun 2005 01:19:43 +0000 (01:19 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 27 Jun 2005 01:19:43 +0000 (01:19 +0000)
wrong, but nobody noticed because they were also useless.

contrib/cube/README.cube
contrib/cube/cube.c
contrib/cube/cube.sql.in
contrib/cube/expected/cube.out
contrib/cube/expected/cube_1.out
contrib/cube/expected/cube_2.out
contrib/cube/sql/cube.sql

index 3f130c476996051906b5ca51c291d9e50fde7152..9617009eb2cca8f551337a409a6fcf73d3a2d8c5 100644 (file)
@@ -181,7 +181,7 @@ numbers with more than about 16 significant digits will be truncated.
 USAGE
 =====
 
-The access method for CUBE is a GiST (gist_cube_ops), which is a
+The access method for CUBE is a GiST index (gist_cube_ops), which is a
 generalization of R-tree. GiSTs allow the postgres implementation of
 R-tree, originally encoded to support 2-D geometric types such as
 boxes and polygons, to be used with any data type whose data domain
@@ -193,42 +193,21 @@ things, all geometric data types, regardless of their dimensionality
 
 The operators supported by the GiST access method include:
 
+a = b          Same as
 
-[a, b] << [c, d]       Is left of
+       The cubements a and b are identical.
 
-       The left operand, [a, b], occurs entirely to the left of the
-       right operand, [c, d], on the axis (-inf, inf). It means,
-       [a, b] << [c, d] is true if b < c and false otherwise
+a && b         Overlaps
 
-[a, b] >> [c, d]       Is right of
+       The cubements a and b overlap.
 
-       [a, b] is occurs entirely to the right of [c, d]. 
-       [a, b] >> [c, d] is true if b > c and false otherwise
+a @ b          Contains
 
-[a, b] &< [c, d]       Over left
+       The cubement a contains the cubement b.
 
-       The cubement [a, b] overlaps the cubement [c, d] in such a way
-       that a <= c <= b and b <= d
+a ~ b          Contained in
 
-[a, b] &> [c, d]       Over right
-
-       The cubement [a, b] overlaps the cubement [c, d] in such a way
-       that a > c and b <= c <= d
-
-[a, b] = [c, d]                Same as
-
-       The cubements [a, b] and [c, d] are identical, that is, a == b
-       and c == d
-
-[a, b] @ [c, d]                Contains
-
-       The cubement [a, b] contains the cubement [c, d], that is, 
-       a <= c and b >= d
-
-[a, b] @ [c, d]                Contained in
-
-       The cubement [a, b] is contained in [c, d], that is, 
-       a >= c and b <= d
+       The cubement a is contained in b.
 
 Although the mnemonics of the following operators is questionable, I
 preserved them to maintain visual consistency with other geometric
index fd0609ee26b7588ed1b8bc1ef33dbcd6f7b3a5e9..cc6e1a39fe4c7e22ff4f909e5683d662460de580 100644 (file)
@@ -72,14 +72,6 @@ NDBOX           *cube_inter(NDBOX * a, NDBOX * b);
 double    *cube_size(NDBOX * a);
 void           rt_cube_size(NDBOX * a, double *sz);
 
-/*
-** These make no sense for this type, but R-tree wants them
-*/
-bool           cube_over_left(NDBOX * a, NDBOX * b);
-bool           cube_over_right(NDBOX * a, NDBOX * b);
-bool           cube_left(NDBOX * a, NDBOX * b);
-bool           cube_right(NDBOX * a, NDBOX * b);
-
 /*
 ** miscellaneous
 */
@@ -460,21 +452,9 @@ g_cube_leaf_consistent(NDBOX * key,
         */
        switch (strategy)
        {
-               case RTLeftStrategyNumber:
-                       retval = (bool) cube_left(key, query);
-                       break;
-               case RTOverLeftStrategyNumber:
-                       retval = (bool) cube_over_left(key, query);
-                       break;
                case RTOverlapStrategyNumber:
                        retval = (bool) cube_overlap(key, query);
                        break;
-               case RTOverRightStrategyNumber:
-                       retval = (bool) cube_over_right(key, query);
-                       break;
-               case RTRightStrategyNumber:
-                       retval = (bool) cube_right(key, query);
-                       break;
                case RTSameStrategyNumber:
                        retval = (bool) cube_eq(key, query);
                        break;
@@ -502,17 +482,9 @@ g_cube_internal_consistent(NDBOX * key,
         */
        switch (strategy)
        {
-               case RTLeftStrategyNumber:
-               case RTOverLeftStrategyNumber:
-                       retval = (bool) cube_over_left(key, query);
-                       break;
                case RTOverlapStrategyNumber:
                        retval = (bool) cube_overlap(key, query);
                        break;
-               case RTOverRightStrategyNumber:
-               case RTRightStrategyNumber:
-                       retval = (bool) cube_right(key, query);
-                       break;
                case RTSameStrategyNumber:
                case RTContainsStrategyNumber:
                        retval = (bool) cube_contains(key, query);
@@ -692,62 +664,6 @@ rt_cube_size(NDBOX * a, double *size)
        return;
 }
 
-/* The following four methods compare the projections of the boxes
-   onto the 0-th coordinate axis. These methods are useless for dimensions
-   larger than 2, but it seems that R-tree requires all its strategies
-   map to real functions that return something */
-
-/*     is the right edge of (a) located to the left of
-       the right edge of (b)? */
-bool
-cube_over_left(NDBOX * a, NDBOX * b)
-{
-       if ((a == NULL) || (b == NULL))
-               return (FALSE);
-
-       return (Min(a->x[a->dim - 1], a->x[2 * a->dim - 1]) <=
-                       Min(b->x[b->dim - 1], b->x[2 * b->dim - 1]) &&
-                       !cube_left(a, b) && !cube_right(a, b));
-}
-
-/*     is the left edge of (a) located to the right of
-       the left edge of (b)? */
-bool
-cube_over_right(NDBOX * a, NDBOX * b)
-{
-       if ((a == NULL) || (b == NULL))
-               return (FALSE);
-
-       return (Min(a->x[a->dim - 1], a->x[2 * a->dim - 1]) >=
-                       Min(b->x[b->dim - 1], b->x[2 * b->dim - 1]) &&
-                       !cube_left(a, b) && !cube_right(a, b));
-}
-
-
-/* return 'true' if the projection of 'a' is
-   entirely on the left of the projection of 'b' */
-bool
-cube_left(NDBOX * a, NDBOX * b)
-{
-       if ((a == NULL) || (b == NULL))
-               return (FALSE);
-
-       return (Min(a->x[a->dim - 1], a->x[2 * a->dim - 1]) <
-                       Min(b->x[0], b->x[b->dim]));
-}
-
-/* return 'true' if the projection of 'a' is
-   entirely on the right  of the projection of 'b' */
-bool
-cube_right(NDBOX * a, NDBOX * b)
-{
-       if ((a == NULL) || (b == NULL))
-               return (FALSE);
-
-       return (Min(a->x[0], a->x[a->dim]) >
-                       Min(b->x[b->dim - 1], b->x[2 * b->dim - 1]));
-}
-
 /* make up a metric in which one box will be 'lower' than the other
    -- this can be useful for sorting and to determine uniqueness */
 int32
index bd7137f8f78677ed6480e22524adc0f14eb79378..ff920d1f596cbb4a2b29d1e481a7d54fe5339c13 100644 (file)
@@ -12,12 +12,13 @@ LANGUAGE 'C' IMMUTABLE STRICT;
 CREATE OR REPLACE FUNCTION cube_out(cube)
 RETURNS cstring
 AS 'MODULE_PATHNAME'
-LANGUAGE 'c'IMMUTABLE STRICT;
+LANGUAGE 'C' IMMUTABLE STRICT;
 
 CREATE TYPE cube (
        INTERNALLENGTH = variable,
        INPUT = cube_in,
-       OUTPUT = cube_out
+       OUTPUT = cube_out,
+       ALIGNMENT = double
 );
 
 COMMENT ON TYPE cube IS 'multi-dimensional cube ''(FLOAT-1, FLOAT-2, ..., FLOAT-N), (FLOAT-1, FLOAT-2, ..., FLOAT-N)''';
@@ -36,38 +37,6 @@ CREATE CAST (text AS cube) WITH FUNCTION cube(text) AS ASSIGNMENT;
 -- External C-functions for R-tree methods
 --
 
--- Left/Right methods
-
-CREATE OR REPLACE FUNCTION cube_over_left(cube, cube)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE 'C' IMMUTABLE STRICT;
-
-COMMENT ON FUNCTION cube_over_left(cube, cube) IS 'is over and left of (NOT IMPLEMENTED)';
-
-CREATE OR REPLACE FUNCTION cube_over_right(cube, cube)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE 'C' IMMUTABLE STRICT;
-
-COMMENT ON FUNCTION cube_over_right(cube, cube) IS 'is over and right of (NOT IMPLEMENTED)';
-
-CREATE OR REPLACE FUNCTION cube_left(cube, cube)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE 'C' IMMUTABLE STRICT;
-
-COMMENT ON FUNCTION cube_left(cube, cube) IS
-'is left of (NOT IMPLEMENTED)';
-
-CREATE OR REPLACE FUNCTION cube_right(cube, cube)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE 'C' IMMUTABLE STRICT;
-
-COMMENT ON FUNCTION cube_right(cube, cube) IS 'is right of (NOT IMPLEMENTED)';
-
-
 -- Comparison methods
 
 CREATE OR REPLACE FUNCTION cube_eq(cube, cube)
@@ -242,34 +211,10 @@ CREATE OPERATOR >= (
        RESTRICT = scalargtsel, JOIN = scalargtjoinsel
 );
 
-CREATE OPERATOR << (
-       LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_left,
-       COMMUTATOR = '>>',
-       RESTRICT = positionsel, JOIN = positionjoinsel
-);
-
-CREATE OPERATOR &< (
-       LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_over_left,
-       COMMUTATOR = '&>',
-       RESTRICT = positionsel, JOIN = positionjoinsel
-);
-
 CREATE OPERATOR && (
        LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_overlap,
        COMMUTATOR = '&&',
-       RESTRICT = positionsel, JOIN = positionjoinsel
-);
-
-CREATE OPERATOR &> (
-       LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_over_right,
-       COMMUTATOR = '&<',
-       RESTRICT = positionsel, JOIN = positionjoinsel
-);
-
-CREATE OPERATOR >> (
-       LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_right,
-       COMMUTATOR = '<<',
-       RESTRICT = positionsel, JOIN = positionjoinsel
+       RESTRICT = areasel, JOIN = areajoinsel
 );
 
 CREATE OPERATOR = (
@@ -348,11 +293,7 @@ CREATE OPERATOR CLASS cube_ops
 
 CREATE OPERATOR CLASS gist_cube_ops
     DEFAULT FOR TYPE cube USING gist AS
-       OPERATOR        1       << ,
-       OPERATOR        2       &< ,
        OPERATOR        3       && ,
-       OPERATOR        4       &> ,
-       OPERATOR        5       >> ,
        OPERATOR        6       = ,
        OPERATOR        7       @ ,
        OPERATOR        8       ~ ,
index 367031e9835fefd09c2e4db355084861ebd51475..d1648c53cdbeeceee844204a964c67c2c8671b1c 100644 (file)
@@ -594,254 +594,6 @@ SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '[(2,1,1),(2,2,2)]'::cube AS bool;
  f
 (1 row)
 
--- "overlap on the left" / "overlap on the right"
--- (these operators are not useful at all but R-tree seems to be
--- sensitive to their presence)
---
-SELECT '1'::cube &< '0'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube &< '1'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '1'::cube &< '2'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube &< '0'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube &< '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(0),(0.5)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(0),(2)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(1),(2)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(2),(3)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '0'::cube &> '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube &> '1'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '2'::cube &> '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '0'::cube        &> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '1'::cube        &> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(0.5)'      &> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube  &> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(2)'::cube  &> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(1),(2)'::cube  &> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(2),(3)'::cube  &> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
--- "left" / "right"
--- (these operators are not useful but for 1-D or 2-D cubes, but R-tree
--- seems to want them defined)
---
-SELECT '1'::cube << '0'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube << '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube << '2'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube << '0'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube << '1'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube << '(0),(0.5)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube << '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube << '(0),(2)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube << '(1),(2)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube << '(2),(3)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '0'::cube >> '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube >> '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '2'::cube >> '1'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '0'::cube        >> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube        >> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(0.5)'      >> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube  >> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(2)'::cube  >> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(1),(2)'::cube  >> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(2),(3)'::cube  >> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
 -- "contained in" (the left operand is the cube entirely enclosed by
 -- the right operand):
 --
index f5ee88064cabef35f6dc03130df7ac4767dc821b..73a7c2f115a1f606474d868d7cc53e62db38c976 100644 (file)
@@ -594,254 +594,6 @@ SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '[(2,1,1),(2,2,2)]'::cube AS bool;
  f
 (1 row)
 
--- "overlap on the left" / "overlap on the right"
--- (these operators are not useful at all but R-tree seems to be
--- sensitive to their presence)
---
-SELECT '1'::cube &< '0'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube &< '1'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '1'::cube &< '2'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube &< '0'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube &< '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(0),(0.5)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(0),(2)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(1),(2)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(2),(3)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '0'::cube &> '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube &> '1'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '2'::cube &> '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '0'::cube        &> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '1'::cube        &> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(0.5)'      &> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube  &> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(2)'::cube  &> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(1),(2)'::cube  &> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(2),(3)'::cube  &> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
--- "left" / "right"
--- (these operators are not useful but for 1-D or 2-D cubes, but R-tree
--- seems to want them defined)
---
-SELECT '1'::cube << '0'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube << '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube << '2'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube << '0'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube << '1'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube << '(0),(0.5)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube << '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube << '(0),(2)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube << '(1),(2)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube << '(2),(3)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '0'::cube >> '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube >> '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '2'::cube >> '1'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '0'::cube        >> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube        >> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(0.5)'      >> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube  >> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(2)'::cube  >> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(1),(2)'::cube  >> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(2),(3)'::cube  >> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
 -- "contained in" (the left operand is the cube entirely enclosed by
 -- the right operand):
 --
index c226c0d11f2a9edffb33bdf7bbc25fefa12666ad..cea2f4ea94521d41d6eece4ec1903b46f2b400c4 100644 (file)
@@ -594,254 +594,6 @@ SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '[(2,1,1),(2,2,2)]'::cube AS bool;
  f
 (1 row)
 
--- "overlap on the left" / "overlap on the right"
--- (these operators are not useful at all but R-tree seems to be
--- sensitive to their presence)
---
-SELECT '1'::cube &< '0'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube &< '1'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '1'::cube &< '2'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube &< '0'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube &< '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(0),(0.5)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(0),(2)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(1),(2)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube &< '(2),(3)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '0'::cube &> '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube &> '1'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '2'::cube &> '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '0'::cube        &> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '1'::cube        &> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(0.5)'      &> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube  &> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(2)'::cube  &> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(1),(2)'::cube  &> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(2),(3)'::cube  &> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
--- "left" / "right"
--- (these operators are not useful but for 1-D or 2-D cubes, but R-tree
--- seems to want them defined)
---
-SELECT '1'::cube << '0'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube << '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube << '2'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube << '0'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube << '1'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube << '(0),(0.5)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube << '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube << '(0),(2)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube << '(1),(2)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(1)'::cube << '(2),(3)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '0'::cube >> '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube >> '1'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '2'::cube >> '1'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '0'::cube        >> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '1'::cube        >> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(0),(0.5)'      >> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(1)'::cube  >> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(0),(2)'::cube  >> '(0),(1)'::cube AS bool;
- bool 
-------
- f
-(1 row)
-
-SELECT '(1),(2)'::cube  >> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
-SELECT '(2),(3)'::cube  >> '(0),(1)'::cube AS bool;
- bool 
-------
- t
-(1 row)
-
 -- "contained in" (the left operand is the cube entirely enclosed by
 -- the right operand):
 --
index d386a5a2f32f4e43fe95feb3dec37b52de10177b..0b22fd768d7a97605ecb3f0a93e91e2e222d7915 100644 (file)
@@ -164,63 +164,6 @@ SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '[(1,1,1),(2,2,2)]'::cube AS bool;
 SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '[(1,1),(2,2)]'::cube AS bool;
 SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '[(2,1,1),(2,2,2)]'::cube AS bool;
 
--- "overlap on the left" / "overlap on the right"
--- (these operators are not useful at all but R-tree seems to be
--- sensitive to their presence)
---
-SELECT '1'::cube &< '0'::cube AS bool;
-SELECT '1'::cube &< '1'::cube AS bool;
-SELECT '1'::cube &< '2'::cube AS bool;
-
-SELECT '(0),(1)'::cube &< '0'::cube AS bool;
-SELECT '(0),(1)'::cube &< '1'::cube AS bool;
-SELECT '(0),(1)'::cube &< '(0),(0.5)'::cube AS bool;
-SELECT '(0),(1)'::cube &< '(0),(1)'::cube AS bool;
-SELECT '(0),(1)'::cube &< '(0),(2)'::cube AS bool;
-SELECT '(0),(1)'::cube &< '(1),(2)'::cube AS bool;
-SELECT '(0),(1)'::cube &< '(2),(3)'::cube AS bool;
-
-SELECT '0'::cube &> '1'::cube AS bool;
-SELECT '1'::cube &> '1'::cube AS bool;
-SELECT '2'::cube &> '1'::cube AS bool;
-
-SELECT '0'::cube        &> '(0),(1)'::cube AS bool;
-SELECT '1'::cube        &> '(0),(1)'::cube AS bool;
-SELECT '(0),(0.5)'      &> '(0),(1)'::cube AS bool;
-SELECT '(0),(1)'::cube  &> '(0),(1)'::cube AS bool;
-SELECT '(0),(2)'::cube  &> '(0),(1)'::cube AS bool;
-SELECT '(1),(2)'::cube  &> '(0),(1)'::cube AS bool;
-SELECT '(2),(3)'::cube  &> '(0),(1)'::cube AS bool;
-
-
--- "left" / "right"
--- (these operators are not useful but for 1-D or 2-D cubes, but R-tree
--- seems to want them defined)
---
-SELECT '1'::cube << '0'::cube AS bool;
-SELECT '1'::cube << '1'::cube AS bool;
-SELECT '1'::cube << '2'::cube AS bool;
-
-SELECT '(0),(1)'::cube << '0'::cube AS bool;
-SELECT '(0),(1)'::cube << '1'::cube AS bool;
-SELECT '(0),(1)'::cube << '(0),(0.5)'::cube AS bool;
-SELECT '(0),(1)'::cube << '(0),(1)'::cube AS bool;
-SELECT '(0),(1)'::cube << '(0),(2)'::cube AS bool;
-SELECT '(0),(1)'::cube << '(1),(2)'::cube AS bool;
-SELECT '(0),(1)'::cube << '(2),(3)'::cube AS bool;
-
-SELECT '0'::cube >> '1'::cube AS bool;
-SELECT '1'::cube >> '1'::cube AS bool;
-SELECT '2'::cube >> '1'::cube AS bool;
-
-SELECT '0'::cube        >> '(0),(1)'::cube AS bool;
-SELECT '1'::cube        >> '(0),(1)'::cube AS bool;
-SELECT '(0),(0.5)'      >> '(0),(1)'::cube AS bool;
-SELECT '(0),(1)'::cube  >> '(0),(1)'::cube AS bool;
-SELECT '(0),(2)'::cube  >> '(0),(1)'::cube AS bool;
-SELECT '(1),(2)'::cube  >> '(0),(1)'::cube AS bool;
-SELECT '(2),(3)'::cube  >> '(0),(1)'::cube AS bool;
-
 
 -- "contained in" (the left operand is the cube entirely enclosed by
 -- the right operand):