= 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 133 def Matrix.scalar(n, value) diagonal(*Array.new(n, value)) end