Contents

# cblas_?trsm_batch

Solves a triangular matrix equation for a group of matrices.

## Syntax

Include Files
• mkl.h
Description
The
?trsm_batch
routines solve a series of matrix equations. They are similar to the
?trsm
routines except that they operate on groups of matrices which have the same parameters. The
?trsm_batch
routines process a number of groups at once.
```idx = 0
for i = 0..group_count - 1
alpha in alpha_array[i]
for j = 0..group_size[i] - 1
A and B matrix in a_array[idx] and b_array[idx]
Solve op(A)*X = alpha*B
or
Solve X*op(A) = alpha*B
idx = idx + 1
end for
end for
```
where:
alpha
is a scalar element of
alpha_array
,
X
and
B
are
m
-by-
n
matrices for
m
and
n
which are elements of
m_array
and
n_array
, respectively,
A
is a unit, or non-unit, upper or lower triangular matrix,
and
op(
A
)
is one of
op(
A
) =
A
, or
op(
A
) =
A
T
, or
op(
A
) = conjg(
A
T
)
.
A
and
B
represent matrices stored at addresses pointed to by
a_array
and
b_array
, respectively. There are
total_batch_count
entries in each of
a_array
and
b_array
, where
total_batch_count
is the sum of all the
group_size
entries.
Input Parameters
Layout
Specifies whether two-dimensional array storage is row-major (
CblasRowMajor
) or column-major (
CblasColMajor
).
side_array
Array of size
group_count
. For group
i
,
0
i
group_count
- 1
,
side
i
=
side_array
[
i
]
specifies whether
op(
A
)
appears on the left or right of
X
in the equation:
if
side
i
=
CblasLeft
, then
op(
A
)*
X
=
alpha
*
B
;
if
side
i
=
CblasRight
, then
X
*op(
A
) =
alpha
*
B
.
uplo_array
Array of size
group_count
. For group
i
,
0
i
group_count
- 1
,
uplo
i
=
uplo_array
[
i
]
specifies whether the matrix
A
is upper or lower triangular:
uplo
i
=
CblasUpper
if
uplo
i
=
CblasLower
, then the matrix is low triangular.
transa_array
Array of size
group_count
. For group
i
,
0
i
group_count
- 1
,
transa
i
=
transa_array
[
i
]
specifies the form of
op(
A
)
used in the matrix multiplication:
if
transa
i
=
CblasNoTrans
, then
op(
A
) =
A
;
if
transa
i
=
CblasTrans
;
if
transa
i
=
CblasConjTrans
, then
op(
A
) = conjg(
A
')
.
diag_array
Array of size
group_count
. For group
i
,
0
i
group_count
- 1
,
diag
i
=
diag_array
[
i
]
specifies whether the matrix
A
is unit triangular:
if
diag
i
=
CblasUnit
then the matrix is unit triangular;
if
diag
i
=
CblasNonUnit
, then the matrix is not unit triangular.
m_array
Array of size
group_count
. For group
i
,
0
i
group_count
- 1
,
m
i
=
m_array
[
i
]
specifies the number of rows of
B
. The value of
m
i
must be at least zero.
n_array
Array of size
group_count
. For group
i
,
0
i
group_count
- 1
,
n
i
=
n_array
[
i
]
specifies the number of columns of
B
. The value of
n
i
must be at least zero.
alpha_array
Array of size
group_count
. For group
i
,
0
i
group_count
- 1
,
alpha_array
[
i
]
specifies the scalar
alpha
i
.
a_array
Array, size
total_batch_count
, of pointers to arrays used to store
A
matrices.
For group
i
,
0
i
group_count
- 1
,
k
is
m
i
when
side
i
=
CblasLeft
and is
n
i
when
side
i
=
CblasRight
and
a
is any of the
group_size
[
i
]
arrays starting with
a_array
[
group_size
[0] +
group_size
[1] + ... +
group_size
(
i
- 1)]
:
Before entry with
uplo
i
=
CblasUpper
k
by
k
upper triangular part of the array
a
must contain the upper triangular matrix and the strictly lower triangular part of
a
is not referenced.
Before entry with
uplo
i
=
CblasLower
lower triangular part of the array
a
must contain the lower triangular matrix and the strictly upper triangular part of
a
is not referenced.
When
diag
i
=
CblasUnit
, the diagonal elements of
a
are not referenced either, but are assumed to be unity.
lda_array
Array of size
group_count
. For group
i
,
0
i
group_count
- 1
,
lda
i
=
lda_array
[
i
]
a
as declared in the calling (sub)program. When
side
i
=
CblasLeft
, then
lda
i
must be at least
max(1,
m
i
)
, when
side
i
=
CblasRight
, then
lda
i
must be at least
max(1,
n
i
)
.
b_array
Array, size
total_batch_count
, of pointers to arrays used to store
B
matrices.
For group
i
,
0
i
group_count
- 1
,
b
is any of the
group_size
[
i
]
arrays starting with
b_array
[
group_size
[0] +
group_size
[1] + ... +
group_size
(
i
- 1)]
:
For
Layout
=
CblasColMajor
m
i
-by-
n
i
part of the array
b
must contain the matrix
B
.
For
Layout
=
CblasRowMajor
n
i
-by-
m
i
part of the array
b
must contain the matrix
B
.
ldb_array
Array of size
group_count
. Specifies the leading dimension of
b
as declared in the calling (sub)program.
When
Layout
=
CblasColMajor
,
ldb
must be at least
max(1,
m
)
; otherwise,
ldb
must be at least
max(1,
n
)
.
Array of size
group_count
. For group
i
,
0
i
group_count
- 1
,
ldb
i
=
ldb_array
[
i
]
b
as declared in the calling (sub)program.
When
Layout
=
CblasColMajor
,
ldb
i
must be at least
max(1,
m
i
)
; otherwise,
ldb
i
must be at least
max(1,
n
i
)
.
group_count
Specifies the number of groups. Must be at least 0.
group_size
Array of size
group_count
. The element
group_size
[
i
]
specifies the number of matrices in group
i
. Each element in
group_size
must be at least 0.
Output Parameters
b_array
Overwritten by the solution matrix
X
.