Closest-pair problem: Difference between revisions

(→‎{{header|R}}: Changed hidden link to more visible review template with specified reason)
Line 599:
-(double)y;
-(double)dist: (Point *)pt;
-(NSIntegerNSComparisonResult)compareX: (Point *)pt;
-(NSIntegerNSComparisonResult)compareY: (Point *)pt;
@end
 
Line 606:
+(id)x: (double)x y: (double)y
{
return [[[meself alloc] initWithX: x andY: y] autorelease];
id me = [super new];
[me initWithX: x andY: y];
return me;
}
-(id)initWithX: (double)x andY: (double)y
{
if ((self = [super init]) != nil) {
xCoord = x;
yCoord xCoord = yx;
yCoord = y;
}
return self;
}
Line 629:
([self y] - [pt y])*([self y] - [pt y]) );
}
-(NSIntegerNSComparisonResult)compareX: (Point *)pt
{
if ( [self x] < [pt x] ) {
Line 639:
}
}
-(NSIntegerNSComparisonResult)compareY: (Point *)pt
{
if ( [self y] < [pt y] ) {
Anonymous user