where matrix A with symmetric positiv definite matrix. The calculation is rather efficient since symmetrie and decomposition of positive definite matrices is exploited.X*A = B
Due to symmetrie, Matrix A is uniquely defined by a triangle, i.e. the upper or the lower triangular matrix. It is assumed, that the input to describe A is either a Cholesky factor or part of matrix A itself. This is defined by the user with the boolean inputs isCholesky and upper which is true when A is already Cholesky factor and when A is upper triangular respectively.
Considering the Cholesky decompositionwith lower triangular matrix L the equation above could be rewritten asT A = L*L
which is solved with BLAS function dtrmm applied to a upper triangular matrix and subsequently to a lower triangular matrix.T X*L*L = B
function solveSymRight extends Modelica.Icons.Function; import MatricesMSL = Modelica.Math.Matrices; input Real A[:, size(A, 1)] "Matrix A of X*A = B"; input Real B[:, :] "Matrix B of X*op(A) = B"; input Boolean isCholesky = false "True if the A is already lower Cholesky factor"; input Boolean upper = false "True if A is upper triAngular"; output Real X[size(B, 1), size(B, 2)] = B "Matrix X such that X*A = B"; end solveSymRight;
Date | Author | Comment |
---|---|---|
2010-05-31 | Marcus Baur, DLR-RM | Realization |