-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Abdulaziz Ghuloum wrote: > > On May 5, 2009, at 5:07 PM, Marijn Schouten (hkBst) wrote: > >> The function >> >> (define (walk-f depth) >> (let step ((d 0) (x 0) (y 0) #;(z 0)) >> (cond ((< d depth) >> (let ((d+1 (+ d 1))) >> (+ >> (step d+1 (+ x 1) y) >> (+ >> (step d+1 (- x 1) y) >> (+ (step d+1 x (+ y 1)) >> (step d+1 x (- y 1))) )))) >> (else >> (L2-norm x y))))) >> >> calculates the total squared length. > > Wouldn't this be simpler and more efficient: > > (define (walk-f n) > (* n (expt 4 n))) > > Aziz,,,
Wow, I am so confused that I even posted to the wrong mailing list :( It would be faster, but harder to change to self-avoiding random walks. Marijn - -- If you cannot read my mind, then listen to what I say. Marijn Schouten (hkBst), Gentoo Lisp project, Gentoo ML <http://www.gentoo.org/proj/en/lisp/>, #gentoo-{lisp,ml} on FreeNode -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkoAYnUACgkQp/VmCx0OL2wOeQCgk21lobOzwcmaTD3LTw+bL95m 60kAmQHfIwM5I3g10twmcl8Dc8H6iAyU =QaF6 -----END PGP SIGNATURE-----
