R/getcnt.R

Defines functions `getcnt`

`getcnt` <-
function(nodehk,cnt.edge,edgesize){
    ## to do: perhaps save time by rewriting this function in C
    ## may speed up exact.network algorithm
    out<-rep(NA,sum(edgesize[nodehk]))
    cnt<-1
    for (i in 1:length(nodehk)){
        cnt2<-cnt+edgesize[nodehk[i]]
        out[cnt:(cnt2-1)]<-cnt.edge[nodehk[i]]:(cnt.edge[nodehk[i]+1]-1)
        cnt<-cnt2
    }
    out
}

Try the perm package in your browser

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

perm documentation built on Aug. 25, 2023, 1:07 a.m.