Developer Reference for Intel® oneAPI Math Kernel Library for Fortran
?trsm_batch
Solves a triangular matrix equation for a group of matrices.
Syntax
call strsm_batch(side_array, uplo_array, transa_array, diag_array, m_array, n_array,
alpha_array, a_array, lda_array, b_array, ldb_array, group_count, group_size)
call dtrsm_batch(side_array, uplo_array, transa_array, diag_array, m_array, n_array,
alpha_array, a_array, lda_array, b_array, ldb_array, group_count, group_size)
call ctrsm_batch(side_array, uplo_array, transa_array, diag_array, m_array, n_array,
alpha_array, a_array, lda_array, b_array, ldb_array, group_count, group_size)
call ztrsm_batch(side_array, uplo_array, transa_array, diag_array, m_array, n_array,
alpha_array, a_array, lda_array, b_array, ldb_array, group_count, group_size)
Include Files
mkl.fi
Description
The ?trsm_batch routines solve a series of matrix equations. They are similar to the ?trsm (Solves a triangular matrix equation.) 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.
The operation is defined as
idx = 1
for i = 1..group_count
alpha in alpha_array(i)
for j = 1..group_size(i)
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
CHARACTER*1 . Array of size group_count . For group i , 1 ≤ i ≤ group_count , sidei = side_array(i)[i] specifies whether op(A) appears on the left or right of X in the equation:
if side_{i} = 'L' or 'l' , then op(A)*X = alpha*B ;
if side_{i} = 'R' or 'r' , then X*op(A) = alpha*B .
uplo_array
CHARACTER*1 . Array of size group_count . For group i , 1 ≤ i ≤ group_count , uploi = uplo_array(i)[i] specifies whether the matrix A is upper or lower triangular:
if uplo_{i} = 'L' or ‘l’ , then the matrix is low triangular.
transa_array
CHARACTER*1 . Array of size group_count . For group i , 1 ≤ i ≤ group_count , transai = transa_array(i)[i] specifies the form of op(A) used in the matrix multiplication:
if transa_{i}= 'N' or 'n' , then op(A) = A ;
if transa_{i}= 'T' or 't' ;
if transa_{i}= 'C' or 'c' , then op(A) = conjg(A') .
diag_array
CHARACTER*1 . Array of size group_count . For group i , 1 ≤ i ≤ group_count , diagi = diag_array(i)[i] specifies whether the matrix A is unit triangular:
if diag_{i} = 'U' or ‘u’ then the matrix is unit triangular;
if diag_{i} = 'N' or ‘n’ , then the matrix is not unit triangular.
m_array
INTEGER . Array of size group_count . For group i , 1 ≤ i ≤ group_count , mi = m_array(i)[i] specifies the number of rows of B . The value of mi must be at least zero.
n_array
INTEGER . Array of size group_count . For group i , 1 ≤ i ≤ group_count , ni = n_array(i)[i] specifies the number of columns of B . The value of ni must be at least zero.
- alpha_array
-
REAL for strsm_batch DOUBLE PRECISION for dtrsm_batch COMPLEX for ctrsm_batch DOUBLE COMPLEX for ztrsm_batch
Array of size group_count . For group i , 1 ≤ i ≤ group_count , alpha_array(i)[i] specifies the scalar alphai .
- a_array
-
INTEGER*8 for Intel ® 64 architecture Array, size total_batch_count , of pointers to arrays used to store A matrices.
For group i , 1 ≤ i ≤ group_count , k is mi when side_{i} = 'L' or 'l' and is ni when side = 'R' or 'r' and a is any of the group_size(i)[i] arrays starting with a_array(group_size(1) + group_size(2) + ... + group_size(i - 1) + 1)[group_size[0] + group_size[1] + ... + group_size(i - 1)] :
Before entry with uplo_{i} = 'U' or ‘u’ , the leading 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} = 'L' or ‘l’ 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} = 'U' or ‘u’ , the diagonal elements of a are not referenced either, but are assumed to be unity.
lda_array
INTEGER . Array of size group_count . For group i , 1 ≤ i ≤ group_count , ldai = lda_array(i)[i] specifies the leading dimension of a as declared in the calling (sub)program. When side_{i} = 'L' or 'l' , then ldai must be at least max(1, m_{i}) , when side_{i} = 'R' or 'r' , then ldai must be at least max(1, n_{i}) .
- b_array
-
REAL for strsm_batch DOUBLE PRECISION for dtrsm_batch COMPLEX for ctrsm_batch DOUBLE COMPLEX for ztrsm_batch Array, size total_batch_count , of pointers to arrays used to store B matrices.
For group i , 1 ≤ i ≤ group_count , b is any of the group_size(i)[i] arrays starting with b_array(group_size(1) + group_size(2) + ... + group_size(i - 1) + 1)[group_size[0] + group_size[1] + ... + group_size(i - 1)] :
Before entry, the leading mi -by- ni part of array b must contain the matrix B . For Layout = CblasColMajor : before entry, the leading mi -by- ni part of the array b must contain the matrix B . For Layout = CblasRowMajor : before entry, the leading ni -by- mi part of the array b must contain the matrix B .
ldb_array
INTEGER . Array of size group_count . Specifies the leading dimension of b as declared in the calling (sub)program. ldb must be at least max(1, m) .
INTEGER . Array of size group_count . For group i , 1 ≤ i ≤ group_count , ldbi = ldb_array(i)[i] specifies the leading dimension of b as declared in the calling (sub)program. ldbi must be at least max(1, m_{i}) .
- group_count
-
INTEGER . Specifies the number of groups. Must be at least 0.
- group_size
-
INTEGER . Array of size group_count . The element group_size(i)[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 .
BLAS 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see BLAS 95 Interface Conventions .
Specific details for the routine trsm_batch interface are the following:
- a_array
-
Holds pointers to matrices A of size ( ma , ma ) where ma = m_{i} if side = 'L' , ma = n_{i} otherwise.
- b_array
-
Holds pointers to matrices B of size ( mi , ni ).
- m_array
-
Array indicating the number of rows of matrix C for each group.
- n_array
-
Array indicating the number of columns of matrix B for each group.
- group_size
-
Array indicating the number of matrices for each group. Each element in group_size must be at least zero.
- side_array
-
Array with each element set to either ‘L’ or ‘R’ . The default value is ‘L’ .
- uplo_array
-
Array with each element set to either ‘U’ or ‘L’ . The default value is ‘U’ .
- transa_array
-
Array with each element set to one of ‘N’ , ‘C’ , or ‘T’ . The default value is ‘N’ .
- diag_array
-
Array with each element set to either ‘N’ or ‘U’ . The default value is ‘N’ .
- alpha_array
-
Array of alpha values. The default value is 1.