| 1 | initial version |
How about something like this:
def xyz(n):
m = -Infinity # or some number that you know is less than the max
matrices = [] # list of matrices with max determinant
for A in myfunction(n):
d = A.det()
if d > m:
matrices = [A]
m = d
elif d == m:
matrices.append(A)
return matrices
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.