= private = protected
scalar(n, value)
Creates an n by n diagonal matrix where each diagonal element is value.
Matrix.scalar(2, 5) => 5 0 0 5
# File lib/matrix.rb, line 180 def Matrix.scalar(n, value) Matrix.diagonal(*Array.new(n).fill(value, 0, n)) end