On 04.12.2009, at 11:27, Tiemo Kieft wrote:
> So transposing it is not enough. I need the part above the main
> diagonal to be 'transposed' and put underneath the main diagonal.
> Maybe I wasn't as clear as I hoped. Let me restate the issue.
So you want to symmetrize your matrix, right? If possible, I'd
construct it symmetric right from the start, e.g.:
(defn matrix-element
[i j]
(cond (= i j) 0
(< i j) (- j i)
:else (matrix-element j i)))
(def matrix
(vec (for [i (range 5)]
(vec (for [j (range 5)]
(matrix-element i j))))))
Konrad.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en