({{, TRMM[sd,ul,ts,dg,α,a,b] 
computes the multiplication of a triangle matrix a and a full matrix b as α (Subscript[op, ts])[a].b or α b.(Subscript[op, ts])[a] and resets b to the result.}})

OpenersNotesSection(Spacer1)Details

To use TRMM, you first need to load the BLAS Package using (RefLink[Needs, paclet:ref/Needs])["LinearAlgebra`BLAS`"].

The following arguments must be given:

The left/right side string sd may be specified as:

The upper/lower triangular string ul may be specified as:

The transposition strings describe the operators (Subscript[op, ts]) and may be specified as:

The diagonal ones string dg may be specified as:

Dimensions of the matrix arguments must be such that the dot product is well defined.

OpenersPrimaryExamplesSection(Spacer1)Examples  (11)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Load the BLAS package:

Needs["LinearAlgebra`BLAS`"]

Compute (RefLink[UpperTriangularize, paclet:ref/UpperTriangularize])[a].b and save it in b:

b={{1,1},{-2,1}};
a={{1,3},{2,4}};
TRMM["L","U","N","N",1,a,b];
b

OpenersExampleSection1(Spacer1)Scope  (4)

Real matrices:

b={{2.3,1.2,0.1},{3.9,0.3,2.1},{0.2,0.1,-2.5}};
a={{2.1,0,1.4},{3.5,2.4,0.4},{0,2.7,1.3}};
TRMM["L","U","N","N",2.,a,b];
b

Complex matrices:

b={{2.3+3.I,1.2 I},{-3.+2.I,0.3I}};
a={{2.1,1.4 I},{3.5 I,0.4+I}};
TRMM["R","U","N","N",-1.+I,a,b];
b

Arbitrary-precision matrices:

b={{1`20,1},{-2,1}};
a={{1,3},{2,4}};
TRMM["L","U","N","N",1,a,b];
b

Symbolic matrices:

b={{b11,b12},{b21,b22}};
a={{a11,a12},{a21,a22}};
TRMM["R","L","N","U",α,a,b];
b

OpenersExampleSection3(Spacer1)Properties & Relations  (4)

TRMM["L","U","N","N",α,a,b] is equivalent to b=α (RefLink[UpperTriangularize, paclet:ref/UpperTriangularize])[a].b:

b=b1=RandomReal[1,{5,5}];
a=RandomReal[1,{5,5}];
TRMM["L","U","N","N",1,a,b];
b==UpperTriangularize[a].b1

TRMM["L","L","T","N",α,a,b] is equivalent to b=α(RefLink[Transpose, paclet:ref/Transpose])[(RefLink[LowerTriangularize, paclet:ref/LowerTriangularize])[a]].b:

b=bU=bL=RandomReal[1,{5,5}];
a=RandomReal[1,{5,5}];
TRMM["L","L","T","N",1,a,bL];
bL==Transpose[LowerTriangularize[a]].b

Note this is not TRMM["L","U","T","N",α,a,L] as the lower triangular part is used for the transpose:

TRMM["L","U","T","N",1,a,bL];
bL==bU

If dg="U", the diagonal values of a are assumed to be ones:

b={{1,2},{1,2}};
a={{3,3},{2,4}};
TRMM["L","U","N","U",1,a,b];
b

The diagonal in a has been effectively replaced by ones:

{{1,3},{0,1}}.{{1,2},{1,2}}

If a is a rectangular matrix then only the leading upper or lower triangular part of a is used:

b={{1.5,1},{2,2.5}};
a={{3,3,2},{2,4,2}};
TRMM["R","L","N","N",1,a,b];
b

The matrix a is effectively truncated to its upper left corner:

{{1.5,1},{2,2.5}}.{{3,0},{2,4}}

OpenersExampleSection4(Spacer1)Possible Issues  (2)

The last argument must be a symbol:

a={{1,3},{2,4}};
TRMM["L","U","N","N",1,a,{{1,2},{1,2}}]

The last argument must be initialized to a matrix:

Clear[b];
a={{1,3},{2,4}};
TRMM["L","U","N","N",1,a,b]

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Basic Linear Algebra Subroutines, paclet:LowLevelLinearAlgebra/guide/BLASGuide])}})}})