I would like to start evaluating Ruby's capabilities in processing large
linear systems and matrices and I would like to know if there is a
simple way to 'randomly' populate various matrices regardless of size or
type.
Any help, comments, anything is greatly appreciated!
require 'matrix'
a, b = 2, 3
m = Matrix[*(Array.new(a) {Array.new(b) {rand}})]
Todd
···
On 10/19/07, Jason Bornhoft <jbornhoft@gmail.com> wrote:
I would like to start evaluating Ruby's capabilities in processing large
linear systems and matrices and I would like to know if there is a
simple way to 'randomly' populate various matrices regardless of size or
type.
Any help, comments, anything is greatly appreciated!
require 'matrix'
a, b = 2, 3
m = Matrix[*(Array.new(a) {Array.new(b) {rand}})]
Todd
What I would ideally like is to be able to specify the size of the
matrix and then have a random function populate the matrix with real
integers or, eventually, complex numbers.
On Oct 19, 2007, at 9:38 PM, Jason Bornhoft wrote:
Not sure what you want exactly, but, maybe...
require 'matrix'
a, b = 2, 3
m = Matrix[*(Array.new(a) {Array.new(b) {rand}})]
Todd
What I would ideally like is to be able to specify the size of the
matrix and then have a random function populate the matrix with real
integers or, eventually, complex numbers.