matrix


function matrix<Type>(λ:\(Integer, Integer) -> Type, rows:Integer, columns:Integer) -> Type[_,_]

Create a matrix filled by a lambda function.

  • λ: Lambda function.
  • rows: Number of rows.
  • columns: Number of columns.

Returns: The new matrix.

The lambda function is called once for each element in the new matrix, receiving, as its argument, the row and column indices of that element, and returning the value at that element.

function matrix<Type>(x:Type, rows:Integer, columns:Integer) -> Type[_,_]

Create matrix filled with a given scalar value.

  • x: The value.
  • rows: Number of rows.
  • columns: Number of columns.