head	1.4;
access;
symbols
	REL9_0_0:1.4
	REL9_1_ALPHA1:1.4
	REL9_0_RC1:1.4
	REL9_0_BETA4:1.4
	REL9_0_STABLE:1.4.0.2
	REL9_0_BETA3:1.4
	REL9_0_BETA2:1.4
	REL7_4_29:1.2
	REL8_0_25:1.2
	REL8_1_21:1.2
	REL8_2_17:1.3
	REL8_3_11:1.3
	REL8_4_4:1.3
	REL9_0_BETA1:1.4
	REL9_0_ALPHA5_BRANCH:1.3.0.16
	REL9_0_ALPHA5:1.3
	REL7_4_28:1.2
	REL8_0_24:1.2
	REL8_1_20:1.2
	REL8_2_16:1.3
	REL8_3_10:1.3
	REL8_4_3:1.3
	REL9_0_ALPHA4:1.3
	REL9_0_ALPHA4_BRANCH:1.3.0.14
	REL8_5_ALPHA3:1.3
	REL8_5_ALPHA3_BRANCH:1.3.0.12
	REL7_4_27:1.2
	REL8_0_23:1.2
	REL8_1_19:1.2
	REL8_2_15:1.3
	REL8_3_9:1.3
	REL8_4_2:1.3
	REL8_5_ALPHA2:1.3
	REL8_5_ALPHA2_BRANCH:1.3.0.10
	REL7_4_26:1.2
	REL8_0_22:1.2
	REL8_1_18:1.2
	REL8_2_14:1.3
	REL8_3_8:1.3
	REL8_4_1:1.3
	REL8_5_ALPHA1:1.3
	REL8_5_ALPHA1_BRANCH:1.3.0.8
	REL8_4_STABLE:1.3.0.6
	REL8_4_0:1.3
	REL8_4_RC2:1.3
	REL8_4_RC1:1.3
	REL8_4_BETA2:1.3
	REL8_4_BETA1:1.3
	REL7_4_25:1.2
	REL8_0_21:1.2
	REL8_1_17:1.2
	REL8_2_13:1.3
	REL8_3_7:1.3
	REL7_4_24:1.2
	REL8_0_20:1.2
	REL8_1_16:1.2
	REL8_2_12:1.3
	REL8_3_6:1.3
	REL7_4_23:1.2
	REL8_0_19:1.2
	REL8_1_15:1.2
	REL8_2_11:1.3
	REL8_3_5:1.3
	REL7_4_22:1.2
	REL8_0_18:1.2
	REL8_1_14:1.2
	REL8_2_10:1.3
	REL8_3_4:1.3
	REL7_4_21:1.2
	REL8_0_17:1.2
	REL8_1_13:1.2
	REL8_2_9:1.3
	REL8_3_3:1.3
	REL7_4_20:1.2
	REL8_0_16:1.2
	REL8_1_12:1.2
	REL8_2_8:1.3
	REL8_3_2:1.3
	REL8_2_7:1.3
	REL8_3_1:1.3
	REL8_3_STABLE:1.3.0.4
	REL8_3_0:1.3
	REL8_3_RC2:1.3
	REL7_3_21:1.2
	REL7_4_19:1.2
	REL8_0_15:1.2
	REL8_1_11:1.2
	REL8_2_6:1.3
	REL8_3_RC1:1.3
	REL8_3_BETA4:1.3
	REL8_3_BETA3:1.3
	REL8_3_BETA2:1.3
	REL8_3_BETA1:1.3
	REL7_3_20:1.2
	REL7_4_18:1.2
	REL8_0_14:1.2
	REL8_1_10:1.2
	REL8_2_5:1.3
	REL7_3_19:1.2
	REL7_4_17:1.2
	REL8_0_13:1.2
	REL8_1_9:1.2
	REL8_2_4:1.3
	REL8_0_12:1.2
	REL8_1_8:1.2
	REL8_2_3:1.3
	REL7_3_18:1.2
	REL7_4_16:1.2
	REL8_0_11:1.2
	REL8_1_7:1.2
	REL8_2_2:1.3
	REL8_0_10:1.2
	REL8_1_6:1.2
	REL8_2_1:1.3
	REL7_4_15:1.2
	REL7_3_17:1.2
	REL8_2_STABLE:1.3.0.2
	REL8_2_0:1.3
	REL8_2_RC1:1.3
	REL8_2_BETA3:1.3
	REL8_2_BETA2:1.3
	REL8_1_5:1.2
	REL8_0_9:1.2
	REL7_4_14:1.2
	REL7_3_16:1.2
	REL8_2_BETA1:1.3
	REL7_3_15:1.2
	REL7_4_13:1.2
	REL8_0_8:1.2
	REL8_1_4:1.2
	REL7_3_14:1.2
	REL7_4_12:1.2
	REL8_0_7:1.2
	REL8_1_3:1.2
	REL7_3_13:1.2
	REL7_4_11:1.2
	REL8_0_6:1.2
	REL8_1_2:1.2
	REL7_3_12:1.2
	REL7_4_10:1.2
	REL8_0_5:1.2
	REL8_1_1:1.2
	REL8_1_STABLE:1.2.0.12
	REL8_1_0:1.2
	REL8_1_0RC1:1.2
	REL8_1_0BETA4:1.2
	REL8_1_0BETA3:1.2
	REL7_3_11:1.2
	REL7_4_9:1.2
	REL8_0_4:1.2
	REL8_1_0BETA2:1.2
	REL8_1_0BETA1:1.2
	REL7_3_10:1.2
	REL7_4_8:1.2
	REL8_0_3:1.2
	REL8_0_2:1.2
	REL7_3_9:1.2
	REL7_4_7:1.2
	REL8_0_1:1.2
	REL8_0_STABLE:1.2.0.10
	REL8_0_0:1.2.0.8
	REL8_0_0RC5:1.2
	REL8_0_0RC4:1.2
	REL8_0_0RC3:1.2
	REL8_0_0RC2:1.2
	REL8_0_0RC1:1.2
	REL8_0_0BETA5:1.2
	REL8_0_0BETA4:1.2
	REL7_4_6:1.2
	REL7_3_8:1.2
	REL8_0_0BETA3:1.2
	REL8_0_0BETA2:1.2
	REL7_4_5:1.2
	REL7_3_7:1.2
	REL7_4_4:1.2
	REL8_0_0BETA1:1.2
	REL7_4_3:1.2
	REL7_4_2:1.2
	REL7_3_6:1.2
	REL7_4_1:1.2
	REL7_3_5:1.2
	REL7_4:1.2
	REL7_4_RC2:1.2
	REL7_4_STABLE:1.2.0.6
	REL7_4_RC1:1.2
	REL7_4_BETA5:1.2
	REL7_4_BETA4:1.2
	REL7_4_BETA3:1.2
	REL7_4_BETA2:1.2
	WIN32_DEV:1.2.0.4
	REL7_4_BETA1:1.2
	REL7_3_4:1.2
	REL7_3_2:1.2
	REL7_3_STABLE:1.2.0.2;
