Fork me on GitHub

src/arraymancer/linear_algebra/helpers/triangular

Search:
Group by:
  Source Edit

Procs

proc tril[T](a: Tensor[T]; k: static int = 0): Tensor[T]

Lower triangle of a matrix.

Return a copy of a matrix with the elements above the k-th diagonal zeroed.

Inputs:

  • a: the input matrix (i.e. a rank-2 tensor)
  • k: the diagonal above which elements will be zeroed (default = 0, i.e. the main diagonal)

Result:

  • A copy of the input matrix with the elements above the k-th diagonal zeroed.
  Source Edit
proc tril_unit_diag[T](a: Tensor[T]): Tensor[T]
Lower-triangular matrix with unit diagonal For use with getrf which returns LU matrices with L a unit diagonal (not returned) and U a non-unit diagonal (present)   Source Edit
proc tril_unit_diag_mut[T](a: var Tensor[T])

Lower-triangular matrix with unit diagonal For use with getrf which returns LU matrices

The input upper-half is overwritten with 0 The input diagonal is overwritten with 1 Input must be column major

  Source Edit
proc triu[T](a: Tensor[T]; k: static int = 0): Tensor[T]

Upper triangle of a matrix.

Return a copy of a matrix with the elements below the k-th diagonal zeroed.

Inputs:

  • a: the input matrix (i.e. a rank-2 tensor)
  • k: the diagonal below which elements will be zeroed (default = 0, i.e. the main diagonal)

Result:

  • A copy of the input matrix with the elements below the k-th diagonal zeroed.
  Source Edit
Arraymancer Technical reference Tutorial Spellbook (How-To's) Under the hood