Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit32784cd

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 achange 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 thepotential buffer overrun issue I reported for cube_yyerror incubeparse.y.Bruno Wolff III
1 parent6d27cfd commit32784cd

File tree

8 files changed

+695
-255
lines changed

8 files changed

+695
-255
lines changed

‎contrib/cube/README.cube

Lines changed: 49 additions & 3 deletions
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 as32-bit floating point numbers. This means that
186-
numbers with more than7 significant digits will be truncated.
185+
Values are stored internally as64-bit floating point numbers. This means that
186+
numbers with more thanabout 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)

[8]ページ先頭

©2009-2025 Movatter.jp