Skip to contents

Returns the lower triangular part of a 2-D array, setting elements above the specified diagonal to zero.

Usage

nv_tril(operand, diagonal = 0L)

Arguments

operand

(arrayish)
Operand.

diagonal

(integer(1))
Diagonal offset. 0 (default) is the main diagonal, positive values include diagonals above, negative values exclude diagonals below.

Value

arrayish
Has the same shape and data type as operand.

See also

Examples

x <- nv_fill(1, c(3, 3))
nv_tril(x)
#> AnvlArray
#>  1 0 0
#>  1 1 0
#>  1 1 1
#> [ CPUf32{3,3} ]