After I posted this Roger sent a note that he would optimize this. And some
variations of this too. Will be interesting to see what he comes up with.
On Thu, Oct 16, 2008 at 7:13 PM, Randy MacDonald <[EMAIL PROTECTED]> wrote:
> Hello Don;
>
> Neat solution, which probably scans the array (log N) times, being a sort
> and all.
>
> Don Guinn wrote:
>
>> How about
>> {.\: ?. 30$100
>> 9
>>
>>
>> On Sun, Oct 12, 2008 at 9:00 AM, June Kim <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>> I can get the index of the maximum value easily, first getting the
>>> maximum and then getting the index:
>>>
>>> I.@(=>./) ?. 30$100
>>> 9
>>>
>>> Suppose, there is one presence of maximum value in the data.
>>>
>>> However, the solution isn't satisfactory to me. Is there a simple
>>> single step way of finding the index of the max? That is, the way
>>> where you don't need to scan the data twice(once for max, another for
>>> index).
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>
>>>
>>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>>
>>
>
> --
> ------------------------------------------------------------------------
> |\/| Randy A MacDonald | APL: If you can say it, it's done.. (ram)
> |/\| ramacd <at> nbnet.nb.ca |
> |\ | | The only real problem with APL is that
> BSc(Math) UNBF'83 | it is "still ahead of its time."
> Sapere Aude | - Morten Kromberg
> Natural Born APL'er |
> -----------------------------------------------------(INTP)----{ gnat }-
>
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm