method

empty

Importance_1
Ruby latest stable (v2_5_5) - 0 notes - Class: Matrix
empty(row_count = 0, column_count = 0) public

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]]
Show source
Register or log in to add new notes.