Re: Creating a matrix mirrored around it's main diagonal

2009-12-04 Thread Konrad Hinsen
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 po

Re: Creating a matrix mirrored around it's main diagonal

2009-12-04 Thread Tiemo Kieft
This is what it should look like: >>| 1 | 2 | 3 | >> >> 1 | 0 | A | B | >> >> 2 | A | 0 | C | >> >> 3 | B | C | 0 | >> > > Perhaps I'm misapprehending the issue, but why isn't the following > sufficient: > > (defn transpo

Re: Creating a matrix mirrored around it's main diagonal

2009-12-03 Thread ataggart
On Dec 3, 4:28 am, Tiemo Kieft wrote: > Hi, > > I'm trying to create a matrix, basically it's a vector of vectors. I copied > the code from ants.clj to create the matrix, however, I have to mirror the > matrix around it's main diagonal (see below). Currently I'm doing this by > first creating

Re: Creating a matrix mirrored around it's main diagonal

2009-12-03 Thread CuppoJava
Matrix arithmetic is one of those cases where I feel indexing is clearer than filter/map functions. However, if you're representing matrices as vectors as vectors, this will likely come with a little bit of extra overhead. That's not a problem usually because if you plan on doing any sort of heav

Creating a matrix mirrored around it's main diagonal

2009-12-03 Thread Tiemo Kieft
Hi, I'm trying to create a matrix, basically it's a vector of vectors. I copied the code from ants.clj to create the matrix, however, I have to mirror the matrix around it's main diagonal (see below). Currently I'm doing this by first creating the matrix like this: (apply vector (map (fn [i]