From: Diego Virasoro Date: 2006-03-30T00:02:35+09:00 Subject: additions to matrix.rb Hello, sometime ago I was told to post here what (I feel) the matrix.rb classes still lack. (note 1: I hope I haven't overlooked any already existing methods from the documentation (I checked the rdoc for 1.8) note 2: this is all very imho) In order of importance: matrix.[]= and vector.[]= These are by far the most important missing methods, so that one can modify existing matrices and vectors. matrix multiplication by a number The result should be that each element in the matrix is multiplied by that number. This is already implemented for Vector. matrix.symmetric? true if the matrix is equal to its transpose: hence only true for a square matrix where the matrix is symmetric along the diagonal (from upper left to bottom right) matrix.diagonal? true if the matrix is diagonal, ie. zero everywhere excluding the diagonal (where it can be any number) alias: vector.inner_product should be equal to vector.dot_product not at all important, really. But nice nevertheless. I tried to suggest only the most common and generic methods. (There are other useful too, however, if you want to make it more complete.) I hope that helps Diego Virasoro