Changeset 43
- Timestamp:
- 09/25/07 05:57:33 (5 years ago)
- Location:
- hw/hw2/postgresql-8.2.4/src/backend/utils/adt
- Files:
-
- 2 modified
-
geo_ops.c (modified) (4 diffs)
-
geo_selfuncs.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
hw/hw2/postgresql-8.2.4/src/backend/utils/adt/geo_ops.c
r42 r43 68 68 static Point *line_interpt_internal(LINE *l1, LINE *l2); 69 69 70 71 70 /* 72 71 * Delimiters for input and output strings. … … 809 808 } 810 809 810 double box_distance_internal(BOX *box1, BOX *box2) 811 { 812 Point a, 813 b; 814 815 box_cn(&a, box1); 816 box_cn(&b, box2); 817 return(HYPOT(a.x - b.x, a.y - b.y)); 818 819 } 811 820 812 821 /* box_distance - returns the distance between the … … 818 827 BOX *box1 = PG_GETARG_BOX_P(0); 819 828 BOX *box2 = PG_GETARG_BOX_P(1); 820 Point a, 821 b; 822 823 box_cn(&a, box1); 824 box_cn(&b, box2); 825 826 PG_RETURN_FLOAT8(HYPOT(a.x - b.x, a.y - b.y)); 829 double result = box_distance_internal(box1, box2); 830 831 PG_RETURN_FLOAT8(result); 827 832 } 828 833 … … 5248 5253 return FALSE; 5249 5254 } 5255 5256 double box_mindist_internal(BOX *box1, BOX *box2) 5257 { 5258 /* CS186 HW2: fill me in! */ 5259 } 5260 5261 Datum box_mindistance(PG_FUNCTION_ARGS) 5262 { 5263 BOX *box1 = PG_GETARG_BOX_P(0); 5264 BOX *box2 = PG_GETARG_BOX_P(1); 5265 5266 PG_RETURN_FLOAT8(box_mindist_internal(box1, box2)); 5267 } 5268 5269 Datum box_true(PG_FUNCTION_ARGS) 5270 { 5271 PG_RETURN_BOOL(TRUE); 5272 } -
hw/hw2/postgresql-8.2.4/src/backend/utils/adt/geo_selfuncs.c
r42 r43 94 94 PG_RETURN_FLOAT8(0.001); 95 95 } 96 97 /* useful for near-neighbor predicates */ 98 Datum 99 zerosel(PG_FUNCTION_ARGS) 100 { 101 PG_RETURN_FLOAT8(0); 102 }
