mu.AND <- function(GE, frml=NULL) {
<\dots>
if (is.null(frml)) {
<\dots>
GE <- sq.array(GE)
AND <- GE[,,1]^0
nNA <- AND[,1]*0
for (i in 1:dim(GE)[3]) {
nNA <- nNA + diag(GEi <- GE[,,i])
AND <- AND * (GEi + (1-GEi)*(1-t(GEi))) }
return(as.numeric(AND * ((c(nNA)%o%c(nNA))>0))) } tkn <- unlist(strsplit(frml,""))
nok <- attr(regexpr("[0-9,()]+",frml),"match.length")
<\dots>
tmp <- matrix(0, dim(GE)[1]+1, <\dots>)
FstFree <- function(tmp) match(TRUE, tmp[1,]==0, nomatch=0) level <- i <- 0
while ((i <- i+1) <= 0="" nok)="" {="" switch(="" tkn[i],="" "("="level" <-="" level="" +="" 1,="" ","="next," ")"="{" tmp[1,="" use="" (tmp[1,]="=level)]" tmp[,="" fstfree(tmp)]="" c(level="" level-1,="" mu.and(tmp[-1,="" use]))},="" num="" as.numeric(substring(="" frml,i,i<-i-1+regexpr("[,)]",substring(frml,i+1)))="" <\dots="">
tmp[,FstFree(tmp)] <- c(level, GE[, num]) } ) }
return(tmp[-1,1])
}
=>\dots>\dots>\dots>\dots>