On 8/22/2009 12:39:23 AM, jmG wrote:
...
>Enjoy this "QED ad absurdum" ... end of
>it.
Jean, sometimes I wonder if you really understand some of the things you post in the collaboratory. Do you really understand what you are doing in this routine? I can understand how confused is Neil (assuming he's really a novice in programming). C'mon, you even confused me and I have programmed for 30+ years in a dozen of different programming languages.
- First you're doing the test defined in the function 'c(x)'. So you're getting a vector of 0's & 1's that means which elements of 'V' falls within the range 'base +- n'. So far so good, that's what Neil asked, even when you had not extracted the value of 'base' from the desired element in vector 'V'.
- Then you multiply 'c(V)' by 'V'. By doing this you set all the "undesired" values of 'V' to zero to be dropped later. Notice that this procedure will fail if the value zero is a valid value.
- Finally you pass the resulting vector 'w' to the routine 'Drop' where you apply another selection, filtering again the data with the condition set in 'q(x)'.
Do you really think this is what Neil asked? Don't you think you better do simply 'vx:=Drop(V,c)'?
Please don't take this as a personal attack, I'm just trying to tell you that you must settle down and think a little in your 'auctioneer' routine and what it really does.
With respect to my routine failing with unsorted data, just remember that every program is a SISO queue, if you know what I means...
Saludos,
Al