R/triangles.R
diag_sums.Rd
For each anti-diagonal k = 1..nrow(trg) returns the sum of its values.
k = 1..nrow(trg)
diag_sums(trg)
A square numeric matrix (a triangle).
Numeric vector of length nrow(trg).
nrow(trg)
diag_sums(matrix(c(10, 5, 2, 20, 7, NA, 15, NA, NA), nrow = 3, byrow = TRUE)) #> [1] 10 25 24