Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

mkl_sparse_?_syprd

Computes the symmetric triple product of a sparse matrix and a dense matrix and stores the result as a dense matrix.

Syntax

sparse_status_t mkl_sparse_s_syprd (const sparse_operation_t op, const sparse_matrix_t A, const float *B, const sparse_layout_t layoutB, const MKL_INT ldb, const float alpha, const float beta, float *C, const sparse_layout_t layoutC, const MKL_INT ldc);

sparse_status_t mkl_sparse_d_syprd (const sparse_operation_t op, const sparse_matrix_t A, const double *B, const sparse_layout_t layoutB, const MKL_INT ldb, const double alpha, const double beta, double *C, const sparse_layout_t layoutC, const MKL_INT ldc);

sparse_status_t mkl_sparse_c_syprd (const sparse_operation_t op, const sparse_matrix_t A, const MKL_Complex8 *B, const sparse_layout_t layoutB, const MKL_INT ldb, const MKL_Complex8 alpha, const MKL_Complex8 beta, MKL_Complex8 *C, const sparse_layout_t layoutC, const MKL_INT ldc);

sparse_status_t mkl_sparse_z_syprd (const sparse_operation_t op, const sparse_matrix_t A, const MKL_Complex16 *B, const sparse_layout_t layoutB, const MKL_INT ldb, const MKL_Complex16 alpha, const MKL_Complex16 beta, MKL_Complex16 *C, const sparse_layout_t layoutC, const MKL_INT ldc);

Include Files

  • mkl_spblas.h

Description

The mkl_sparse_?_syprd routine performs a multiplication of three sparse matrices that results in a symmetric or Hermitian matrix, C.

C:=alpha*A*B*op(A) + beta*C
or
C:=alpha*op(A)*B*A + beta*C
depending on the matrix modifier operation. Here A is a sparse matrix, B and C are dense and symmetric (or Hermitian) matrices.

op is the transpose (real precision) or conjugate transpose (complex precision) operator.

NOTE:

This routine is not supported for sparse matrices in COO or CSC formats. It supports only CSR and BSR formats. In addition, this routine supports only the sorted CSR and sorted BSR formats for the input matrix. If the data is unsorted, call the mkl_sparse_order routine before either mkl_sparse_sypr or mkl_sparse_?_syprd.

Input Parameters

operation

Specifies operation on the input sparse matrix.

SPARSE_OPERATION_NON_TRANSPOSE

Non-transpose case.

C:=alpha*A*B*(AT)+beta*C for real precision.

C:=alpha*A*B*(AH)+beta*C for complex precision.

SPARSE_OPERATION_TRANSPOSE

Transpose case. This is not supported for complex matrices.

C:=alpha*(AT)*B*A +beta*C

SPARSE_OPERATION_CONJUGATE_TRANSPOSE

Conjugate transpose case. This is not supported for real matrices.

C:=alpha*(AH)*B*A+beta*C

A

Handle which contains the sparse matrix A.

B

Input dense matrix. Only the upper triangular part of the matrix is used for computation.

denselayoutB

Structure that describes the storage scheme for the dense matrix.

SPARSE_LAYOUT_COLUMN_MAJOR

Store elements in a column-major layout.

SPARSE_LAYOUT_ROW_MAJOR

Store elements in a row-major layout.

ldb

Leading dimension of matrix B.

alpha

Scalar parameter.

beta

Scalar parameter.

NOTE:

Since the upper triangular part of matrix C is the only portion that is processed, set real values of alpha and beta in the complex case to obtain the Hermitian matrix.

denselayoutC

Structure that describes the storage scheme for the dense matrix.

SPARSE_LAYOUT_COLUMN_MAJOR

Store elements in a column-major layout.

SPARSE_LAYOUT_ROW_MAJOR

Store elements in a row-major layout.

ldc

Leading dimension of matrix C.

Output Parameters

C

Handle which contains the resulting dense matrix. Only the upper-triangular part of the matrix is computed.

Return Values

The function returns a value indicating whether the operation was successful, or the reason why it failed.

SPARSE_STATUS_SUCCESS

The operation was successful.

SPARSE_STATUS_NOT_INITIALIZED

The routine encountered an empty handle or matrix array.

SPARSE_STATUS_ALLOC_FAILED

The internal memory allocation failed.

SPARSE_STATUS_INVALID_VALUE

The input parameters contain an invalid value.

SPARSE_STATUS_EXECUTION_FAILED

The execution failed.

SPARSE_STATUS_INTERNAL_ERROR

An error occurred in the implementation of the algorithm.

SPARSE_STATUS_NOT_SUPPORTED

The requested operation is not supported.