You could also use

argminall=: 4 $. $.@(= <./@,)

However because neither take advantage of the special code (i. <. /), they
don't have the same performance.

On Fri, 27 Dec 2019, 14:42 Jimmy Gauvin, <jimmy.gau...@gmail.com> wrote:

> Adding to Henry's idiom :
>
>    argminall =: $ #: I.@(= <./)@,
>    argminall 3 3$5
> 0 0
> 0 1
> 0 2
> 1 0
> 1 1
> 1 2
> 2 0
> 2 1
> 2 2
>
>
>
> On Thu, Dec 26, 2019 at 8:23 PM Arnab Chakraborty <damd...@gmail.com>
> wrote:
>
> > wow!
> >
> > On Thu, 26 Dec 2019, 10:43 Henry Rich, <henryhr...@gmail.com> wrote:
> >
> > > argmin =: $ #: (i. <./)@,
> > >
> > > This is a standard APL idiom.
> > >
> > > Henry RIch
> > >
> > > On 12/26/2019 12:01 AM, Arnab Chakraborty wrote:
> > > > Dear all,
> > > >
> > > > I want to find the position (i,j) of the min entry in a n by n
> matrix.
> > > >
> > > > My current solution is
> > > >
> > > > ((=<./),mat )#"1 2,/(i.n),"0/i.n
> > > >
> > > > Is there a smarter method?
> > > >
> ----------------------------------------------------------------------
> > > > For information about J forums see
> http://www.jsoftware.com/forums.htm
> > >
> > > ----------------------------------------------------------------------
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to