Re: Approximate comparison of two lists of floats

2011-07-28 Thread Dan Stromberg
You'd probably better explain in English which things truly need to be compared with what. Right now, your first version is, I believe, an O(n^4) algorithm, which is extremely expensive, while your second (set-based) version appears to be O(n^3), which is quite a bit better, but still not stellar.

Re: Approximate comparison of two lists of floats

2011-07-28 Thread Peter Otten
Christian Doll wrote: > i have e little performance problem with my code... > > i have to compare many lists of very much floats. at moment i have > nested for-loops > > for a in range( len(lists) ): > for b in range( a+1 , len(lists) ): > for valuea in lists[a]: > equal=

Approximate comparison of two lists of floats

2011-07-28 Thread Christian
Hello, i have e little performance problem with my code... i have to compare many lists of very much floats. at moment i have nested for-loops for a in range( len(lists) ): for b in range( a+1 , len(lists) ): for valuea in lists[a]: equal=False for valueb in lists

Approximate comparison of two lists of floats

2011-07-28 Thread Christian Doll
Hello, i have e little performance problem with my code... i have to compare many lists of very much floats. at moment i have nested for-loops for a in range( len(lists) ): for b in range( a+1 , len(lists) ): for valuea in lists[a]: equal=False for valueb in l