Find all possible vectors that satisfy an inner product Suppose I have three vectors ($\mathbf{v}$, $\mathbf{w}$, $\mathbf{x}$) and a scalar $\alpha$ such that
$$
(\mathbf{x} \circ \mathbf{v})^\top \mathbf{w} = \alpha
$$
which is the inner product between $(\mathbf{x} \circ \mathbf{v})$ and $\mathbf{w}$, with $\circ$ denoting element-wise multiplication.  The vector $\mathbf{w}$ is known and constrained such that $\sum w_i = 1$, the vector $\mathbf{x}$ is known, and the scalar $\alpha$ is known.  I need to find all possible solutions for $\mathbf{v}$ such that the inner product holds.  How do I go about doing this?  Also, once I find that space how do I go about randomly sampling from it?
 A: Since $(x\circ v)^\top w=\sum_ix_iv_iw_i=v^\top(x\circ w)$, the solution set is given by $\dfrac{\alpha x\circ w}{\|x\circ w\|^2}+\{x\circ w\}^\perp$. In other words, if $u$ is any random vector that is orthogonal to $x\circ w$, then $v=\dfrac{\alpha x\circ w}{\|x\circ w\|^2}+u$ is a solution to $(x\circ v)^\top w=\alpha$.
A: For the first part, $v^\top w = \alpha$ describes an affine plane with orthonormal vector $\frac{w}{\|w\|}$ and distance $\frac{\alpha}{\|w\|}$ away from the origin ($x^\top w=\alpha$ with $\|w\|=1$ is called the Hesse normal form. Multiply with $\frac{1}{\|w\|}$ to get there.).
You can compute a parameter form of this affine plane easily.
So now you only have to find all $v$, such that $v\circ x$ is described by the parameter form. Just multiply the parameter form with the "pointwise" inverse $x'$ of $x$ which is $x'_i=\frac{1}{x_i}$.
A: We have $(x \circ v)^T w = v^T (x \circ w)$ where $y = x \circ w$ is given, so the solution set is
$$ \{ v \in \mathbb{R}^n \mid v^T y = a \} \,. $$
I'm not sure you can really simplify it more than that, you have many degrees of freedom. In terms of random sampling, first choose a random non-zero coordinate $y_j$ of $y$. Then generate $n-1$ random numbers $b_i$, define
$$ v_i = b_i $$
for $i \neq j$ and
$$ v_j = \frac{a-\sum_{i \neq j} v_iy_i}{y_j} \,. $$
Then we have
$$ v^T y = \sum_{i \neq j} v_iy_i + (a-\sum_{i \neq j} v_iy_i) = a$$
as required.
