replaceName: Replace the names of new prime implicants with old prime...

Description Usage Arguments Value Examples

View source: R/ATEN.R

Description

A helper function for replacing the names of new prime implicants (pis) and old prime implicants

Usage

1
replaceName(newnames, oldnames, allnodes)

Arguments

newnames

A string representing new names of pis

oldnames

A string representing old names of pis

allnodes

The number of nodes in the Boolean network

Value

the correct names of pis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
##old names
pis<-list(3,c(2,4),13)
oldnames<-sapply(pis,function(x){paste0(sort(x),collapse = "&")},simplify="array")
print(oldnames)

##new names "1&3" is expected as a combined string made up by "3&13", and assuming 10 nodes in total, then
newnames<-c("1&3")
print(newnames)#'
replaceName(newnames,oldnames,10)

newnames<-c("2&4")
##expect to be "2&4&13"
replaceName(newnames,oldnames,10)

ningshi/ATEN documentation built on April 27, 2021, 7:40 a.m.