to_a

to_a() Instance Public methods Alias for: to_ary

to_ary

to_ary() Instance Public methods Returns L, U, P in an array to_a

u

u() Instance Public methods Returns the upper triangular factor U

I

I(n) Class Public methods Alias for: identity

[]

[](*rows) Class Public methods Creates a matrix where each argument is a row. Matrix[ [25, 93], [-1, 66] ] => 25 93 -1 66

build

build(row_count, column_count = row_count) Class Public methods Creates a matrix of size row_count x column_count. It fills the values by calling the given block, passing the current row and column. Returns an enumerator if no block is given. m = Matrix.build(2, 4) {|row, col| col - row } => Matrix[[0, 1, 2, 3], [-1, 0, 1, 2]] m = Matrix.build(3) { rand } => a 3x3 matrix with random elements

column_vector

column_vector(column) Class Public methods Creates a single-column matrix where the values of that column are as given in column. Matrix.column_vector([4,5,6]) => 4 5 6

columns

columns(columns) Class Public methods Creates a matrix using columns as an array of column vectors. Matrix.columns([[25, 93], [-1, 66]]) => 25 -1 93 66

diagonal

diagonal(*values) Class Public methods Creates a matrix where the diagonal elements are composed of values. Matrix.diagonal(9, 5, -3) => 9 0 0 0 5 0 0 0 -3

empty

empty(row_count = 0, column_count = 0) Class Public methods Creates a empty matrix of row_count x column_count. At least one of row_count or column_count must be 0. m = Matrix.empty(2, 0) m == Matrix[ [], [] ] => true n = Matrix.empty(0, 3) n == Matrix.columns([ [], [], [] ]) => true m * n => Matrix[[0, 0, 0], [0, 0, 0]]