Suppose we have a $m\times n$ matrix and a sequence of numbers with which to fill the matrix, $\{c_1,c_2 \dots c_k \}$. I like to think of the numbers as colors, hence the notation. How many unique configurations can we produce if we are given that matrices are equivalent when one matrix can be transformed to another via one or more row or column swaps?
As a concrete example consider the case for a $2\times 2$ matrix with the list of numbers $\{ 1, 3\}$. Notice that the numbers must sum to the product of the dimensions of the matrix. Let us say $c_1$ is denoted by $1$ and $c_2$ by $0$. Then we need to fill the matrix with one $1$ and three $0's$
There are four possible configurations:
$$ \left( \begin{array}{cc} 1 & 0 \\ 0 & 0 \end{array} \right) % \left( \begin{array}{cc} 0 & 1 \\ 0 & 0 \end{array} \right) % \left( \begin{array}{cc} 0 & 0 \\ 1 & 0 \end{array} \right) % \left( \begin{array}{cc} 0 & 0 \\ 0 & 1 \end{array} \right) $$
It is clear that all four of these matrices are equivalent, since any one can be transformed to another via one or more row or column swaps. Hence for the problem of a $2\times 2$ matrix with the list of numbers $\{ 1, 3\}$, there is ONE unique configuration we can produce.
As another example consider the case of $2\times 2$ with the list of numbers $\{ 2, 2\}$, again we denote $c_1$ by $1$ and $c_2$ by $0$.
There are six configurations:
$$ \left( \begin{array}{cc} 1 & 1 \\ 0 & 0 \end{array} \right) % \left( \begin{array}{cc} 0 & 0 \\ 1 & 1 \end{array} \right) % \left( \begin{array}{cc} 1 & 0 \\ 1 & 0 \end{array} \right) % \left( \begin{array}{cc} 0 & 1 \\ 0 & 1 \end{array} \right) \left( \begin{array}{cc} 1 & 0 \\ 0 & 1 \end{array} \right) \left( \begin{array}{cc} 0 & 1 \\ 1 & 0 \end{array} \right) $$
Now, the first can be transformed to the second by $R_1 \leftrightarrow R_2$. The third can be transformed to the fourth via $C_1 \leftrightarrow C_2$ and the fifth can become the sixth either via $R_1 \leftrightarrow R_2$ or $C_1 \leftrightarrow C_2$. What we are left with are THREE unique configurations under row and column swaps.
I hope the reader will get the idea of how the problem is presented, but I will be happy to clarify if needed.
I know that for a given $m$, $n$ and $\{ c_1, c_2 \dots, c_k \}$ the total number of possible configurations is:
$$\frac{(m \cdot n)!}{c_1!\cdot c_2! \cdot \dots c_k!}$$
I am however unable to incorporate the the swapping of rows and columns. Any help or advice would be greatly appreciated.