Developer Reference for Intel® oneAPI Math Kernel Library for Fortran
mkl_sparse_?_export_bsr
Exports BSR matrix from internal representation. Pointers to internal elements are returned, and no additional memory is allocated.
Syntax
stat = mkl_sparse_s_export_bsr ( source , indexing , block_layout , rows , cols , block_size , &
rows_start , rows_end , col_indx , values )
stat = mkl_sparse_d_export_bsr ( source , indexing , block_layout , rows , cols , block_size , &
rows_start , rows_end , col_indx , values )
stat = mkl_sparse_c_export_bsr ( source , indexing , block_layout , rows , cols , block_size , &
rows_start , rows_end , col_indx , values )
stat = mkl_sparse_z_export_bsr ( source , indexing , block_layout , rows , cols , block_size , &
rows_start , rows_end , col_indx , values )
Include Files
mkl_spblas.f90
Description
If the matrix specified by the source handle is in BSR format, the mkl_sparse_?_export_bsr routine exports an ( block_size * rows )-by-( block_size * cols ) matrix A in BSR format from the internal representation. The routine returns pointers to the internal representation and does not allocate additional memory.
In case the handle had library allocated data arrays, the users should make a copy of the exported arrays if they need to modify them or keep them beyond the lifetime of the source matrix handle, as modifying the exported arrays may lead to undefined behavior in subsequent calls to any sparse BLAS routine that uses the source handle.
If the matrix is not already in BSR format, the routine returns SPARSE_STATUS_INVALID_VALUE.
Input Parameters
source
SPARSE_MATRIX_T .
Handle containing internal data.
Output Parameters
indexing
sparse_index_base_t .
Indicates how input arrays are indexed:
SPARSE_INDEX_BASE_ZERO |
Zero-based (C-style) indexing: indices start at 0. |
SPARSE_INDEX_BASE_ONE |
One-based (Fortran-style) indexing: indices start at 1. |
block_layout
sparse_layout_t .
Specifies layout of blocks:
SPARSE_LAYOUT_COLUMN_MAJOR |
Storage of elements uses column major layout. |
SPARSE_LAYOUT_ROW_MAJOR |
Storage of elements uses row major layout. |
rows
C_INT .
Number of block rows of matrix A .
cols
C_INT .
Number of block columns of matrix A .
block_size
C_INT .
Size of square blocks in matrix A .
rows_start
C_INT .
Array of length \(rows\) for 4-array format and \(rows + 1\) for 3-array format.
This array contains offset indices, such that rows_start(i) - ind is the first index of block row \(i\) in the arrays values and col_indx.
Here, ind takes a value of \(0\) for zero-based indexing and \(1\) for one-based indexing. Refer to pointerB array description in BSR Format for more details.
rows_end
C_INT .
Array of length \(rows\) for 4-array format and potentially empty for 3-array format.
This array contains offset indices, such that rows_end(i) - ind is one past the last index of block row \(i\) in the arrays values and col_indx.
Here, ind takes a value of \(0\) for zero-based indexing and \(1\) for one-based indexing. Refer to pointerE array description in BSR Format for more details.
col_indx
C_INT .
For one-based indexing, array containing the column indices plus one for each non-zero block of the matrix \(A\) . For zero-based indexing, array containing the column indices for each non-zero block of the matrix \(A\).
Its length is at least the number of blocks stored, which can be computed as rows_end(rows - 1) - ind.
Here, ind takes a value of \(0\) for zero-based indexing and \(1\) for one-based indexing.
values
C_FLOAT |
for mkl_sparse_s_export_bsr |
C_DOUBLE |
for mkl_sparse_d_export_bsr |
C_FLOAT_COMPLEX |
for mkl_sparse_c_export_bsr |
C_DOUBLE_COMPLEX |
for mkl_sparse_z_export_bsr |
Array containing stored elements (non-zeros or explicit zeros) of the matrix \(A\) grouped by blocks according the block layout. Its length is equal to length of the col_indx array multiplied by block_size * block_size. Refer to the values array description in BSR Format for more details.
stat
INTEGER
Value indicating whether the operation was successful, and if not, why:
SPARSE_STATUS_SUCCESS |
The operation was successful. |
SPARSE_STATUS_NOT_INITIALIZED |
The routine encountered an empty handle or matrix array. |
SPARSE_STATUS_ALLOC_FAILED |
Internal memory allocation failed. |
SPARSE_STATUS_INVALID_VALUE |
The input parameters contain an invalid value. |
SPARSE_STATUS_EXECUTION_FAILED |
Execution failed. |
SPARSE_STATUS_INTERNAL_ERROR |
An error in algorithm implementation occurred. |
SPARSE_STATUS_NOT_SUPPORTED |
The requested operation is not supported. |
Return Values
See Output Parameter, stat.