From: Paul Lutus Date: 2006-09-11T19:25:30+09:00 Subject: Re: Matrix MonkeeSage wrote: > Dave Burt wrote: >> It's by design. A Matrix is immutable, like Ruby's other numbers >> (Fixnum, Rational, Complex...) > > Why should a Matrix be immutable? It's not a type like a Fixnum, it's a > data structure, like an Array or Hash. What is gained by creating a new > Matrix from a changing data stream, rather than updating an existing > one? In mathematics, matrices of various kinds are regarded as a unit, usually indivisible. For example, they're used a lot in computer graphics processing to hold rotation matrices. The rotation matrices are loaded with specific values that accomplish rotations and translations, and until the computed viewpoint changes, the entire matrix is used to process all the image vertices. Then, when the viewpoint changes, the entire matrix is recomputed, and a new immutable matrix is created. The point I am making is that the matrix can't function if it is thought of as nine scalar values rather than a 3x3 square matrix. -- Paul Lutus http://www.arachnoid.com