Right. In order to properly manipulate the switches, a course in matrix math is a prerequisiste.
From "the usual source":
" In mathematics, a matrix (plural: matrices) is a rectangular array[1] of numbers, symbols, or expressions, arranged in rows and columns.[2][3] For example, the dimensions of the matrix below are 2 × 3 (read "two by three"), because there are two rows and three columns:
[ 1 9 − 13 20 5 − 6 ] . {\displaystyle {\begin{bmatrix}1&9&-13\\20&5&-6\end{bmatrix}}.} {\displaystyle {\begin{bmatrix}1&9&-13\\20&5&-6\end{bmatrix}}.}
The individual items in an m × n matrix A, often denoted by ai,j, where max i = m and max j = n, are called its elements or entries.[4] Provided that they have the same size (each matrix has the same number of rows and the same number of columns as the other), two matrices can be added or subtracted element by element (see Conformable matrix). The rule for matrix multiplication, however, is that two matrices can be multiplied only when the number of columns in the first equals the number of rows in the second (i.e., the inner dimensions are the same, n for Am,n × Bn,p).
The trick to all this is to simply remember:
"Any matrix can be multiplied element-wise by a scalar from its associated field. "
And that's how GAD keeps track.