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