locks; strict;
comment	@# @;


1.4
date	2010.04.23.23.21.43;	author rhaas;	state Exp;
branches;
next	1.3;

1.3
date	2006.07.25.23.23.44;	author momjian;	state Exp;
branches;
next	1.2;

1.2
date	2002.09.12.00.26.00;	author momjian;	state Exp;
branches;
next	1.1;

1.1
date	2002.08.29.23.05.03;	author momjian;	state Exp;
branches;
next	;


desc
@@


1.4
log
@Fix various instances of "the the".

Two of these were pointed out by Erik Rijkers; the rest I found.
@
text
@********************************************************************************
Changes that were made in July 2006 by Joshua Reich I.
********************************************************************************

Code Cleanup:

Update the calling convention for all external facing functions. By external
facing, I mean all functions that are directly referenced in cube.sql. Prior
to my update, all functions used the older V0 calling convention. They now 
use V1.

New Functions: 

cube(float[]), which makes a zero volume cube from a float array

cube(float[], float[]), which allows the user to create a cube from
two float arrays; one for the upper right and one for the lower left
coordinate.

cube_subset(cube, int4[]), to allow you to reorder or choose a subset of
dimensions from a cube, using index values specified in the array.

********************************************************************************
Changes that were made in August/September 2002 by Bruno Wolff III.
********************************************************************************

Note that this was based on a 7.3 development version and changes may not
directly work with earlier versions.

I fixed a bug in cubescan.pl that prevented signed numbers with no digits
before a decimal point from being accepted. This was submitted as a separate
patch and may already be applied.

cube_inter should really return NULL if the two cubes don't overlap. However
this requires changing to the new calling sequence and I don't know enough
about how to do it to make the change.

I changed all floats to doubles except for g_cube_penalty which I don't
think can be changed to return double. This might cause the penalty to
overflow sooner than one might expect, but overflow could have happened
even with floats.

