Having 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) I want 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 want 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$)
Any deterministic (polynomial in time) way to result