QCA (version 1.1-3)

getRow: Get Specific Rows from Configuration and Implicant Matrices

Description

This function transforms the decimal representation of a row number into its corresponding combination of values in configuration matrices or into its corresponding combination of condition index values in implicant matrices.

Usage

getRow(noflevels, row.no, zerobased = FALSE)

Arguments

noflevels
A vector containing the number of levels (values) for each variable.
row.no
A vector, the desired row numbers.
zerobased
Logical, the first row number is zero.

Value

  • A matrix with the combination of values / condition index values corresponding to the respective row number(s).

Details

Configuration matrices contain all unique and complete intersections that can be formed from all values of $k$ variables. The total number of configurations $d$ is given by $d = \prod_{j = 1}^{k}{p_{j}}$, where $p_{j}$ is the number of values for condition variable $j$ and $k$ is the total number of condition variables. A configuration matrix is an essential part of a truth table. An implicant matrix consists of all truth table configurations and their supersets, including the empty set (Dusa 2007, 2010). The number of implicants $q$ is given by $q = \prod_{j = 1}^{k}{(p_{j} + 1)}$. The function getRow() transforms the decimal representation of a row number from a configuration matrix into its corresponding combination of values or from an implicant matrix into its corresponding combination of condition index values.

References

Dusa, Adrian. 2007. Enhancing Quine-McCluskey. COMPASSS: WP 2007-49. Available from: http://www.compasss.org/wpseries/Dusa2007b.pdf. Dusa, Adrian. 2010. A Mathematical Approach to the Boolean Minimization Problem. Quality & Quantity 44 (1):99-113.

See Also

createMatrix, expand.grid

Examples

Run this code
# all three variables have two values
x <- c(2, 2, 2)

# rows from the configuration matrix
# 1 1 1
getRow(noflevels = x, row.no = 8)

# 0 0 0
getRow(noflevels = x, row.no = 0, zerobased = TRUE)

# same as above 
getRow(noflevels = x, row.no = 1)

# second variable has three values: 0, 1 and 2
x <- c(2, 3, 2)

# 1 2 0
getRow(noflevels = x, row.no = 11)

# the empty set in the implicant matrix 
getRow(noflevels = x, 1) - 1

Run the code above in your browser using DataLab