I changed the output format (in cube_out) to use %.16g instead of %g, since the
default is only 6 digits of precision.

I changed all of the functions declared with (isstrict) to use the current
method of declaring this.

I changed all of the externally visible functions to be immutable which
they are. I don't think this matters for the gist functions and didn't
try to declare them immutable in case there was something tricky about them
that I don't understand.

I changed the regression tests to use some larger exponents to test output
in exponential form. 1e7 was too small for this.

I added some regression tests to check for 16 digits of precision. This
may or may not be a good idea.

I got rid of the swap_corners function. It created scratch boxes that
were iterated through and deleted. This is slower than just getting the
larger or smaller coordinate as needed, since swap_corners was doing the
same thing with the overhead of a function call and memory allocation.

I added memset calls to zero out newly allocated NDBOXes as the documentation
on functions indicates should be done. This still doesn't allow a hash
index for equality since there are multiple representations of the
same cube.

I got rid of a call to cube_same in cube_lt and cube_gt since the test
was redundant with other checks being made. The call to cube_same would
only be faster if most of the time you were comparing equivalent cubes.

In cube_lt and cube_gt, the second (UR) for loop for comparing
extra coordinates to 0 had the wrong range.

Note that the cube_distance function wasn't mentioned in the README.cube file.

I added regression tests for the cube_distance function.

I added the following new functions:
cube
cube_dim
cube_ll_coord
cube_ur_coord
cube_is_point
cube_enlarge

cube takes text input and returns a cube. This is useful for making cubes
from computed strings.

cube_dim returns the number of dimensions stored in the data structure
for a cube. This is useful for constraints on the dimensions of a cube.

cube_ll_coord returns the nth coordinate value for the lower left corner
of a cube. This is useful for doing coordinate transformations.

cube_ur_coord returns the nth coordinate value for the upper right corner
of a cube. This is useful for doing coordinate transformations.

cube_is_point returns true if a cube is also a point. This is true when the
two defining corners are the same.

cube_enlarge increases the size of a cube by a specified radius in at least
n dimensions. If the radius is negative the box is shrunk instead. This
is useful for creating bounding boxes around a point for searching for
nearby points. All defined dimensions are changed by the radius. If n
is greater than the number of defined dimensions and the cube is being
increased (r >= 0) then 0 is used as the base for the extra coordinates.
LL coordinates are decreased by r and UR coordinates are increased by r. If a
LL coordinate is increased to larger than the corresponding UR coordinate
(this can only happen when r < 0) than both coordinates are set to their
average.

I added regression tests for the new functions.

I added documentation for cube_distance and the new functions to README.cube
as well as making a few other minor changes.

I changed create function to create or replace function in the install
script.

I limited the number of dimensions allowed in cube_enlarge and cube_in
to 100 to make it harder for people to mess up the database. The constant
is defined in cubedata.h and can be increased if you need something larger.

I added grant statements to the install script to make the functions
executable to everyone.

Bruno Wolff III <bruno@@wolff.to>
@


1.3
log
@/contrib/cube improvements:

Update the calling convention for all external facing functions. By
external facing, I mean all functions that are directly referenced in
cube.sql. Prior to my update, all functions used the older V0 calling
convention. They now use V1.

New Functions:

cube(float[]), which makes a zero volume cube from a float array

cube(float[], float[]), which allows the user to create a cube from
two float arrays; one for the upper right and one for the lower left
coordinate.

cube_subset(cube, int4[]), to allow you to reorder or choose a subset of
dimensions from a cube, using index values specified in the array.

Joshua Reich
@
text
@d92 1
a92 1
cube_dim returns the number of dimensions stored in the the data structure
@


1.2
log
@This is a comprehensive set of diffs (versus current CVS) that replaces those
attached to the same message with the Earth Distance patches.
Recent changes include changing the subscript in one place I forgot
in the previous bugfix patch. A couple of added regression tests, which
should help catch this mistake if it reappears.
I also put in a limit of 100 dimensions in cube_large and cube_in to
prevent making it easy to create very large cubes. Changing one define
in cubedata.h will raise the limit if some needs more dimensions.

Bruno Wolff III
@
text
@d1 23
d25 1
@


1.1
log
@Add cube changes file.
@
text
@d1 1
a1 1
Changes that were made in August 2002.
a9 3
I reported but did not fix a potential buffer overrun problem in cube_yyerror
in cubeparse.y.

d42 3
a44 1
on functions indicates should be done.
d95 10
@
