[Numpy-discussion] largest matrix element
Scott Ransom
ransom at cfa.harvard.edu
Tue Jul 24 15:24:50 EDT 2001
Charles G Waldman wrote:
>
> nils.wagner at freenet.de writes:
> > Given a complex Matrix A(m,n)
> > How can I get the absolute value of the largest matrix element
> > very efficiently ?
>
> How about
>
> sqrt(max((asarray(A)*conjugate(asarray(A))).real))
I if you want the global maximum you need a ravel in there:
sqrt(max(ravel((asarray(a)*conjugate(asarray(a))).real)))
Scott
--
Scott M. Ransom Address: Harvard-Smithsonian CfA
Phone: (617) 496-7908 60 Garden St. MS 10
email: ransom at cfa.harvard.edu Cambridge, MA 02138
GPG Fingerprint: 06A9 9553 78BE 16DB 407B FFCA 9BFA B6FF FFD3 2989
More information about the NumPy-Discussion
mailing list