|
99 | 99 |
|
100 | 100 | n [0-9]+
|
101 | 101 | integer [+-]?{n}
|
102 |
| -real [+-]?({n}\.{n}?)|(\.{n}) |
| 102 | +real [+-]?({n}\.{n}?|\.{n}) |
103 | 103 | FLOAT ({integer}|{real})([eE]{integer})?
|
104 | 104 | O_BRACKET \[
|
105 | 105 | C_BRACKET \]
|
|
182 | 182 | PRECISION
|
183 | 183 | =========
|
184 | 184 |
|
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. |
187 | 187 |
|
188 | 188 |
|
189 | 189 | USAGE
|
@@ -253,6 +253,44 @@ Other operators:
|
253 | 253 | reasonably good sorting in most cases, which is useful if
|
254 | 254 | you want to use ORDER BY with this type
|
255 | 255 |
|
| 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 | + |
256 | 294 | There are a few other potentially useful functions defined in cube.c
|
257 | 295 | that vanished from the schema because I stopped using them. Some of
|
258 | 296 | these were meant to support type casting. Let me know if I was wrong:
|
@@ -287,3 +325,11 @@ Building 221
|
287 | 325 | Argonne, IL 60439-4844
|
288 | 326 |
|
289 | 327 | 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