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