I am using scipy.linalg.rq()to RQ decompose:
$$
M =
\begin{bmatrix}353.553 & 339.645 & 277.744\\-103.528 & 23.3212 & 459.607\\0.707107 & -0.353553 & 0.612372\end{bmatrix}
$$
and get the results:
$$
R =
\begin{bmatrix}
468.2 & -91.2 & -300.0\\
0 & -427.2 & -200.0\\
0 & 0 & -1.0\end{bmatrix}
$$
$$ Q = \begin{bmatrix}0.41380 & 0.90915 & 0.04708\\ 0.57338 & -0.22011 & -0.78917\\ -0.70711 & 0.35355 & -0.61237 \end{bmatrix} $$
However the result should be:
since the elements on the diagonal of R must be positive in my case.
How can I "flip" signs of R and Q elements in Python using numpy and scipy so that the diagonal elements of R are positive?
