Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 32784cd

Browse files
committed
The changes I have made are described in CHANGES. This was based on
diffs to 7.3-devel and may not be applicable to 7.2. I have included a change covered by a previous bugfix patch I submitted (the problem with -.1 not being accepted by cube_in). It does not include a fix for the potential buffer overrun issue I reported for cube_yyerror in cubeparse.y. Bruno Wolff III
1 parent 6d27cfd commit 32784cd

File tree

8 files changed

+695
-255
lines changed

8 files changed

+695
-255
lines changed

contrib/cube/README.cube

+49-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Tokens
9999

100100
n [0-9]+
101101
integer [+-]?{n}
102-
real [+-]?({n}\.{n}?)|(\.{n})
102+
real [+-]?({n}\.{n}?|\.{n})
103103
FLOAT ({integer}|{real})([eE]{integer})?
104104
O_BRACKET \[
105105
C_BRACKET \]
@@ -182,8 +182,8 @@ t
182182
PRECISION
183183
=========
184184

185-
Values are stored internally as 32-bit floating point numbers. This means that
186-
numbers with more than 7 significant digits will be truncated.
185+
Values are stored internally as 64-bit floating point numbers. This means that
186+
numbers with more than about 16 significant digits will be truncated.
187187

188188

189189
USAGE
@@ -253,6 +253,44 @@ Other operators:
253253
reasonably good sorting in most cases, which is useful if
254254
you want to use ORDER BY with this type
255255

256+
The following functions are available:
257+
258+
cube_distance(cube, cube) returns double
259+
cube_distance returns the distance between two cubes. If both cubes are
260+
points, this is the normal distance function.
261+
262+
cube(text) returns cube
263+
cube takes text input and returns a cube. This is useful for making cubes
264+
from computed strings.
265+
266+
cube_dim(cube) returns int
267+
cube_dim returns the number of dimensions stored in the the data structure
268+
for a cube. This is useful for constraints on the dimensions of a cube.
269+
270+
cube_ll_coord(cube, int) returns double
271+
cube_ll_coord returns the nth coordinate value for the lower left corner
272+
of a cube. This is useful for doing coordinate transformations.
273+
274+
cube_ur_coord(cube, int) returns double
275+
cube_ur_coord returns the nth coordinate value for the upper right corner
276+
of a cube. This is useful for doing coordinate transformations.
277+
278+
cube_is_point(cube) returns bool
279+
cube_is_point returns true if a cube is also a point. This is true when the
280+
two defining corners are the same.
281+
282+
cube_enlarge(cube, double, int) returns cube
283+
cube_enlarge increases the size of a cube by a specified radius in at least
284+
n dimensions. If the radius is negative the box is shrunk instead. This
285+
is useful for creating bounding boxes around a point for searching for
286+
nearby points. All defined dimensions are changed by the radius. If n
287+
is greater than the number of defined dimensions and the cube is being
288+
increased (r >= 0) then 0 is used as the base for the extra coordinates.
289+
LL coordinates are decreased by r and UR coordinates are increased by r. If
290+
a LL coordinate is increased to larger than the corresponding UR coordinate
291+
(this can only happen when r < 0) than both coordinates are set to their
292+
average.
293+
256294
There are a few other potentially useful functions defined in cube.c
257295
that vanished from the schema because I stopped using them. Some of
258296
these were meant to support type casting. Let me know if I was wrong:
@@ -287,3 +325,11 @@ Building 221
287325
Argonne, IL 60439-4844
288326

289327
selkovjr@mcs.anl.gov
328+
329+
------------------------------------------------------------------------
330+
331+
Minor updates to this package were made by Bruno Wolff III <bruno@wolff.to>
332+
in August of 2002.
333+
334+
These include changing the precision from single precision to double
335+
precision and adding some new functions.

0 commit comments

Comments
 (0)