From: Justin Collins Date: 2006-03-24T07:17:37+09:00 Subject: Re: Matrices, Gtk et al Robert Love wrote: > I have something working but it sure seems clumsy and I'm hoping for > pointers to make it better. My app is a ruby & Gtk thing to do some > calculations. I want to have a standard 3x3 matrix of floating point > numbers as well some 3x1 vectors. I'm using a 9 element array today for > the 3x3. I also have a series of 9 Gtk.Entry fields that is even more > clumsy than the floating point numbers. > > How do I build a function that, when called by the Calc button callback, > fetches the contents of the 9 numbers and returns it as a 3x3 matrix? > From what I've read, ruby doesn't have real two dimensional arrays. So > am I stuck doing everything in a manner that doesn't map well to my math > problem domain? > > All advice appreciated Try checking out the Matrix standard library: http://ruby-doc.org/stdlib/libdoc/matrix/rdoc/index.html -Justin