Skip to contents

Lists every (i, j) with A[i, j] >= x as one row (i, j, A[i, j]) – TDA's mcel, scanning row by row. Refuses if no element of A reaches x (there would be nothing to return).

Usage

tda_mcel(A, x, dir = tempfile("tda"))

Arguments

A

a square numeric matrix.

x

the threshold; an entry is an edge when it is at least this large.

dir

working directory.

Value

A 3-column numeric matrix: i, j, and the value A[i, j], one row per edge.

Examples

# a valued adjacency matrix; keep the edges of value 2 or more
A <- matrix(c(0, 3, 0,
              1, 0, 5,
              0, 2, 0), 3, byrow = TRUE)
tda_mcel(A, 2)   # (1,2) 3, (2,3) 5, (3,2) 2 -- (2,1) 1 is dropped
#>      [,1] [,2] [,3]
#> [1,]    1    2    3
#> [2,]    2    3    5
#> [3,]    3    2    2