Page 1 of 1

Indices for Minimum of an Array

Posted: Mon Sep 02, 2013 11:36 am
by Ken-Cogger
I have an array A(625,625) with minimum value returned by %minvalue(A).
Is there a simple way of returning the indices for this value?
%minindex(A) does not work even though its argument is said to be an array.

Re: Indices for Minimum of an Array

Posted: Mon Sep 02, 2013 2:19 pm
by TomDoan
You have to vec and unvec it:

compute ix=%maxindex(%vec(a))
compute col=%block(ix,625)
compute row=%clock(ix,625)

Re: Indices for Minimum of an Array

Posted: Thu Sep 05, 2013 2:13 pm
by Ken-Cogger
What if array A is packed/lower triangular?
Thanks,
Ken.

Re: Indices for Minimum of an Array

Posted: Thu Sep 05, 2013 4:46 pm
by TomDoan
Use %SYMMCOL and %SYMMROW instead:

compute ix=%maxindex(%vec(a))
compute col=%symmcol(ix)
compute row=%symmrow(ix)