If you write a little bit more prettier, you can define a new B matrix as
[itex]
\hat B \hat B^T = \left[\begin{array}{cc}B_1 &B_2\end{array}\right]\left[\begin{array}{cc}\gamma &0\\0 &R^{1}\end{array}\right]\left[\begin{array}{cc}B_1 &B_2\end{array}\right]^T
[/itex]
Now, your [tex]\hat B[/tex] is going to be
[itex]
\hat B = \left[\begin{array}{cc}B_1 &B_2\end{array}\right]\left[\begin{array}{cc}\sqrt{\gamma} &0\\0 &\sqrt{R^{1}}\end{array}\right]
[/itex]
The squareroot of R exist anyway, because you have to choose as such from LQ theory anyway. You can now plug this new B matrix as an argument to your "care" function.
Edit: oops mixed up the minus sign... And another argument bites the dust...
