I have a matrix equation of the form $A \times B = C$.
$A$ is an $n \times m$ matrix. $B$ is an $m \times 1$ matrix. $C$ is obviously $n \times 1$.
Here are the constraints:
All values are positive and between 0 and 1 inclusive.
$C$ is given (constant). For $C$, $\sum_{i=1}^{n}c_i = 1$
$B$ is also constant. For $B$, $\sum_{i=1}^{m}b_i = 1$
Each column of $A$ adds up to 1. i.e. $\sum_{i=1}^{n}a_{ij} = 1$
I need to be able to generate all matrices A that fit these constraints. This is obviously an infinite space, so I need to sample from it.
One obvious solution is $\begin{bmatrix}C\ C\ .\ .\ C\end{bmatrix}$ with $m$ columns.
My goal is to eventually find solutions for A that tend towards minimizing $\sum_{j=1}^m\sum_{i=1}^{n}-a_{ij}log_2a_{ij}$
Intuitively, this will lead to each column of A tending towards having a single large value for one of it's rows.
I've been thinking about a slight modification to the problem that might help me solve the original: create matrix $A'$ by multiplying each element $a_{ij}$ in each row of $A$ by it's corresponding multiplicand in $B$, $b_j$. This give us $A'$ with constraints that each of it's columns $A'_j$ sums up to $b_j$. i.e. the first column of $A'$ adds up to the first element of $B$, and so on. Each row in $A'$ will now sum up to the corresponding element in $C$.
Now if we were to sort the rows and columns of $A'$ in decreasing order from top-to-bottom, and left-to-right, and we aimed to maximize the elements in the main diagonal while ensuring the sum constraints on the rows and columns of $A'$ hold... that's a decent start. I think it makes the problem easier.
However, I just came up with a counterexample for this; imagine 3 rows, the top row with total of 0.4, and 10 columns, each totalling 0.1. We would have to start filling $A'$ with four 0.1's in the first row (divide by the column totals to get $A$ back). This is now looking like the start to a viable approach to get an extreme $A'$, which I can then interpolate to...
I solved this using the above mentioned approach last week.
I can explore the general, infinite space by adding noise components.