Home | History | Annotate | Download | only in MatrixFunctions

Lines Matching refs:sqrtT

59     void computeDiagonalPartOfSqrt(MatrixType& sqrtT, const MatrixType& T);
60 void computeOffDiagonalPartOfSqrt(MatrixType& sqrtT, const MatrixType& T);
61 void compute2x2diagonalBlock(MatrixType& sqrtT, const MatrixType& T, typename MatrixType::Index i);
62 void compute1x1offDiagonalBlock(MatrixType& sqrtT, const MatrixType& T,
64 void compute1x2offDiagonalBlock(MatrixType& sqrtT, const MatrixType& T,
66 void compute2x1offDiagonalBlock(MatrixType& sqrtT, const MatrixType& T,
68 void compute2x2offDiagonalBlock(MatrixType& sqrtT, const MatrixType& T,
88 MatrixType sqrtT = MatrixType::Zero(m_A.rows(), m_A.rows());
89 computeDiagonalPartOfSqrt(sqrtT, T);
90 computeOffDiagonalPartOfSqrt(sqrtT, T);
93 result = U * sqrtT * U.adjoint();
96 // pre: T is quasi-upper-triangular and sqrtT is a zero matrix of the same size
97 // post: the diagonal blocks of sqrtT are the square roots of the diagonal blocks of T
99 void MatrixSquareRootQuasiTriangular<MatrixType>::computeDiagonalPartOfSqrt(MatrixType& sqrtT,
106 sqrtT.coeffRef(i,i) = internal::sqrt(T.coeff(i,i));
109 compute2x2diagonalBlock(sqrtT, T, i);
115 // pre: T is quasi-upper-triangular and diagonal blocks of sqrtT are square root of diagonal blocks of T.
116 // post: sqrtT is the square root of T.
118 void MatrixSquareRootQuasiTriangular<MatrixType>::computeOffDiagonalPartOfSqrt(MatrixType& sqrtT,
131 compute2x2offDiagonalBlock(sqrtT, T, i, j);
133 compute2x1offDiagonalBlock(sqrtT, T, i, j);
135 compute1x2offDiagonalBlock(sqrtT, T, i, j);
137 compute1x1offDiagonalBlock(sqrtT, T, i, j);
143 // post: sqrtT.block(i,i,2,2) is square root of T.block(i,i,2,2)
146 ::compute2x2diagonalBlock(MatrixType& sqrtT, const MatrixType& T, typename MatrixType::Index i)
152 sqrtT.template block<2,2>(i,i)
157 // all blocks of sqrtT to left of and below (i,j) are correct
158 // post: sqrtT(i,j) has the correct value
161 ::compute1x1offDiagonalBlock(MatrixType& sqrtT, const MatrixType& T,
164 Scalar tmp = (sqrtT.row(i).segment(i+1,j-i-1) * sqrtT.col(j).segment(i+1,j-i-1)).value();
165 sqrtT.coeffRef(i,j) = (T.coeff(i,j) - tmp) / (sqrtT.coeff(i,i) + sqrtT.coeff(j,j));
171 ::compute1x2offDiagonalBlock(MatrixType& sqrtT, const MatrixType& T,
176 rhs -= sqrtT.block(i, i+1, 1, j-i-1) * sqrtT.block(i+1, j, j-i-1, 2);
177 Matrix<Scalar,2,2> A = sqrtT.coeff(i,i) * Matrix<Scalar,2,2>::Identity();
178 A += sqrtT.template block<2,2>(j,j).transpose();
179 sqrtT.template block<1,2>(i,j).transpose() = A.fullPivLu().solve(rhs.transpose());
185 ::compute2x1offDiagonalBlock(MatrixType& sqrtT, const MatrixType& T,
190 rhs -= sqrtT.block(i, i+2, 2, j-i-2) * sqrtT.block(i+2, j, j-i-2, 1);
191 Matrix<Scalar,2,2> A = sqrtT.coeff(j,j) * Matrix<Scalar,2,2>::Identity();
192 A += sqrtT.template block<2,2>(i,i);
193 sqrtT.template block<2,1>(i,j) = A.fullPivLu().solve(rhs);
199 ::compute2x2offDiagonalBlock(MatrixType& sqrtT, const MatrixType& T,
202 Matrix<Scalar,2,2> A = sqrtT.template block<2,2>(i,i);
203 Matrix<Scalar,2,2> B = sqrtT.template block<2,2>(j,j);
206 C -= sqrtT.block(i, i+2, 2, j-i-2) * sqrtT.block(i+2, j, j-i-2, 2);
209 sqrtT.template block<2,2>(i,j) = X;
375 MatrixType sqrtT = MatrixType::Zero(m_A.rows(), m_A.rows());
376 tmp.compute(sqrtT);
379 result = U * sqrtT * U.adjoint();
409 MatrixType sqrtT = MatrixType::Zero(m_A.rows(), m_A.rows());
410 tmp.compute(sqrtT);
413 result = U * sqrtT * U.adjoint();