Developer Reference for Intel® oneAPI Math Kernel Library for Fortran
mkl_sparse_?_update_values
Changes all or selected matrix values in internal representation.
Syntax
status = mkl_sparse_s_update_values ( A, values, indx, indy, values )
status = mkl_sparse_d_update_values ( A, values, indx, indy, values )
status = mkl_sparse_c_update_values ( A, values, indx, indy, values )
status = mkl_sparse_z_update_values ( A, values, indx, indy, values )
Include Files
mkl_spblas.f90
Description
Use the mkl_sparse_?_update_values routine to change all or selected values of a matrix in the internal representation of the sparse matrix handle.
There are two options for changing values in the matrix:
# To change selected values already in the matrix sparsity structure, you must provide an array values (with new values) and also the corresponding row and column indices for each value via indx and indy arrays as well as the overall number of changed elements nvalues .
So that, for example, to change A(0, 0) to 1 and A(0, 1) to 2, pass the following input parameters: nvalues = 2, indx = {0, 0}, indy = {0, 1} and values = {1, 2}.
# To change all the values in the matrix sparsity structure, provide the values array and explicitly set nvalues to 0 or the actual number of non zero elements. There is no need to supply indx and indy arrays.
Input Parameters
A
SPARSE_MATRIX_T.
Handle containing internal data to be modified.
nvalues
C_INT.
Total number of elements changed.
indx
C_INT.
Row indices for the new values. (These should already exist in the matrix structure)
indy
C_INT.
Column indices for the new values. (These should already exist in the matrix structure)
values
C_FLOAT |
for mkl_sparse_s_update_values |
C_DOUBLE |
for mkl_sparse_d_update_values |
C_FLOAT_COMPLEX |
for mkl_sparse_c_update_values |
C_DOUBLE_COMPLEX |
for mkl_sparse_z_update_values |
New values to be set in the matrix.
Output Parameters
A
SPARSE_MATRIX_T.
Handle containing modified internal data.
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.