From: Michael Ulm Date: 2006-09-12T16:55:13+09:00 Subject: Re: Matrix Paul Lutus wrote: > MonkeeSage wrote: > > / ... > > >>Anyhow, I don't really care if []= is there by default, I can add it if >>I want it; but I just don't understand why "a matrix [as a value] is >>immutable" means that []= shouldn't be there regarding the data >>structure. > > > You might as well ask why there is no formal method to change the third > digit of an integer in class Fixnum. The reply would be that integers are > ordinarily dealt with in their entirety, and for special needs, the user of > the class can write custom code to deal with the border cases, but there's > no point in trying to include all the marginal utilities in the formal > class definition. > > Most matrix operations operate on matrices as units. Here's an example, a > matrix from my library, responsible for rotating objects in three-space: > --snip-- > > In this case, the matrix at the heart of the class is the most economical > way to accomplish the mathematical objective, and there's really no point > in being able to change any of its constituent parts, once it has been > constructed. It would be very easy to modify any single array cell, but > there's simply no point. > > I think the writers of the Matrix class realized this, and didn't bother to > include an assignment operator on the ground that it wouldn't have any > general utility. > Then they would have been wrong. The lack of the []= operator has been a major PITA for me, as I often need matrix functions (FWIW I'm a mathematician, working on applications of artificial inteligence). The implementations of many higher level matrix operations needs the assignment operator. Try implementing a SVD algorithm without it. 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. ---------------------------------------------------------------