bilinear equation OR diagonal matrix search Dear guys,
I am parametrizing a model and I face an interesting (but tough for me) problem
I have a real square $n \times n$ symmetric matrix $B$ (which consists of 2 square blocks of positive numbers and 2 rectangular blocks of negative numbers) and I need a real diagonal matrix $D$ such that column vector of $n$ $1$'s ("ones(n,1)" in matlab syntax) is an eigenvector of $DBD$.
In other words I need a vector $d$ for which $\sum_{j=1}^n B_{ij} d_i d_j = 1$ for $i=1..n$ ($B_{ij}$ are elements of the same matrix $B$)
Thanks, very much.
Boris
 A: $DBD$ is in effect a re-scaling of the rows and columns of $B$, and you want it to have constant  row-sums. If $B$ were positive, this would be possible by, say, Sinkhorn's theorem.
For $B$ with negative values, this would be much more difficult, but possible in special cases. See this survey by C.R.Johnson & R.Reams for a panorama of the subject:
Scaling of Symmetric Matrices by Positive Diagonal Congruence
http://faculty.plattsburgh.edu/robert.reams/research/sinkhorn.pdf 
P.S.
Do you have more detailed information about the structure of your matrix $B$?
A: As far as I understand, you can multiply your matrix from both sides by the matrix $\left(\matrix{E_p&0\cr 0&-E_r}\right)$ with a suitable sizes of unit matrices in order to obtain a matrix $B'$ with positive entries. Then Sinkhorn's theorem is applicable, as Felix mentioned.
(Surely, this theorem provides TWO diagonal matrices $D_1$, $D_2$ with positive numbers on the diagonal such that $D_1B'D_2$ is doubly stochastic. But, since these matrices are unique up to the scaling, they should coincide up to a scalar factor.)
