functionsymMatMul_C

Calculate the upper triangle of A*B*A'+a*C with B and C symmetric

Extends from Modelica.Icons.Function (Icon for functions).

Information

This function is used to efficiently calculate the matrix X from equation

         T
X = A*B*A + C,

with B and C being symmetric matrices. They hold

B = Bu + Bl   and    C = Cu + Cl,

where Bu and Cu with

       T               T
Bu = Bl   and   Cu = Cl

are upper triangular matrices. Furthermore, the matrices are defined such that i.e.,

        | bij/2  for i = j
bu,ij = |
        | bij   else

and cu,ij respectively.

Finally, X is given by the sum of a upper triangular matrix and its transposes

               T                   T         T                 T              T     T        T
X = A*(Bu+Bl)*A + (Cu+Cl) =  A*Bu*A + A*Bl*A + (Cu+Cl) = A*Bu*A + Cu + (A*Bu*A + Cu) =  E + E

Since, X also has to be symmetric, only the upper triangle of X is computed by calculatiing the upper triangle of matrix E and adding the upper triangle of E'.

The calculation employs the BLAS functions dtrmm and dgemm.

Note, that only the upper triangle is calculated. The complete solution could be achieved by the command

X := symmetric(X)

In contrast to function symMatMul this function is implemented in C-code.

Inputs

TypeNameDefaultDescription
Real[:,:]A
Real[size(A, 2),size(A, 2)]B
Real[size(A, 1),size(A, 1)]C
BooleanaddtrueValue is true if a==1, false if a==0

Outputs

TypeNameDefaultDescription
Real[size(A, 1),size(A, 1)]MC

Revisions

Date Author Comment
2010-05-31 Marcus Baur, DLR-RM Realization