Matrix.fromDiagonal

Constructs a Matrix with diagonal values from diag and all others equal to 0.

  1. Matrix fromDiagonal(T diag)
  2. Matrix fromDiagonal(T[N] diag)
    struct Matrix(T, uint numColumns, uint numRows = numColumns)
    static
    fromDiagonal
    (
    uint N
    )
    (
    const auto ref T[N] diag
    )
    if (
    numColumns > 0 &&
    numRows > 0
    )

Meta