Kip,
Alternative formulations for your adverb that require fewer calculations of
u y.
Max1 =: 1 : 0
((= >./)@:u # ] ,. u) y
)
Max2 =: 1 : 0
fnres=. u y
where=. (= >./) fnres
where # y ,. fnres
)
I'd be interested in a tacit implementation of one of the adverbs Max
above. I came up with the same as Pepe for a simple Max ( >./@: ) but
can't see how to "factor out" the verb area from the adverbs in the
following:
Max3=: (({~ area ((i. >./)@:)) , area (>./@:))
On Sun, Feb 24, 2013 at 9:18 AM, km <[email protected]> wrote:
> Borrowing ideas from Raul, I like
>
> Max =: 1 : 0
> max =. >./ u y
> where =. max = u y
> where # y ,. u y
> )
>
> which identifies the max and where it occurs:
>
> *: Max i:2
> _2 4
> 2 4
> (4 - *:) Max i:2
> 0 4
>
> Sent from my iPad
>
>
> On Feb 23, 2013, at 1:04 PM, Jose Mario Quintana <
> [email protected]> wrote:
>
> > I did not see your second post!
> >
> > area=. ] * 50 - %&2
> > area(max=. (>./) @:) 0 to 100
> > 1250
> > max
> >> ./@:
> >
> > On Sat, Feb 23, 2013 at 1:46 PM, km <[email protected]> wrote:
> >
> >> Can we have an adverb Max so that f Max y finds the maximum of f on
> >> the list y ?
> >>
> >> Sent from my iPad
> >>
> >>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm