diagonal


function diagonal(y:Expression<Real>, z:Integer) -> Diagonal

Lazy diagonal.

function diagonal(x:Expression<Real[_]>) -> MatrixDiagonal

Lazy diagonal.

function diagonal(y:Expression<Real[_,_]>) -> MultivariateDiagonal

Lazy diagonal.

function diagonal(x:Real[_]) -> Real[_,_]

Diagonal matrix from vector.

function diagonal(X:Real[_,_]) -> Real[_]

Diagonal of a matrix, as a vector.

function diagonal(x:Real, length:Integer) -> Real[_,_]

Create diagonal matrix, filling the diagonal with a given scalar value.

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

function diagonal(x:Integer, length:Integer) -> Integer[_,_]

Create diagonal matrix, filling the diagonal with a given scalar value.

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

function diagonal(x:Boolean, length:Integer) -> Boolean[_,_]

Create diagonal matrix, filling the diagonal with a given scalar value.

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