R/utils-amat.R

Defines functions amat2arcs arcs2amat

# convert a set of arcs to a (real) adjacency matrix.
arcs2amat = function(arcs, nodes) {

  .Call(call_arcs2amat,
        arcs = as.character(arcs),
        nodes = as.character(nodes))

}#ARCS2AMAT

# convert an adjacency matrix back to a set of arcs.
amat2arcs = function(a, nodes) {

  .Call(call_amat2arcs,
        amat = a,
        nodes = nodes)

}#AMAT2ARCS

Try the bnlearn package in your browser

Any scripts or data that you put into this service are public.

bnlearn documentation built on Sept. 8, 2023, 5:46 p.m.