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 are symmetric matrices. They holdwhere Bu and Cu withB = Bu + Bl and C = Cu + Cl,
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 trinagle of E'.The calculation employs the BLAS functions dtrmm and dgemm.
Note, that only the upper trinagle is calculated. The complete solution could be achieved by the command
In contrast to function symMatMul this function is implemented in C-codeX := symmetric(X)
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:,:] | A | ||
| Real[size(A, 2),size(A, 2)] | B | ||
| Real[size(A, 1),size(A, 1)] | C | ||
| Boolean | add | true | Value is true if a==1, false if a==0 |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[size(A, 1),size(A, 1)] | M | C |
Revisions
| Date | Author | Comment |
|---|---|---|
| 2010-05-31 | Marcus Baur, DLR-RM | Realization |