Re: converting a R code to fortran
- From: Michel Olagnon <molagnon@xxxxxxxxxxxxxxxxx>
- Date: Tue, 27 Feb 2007 09:40:48 +0100
e p chandler wrote:
Here's my idea on solving this problem, which I suspect must be
O(N*N). Ignore the effect of duplicate values in X1 and X2. Compute
the ranks of the original entries in X1 and X2. Given the ranks,
ignore the numerical values. Consider the points in rank space, say on
a chess board with (1,1) at lower left and (N+1,N+1) at upper right.
Put the points (chess pieces) (x1(i),x2(i)) on the board. Starting at
the lower left work to the upper right either by traversing one file
at a time or by considering the boundary of an expanding square.
Compute the count of points to the left and below from those in
adjacent "kitty corner" cells. The only way a count rises is if you go
both up and right from a square which contains a piece.
If you are looking for an O(N*N) algorithm, then you need only to rank
one dimension, this is the algorithm that I gave.
.
- Follow-Ups:
- Re: converting a R code to fortran
- From: e p chandler
- Re: converting a R code to fortran
- References:
- converting a R code to fortran
- From: fortee
- Re: converting a R code to fortran
- From: Michel Olagnon
- Re: converting a R code to fortran
- From: e p chandler
- converting a R code to fortran
- Prev by Date: Re: integer*8 speed vs integer*4 speed
- Next by Date: Re: integer*8 speed vs integer*4 speed
- Previous by thread: Re: converting a R code to fortran
- Next by thread: Re: converting a R code to fortran
- Index(es):
Relevant Pages
|