Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 10/31/2024
Public
Document Table of Contents

mkl_sparse_?_export_bsr

Exports BSR matrix from internal representation.

Syntax

sparse_status_t mkl_sparse_s_export_bsr (const sparse_matrix_t source, sparse_index_base_t *indexing, sparse_layout_t *block_layout, MKL_INT *rows, MKL_INT *cols, MKL_INT *block_size, MKL_INT **rows_start, MKL_INT **rows_end, MKL_INT **col_indx, float **values);

sparse_status_t mkl_sparse_d_export_bsr (const sparse_matrix_t source, sparse_index_base_t *indexing, sparse_layout_t *block_layout, MKL_INT *rows, MKL_INT *cols, MKL_INT *block_size, MKL_INT **rows_start, MKL_INT **rows_end, MKL_INT **col_indx, double **values);

sparse_status_t mkl_sparse_c_export_bsr (const sparse_matrix_t source, sparse_index_base_t *indexing, sparse_layout_t *block_layout, MKL_INT *rows, MKL_INT *cols, MKL_INT *block_size, MKL_INT **rows_start, MKL_INT **rows_end, MKL_INT **col_indx, MKL_Complex8 **values);

sparse_status_t mkl_sparse_z_export_bsr (const sparse_matrix_t source, sparse_index_base_t *indexing, sparse_layout_t *block_layout, MKL_INT *rows, MKL_INT *cols, MKL_INT *block_size, MKL_INT **rows_start, MKL_INT **rows_end, MKL_INT **col_indx, MKL_Complex16 **values);

Include Files

  • mkl_spblas.h

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.

If the matrix is not already in BSR format, the routine returns SPARSE_STATUS_INVALID_VALUE.

Input Parameters

source

Handle containing internal data.

Output Parameters

<!-- -->indexing

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

Specifies layout of blocks:

SPARSE_LAYOUT_ROW_MAJOR

Storage of elements of blocks uses row major layout.

SPARSE_LAYOUT_COLUMN_MAJOR

Storage of elements of blocks uses column major layout.

rows

Number of block rows of the matrix source.

cols

Number of block columns of matrix source.

block_size

Size of the square block in matrix source.

rows_start

Pointer to array of length rows. This array contains row indices, such that rows_start[i] - ind is the first index of block row i in the arrays values and col_indx. ind takes 0 for zero-based indexing and 1 for one-based indexing.

Refer to pointerB array description in BSR Format for more details.

rows_end

Pointer to array of length rows. This array contains row indices, such that rows_end[i] - ind - 1 is the last index of block row i in the arrays values and col_indx. ind takes 0 for zero-based indexing and 1 for one-based indexing.

Refer to pointerE array description in BSR Format for more details.

col_indx

For one-based indexing, pointer to array containing the column indices plus one for each non-zero blocks of the matrix source. For zero-based indexing, pointer to array containing the column indices for each non-zero blocks of the matrix source. Its length is rows_end[rows - 1] - ind[0]. ind takes 0 for zero-based indexing and 1 for one-based indexing.

values

Pointer to array containing non-zero elements of matrix source. 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.

Return Values

The function returns a value indicating whether the operation was successful or not, and 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.