From: Michael Ulm Date: 2006-09-12T16:57:45+09:00 Subject: Re: Matrix Just Another Victim of the Ambient Morality wrote: > "MonkeeSage" wrote in message > news:1158024640.933843.82830@i42g2000cwa.googlegroups.com... > >>Dave Burt wrote: >> >>>If you want a matrix-like data structure (rather than a mathematical >>>matrix), why not use an array of arrays? >> >>A mathematical matrix is just a dimensional arrangement of data into >>"rows" and "columns", thus allowing for certain algorithmic >>relationships to be defined and applied (e.g., canonical >>decompositions). Every matrix (i.e., the actual matrix considered as a >>complex value) is immutable and has a unique identity, just like every >>number -- that's true -- but they can also be permuted or otherwise >>transformed into different matrices. Why should one have to do that >>constructively (i.e., construct a new matrix "from scratch"), rather >>than destructively (i.e., change the existing matrix "in place"). Think >>of it like this: n = 1; n = n + 1 -- even though the number 1 is >>immutable and has a unique identity, the reference to it is not, and >>can thus be destructively altered by assignment with the result that it >>refers to new identity. It would be a pain to have to do o = n + 1, p = >>n + 2 (i.e., creating new references every time the data changes), just >>because 1 is immutable. Why should a matrix be any different? Mabye I'm >>missing something... > > > As far as I can tell, matrices are no different. Your example shows > that 1 is immutable but references to it can be re-assigned, so you can do: > > n = 3 > n = n + 1 > > > Matrices are no different and, so, you can do: > > > n = Matrix.scalar(2, 3) > n = n + Matrix.I(2) > > > In both cases, the "number" types are immutable but the references to > them are not, as you say. They both work exactly the same way. What are > you trying to say? > > I think he's trying to say, that there is no rational reason for leaving out the []= operator, and I agree. Regards, Michael -- Michael Ulm R&D Team ISIS Information Systems Austria tel: +43 2236 27551-219, fax: +43 2236 21081 e-mail: michael.ulm@isis-papyrus.com Visit our Website: www.isis-papyrus.com --------------------------------------------------------------- This e-mail is only intended for the recipient and not legally binding. Unauthorised use, publication, reproduction or disclosure of the content of this e-mail is not permitted. This email has been checked for known viruses, but ISIS accepts no responsibility for malicious or inappropriate content. ---------------------------------------------------------------