SpM Handbook 1.3.0
Loading...
Searching...
No Matches
Spm_dev_zeros

Subroutines to detect diagonal zeros. More...

Files

file  s_spm_get_diagonal_zeros.c
file  d_spm_get_diagonal_zeros.c
file  c_spm_get_diagonal_zeros.c
file  z_spm_get_diagonal_zeros.c
int z_spmGetDiagonalZeros (const spmatrix_t *spm, spm_int_t *zeros_n, spm_int_t **zeros_list)
 Detect unknowns with a zero or missing diagonal entry.
static int z_spm_get_diagonal_zeros_csx (const spmatrix_t *spm, spm_int_t *zeros_n, spm_int_t **zeros_list)
 Scan a CSC or CSR matrix for zero or missing diagonal entries.
int c_spmGetDiagonalZeros (const spmatrix_t *spm, spm_int_t *zeros_n, spm_int_t **zeros_list)
 Detect unknowns with a zero or missing diagonal entry.
static int c_spm_get_diagonal_zeros_csx (const spmatrix_t *spm, spm_int_t *zeros_n, spm_int_t **zeros_list)
 Scan a CSC or CSR matrix for zero or missing diagonal entries.
int d_spmGetDiagonalZeros (const spmatrix_t *spm, spm_int_t *zeros_n, spm_int_t **zeros_list)
 Detect unknowns with a zero or missing diagonal entry.
static int d_spm_get_diagonal_zeros_csx (const spmatrix_t *spm, spm_int_t *zeros_n, spm_int_t **zeros_list)
 Scan a CSC or CSR matrix for zero or missing diagonal entries.
int s_spmGetDiagonalZeros (const spmatrix_t *spm, spm_int_t *zeros_n, spm_int_t **zeros_list)
 Detect unknowns with a zero or missing diagonal entry.
static int s_spm_get_diagonal_zeros_csx (const spmatrix_t *spm, spm_int_t *zeros_n, spm_int_t **zeros_list)
 Scan a CSC or CSR matrix for zero or missing diagonal entries.

Detailed Description

Subroutines to detect diagonal zeros.

Function Documentation

◆ z_spmGetDiagonalZeros()

int z_spmGetDiagonalZeros ( const spmatrix_t * spm,
spm_int_t * zeros_n,
spm_int_t ** zeros_list )

Detect unknowns with a zero or missing diagonal entry.

Parameters
[in]spmThe sparse matrix, in SpmCSC or SpmCSR format.
[out]zeros_nOn exit, the number of unknowns whose diagonal entry is zero or absent.
[out]zeros_listOn exit, pointer to an array containing the baseval-indexed indices of the affected unknowns. Set to NULL when zeros_n is 0 or when the function fails. The caller is responsible for freeing this array.
Return values
SPM_SUCCESSOn success.
SPM_ERR_BADPARAMETERIf spm->fmttype is neither SpmCSC nor SpmCSR.
SPM_ERR_OUTOFMEMORYIf the allocation of zeros_list failed.

Definition at line 151 of file z_spm_get_diagonal_zeros.c.

References spmatrix_s::fmttype, spmatrix_s::n, SPM_ERR_BADPARAMETER, SPM_ERR_NOTIMPLEMENTED, SPM_ERR_OUTOFMEMORY, spm_imax(), SPM_SUCCESS, SpmCSC, SpmCSR, SpmIJV, and z_spm_get_diagonal_zeros_csx().

Referenced by spmGetDiagonalZeros().

◆ c_spmGetDiagonalZeros()

int c_spmGetDiagonalZeros ( const spmatrix_t * spm,
spm_int_t * zeros_n,
spm_int_t ** zeros_list )

Detect unknowns with a zero or missing diagonal entry.

Parameters
[in]spmThe sparse matrix, in SpmCSC or SpmCSR format.
[out]zeros_nOn exit, the number of unknowns whose diagonal entry is zero or absent.
[out]zeros_listOn exit, pointer to an array containing the baseval-indexed indices of the affected unknowns. Set to NULL when zeros_n is 0 or when the function fails. The caller is responsible for freeing this array.
Return values
SPM_SUCCESSOn success.
SPM_ERR_BADPARAMETERIf spm->fmttype is neither SpmCSC nor SpmCSR.
SPM_ERR_OUTOFMEMORYIf the allocation of zeros_list failed.

Definition at line 151 of file c_spm_get_diagonal_zeros.c.

References c_spm_get_diagonal_zeros_csx(), spmatrix_s::fmttype, spmatrix_s::n, SPM_ERR_BADPARAMETER, SPM_ERR_NOTIMPLEMENTED, SPM_ERR_OUTOFMEMORY, spm_imax(), SPM_SUCCESS, SpmCSC, SpmCSR, and SpmIJV.

Referenced by spmGetDiagonalZeros().

◆ d_spmGetDiagonalZeros()

int d_spmGetDiagonalZeros ( const spmatrix_t * spm,
spm_int_t * zeros_n,
spm_int_t ** zeros_list )

Detect unknowns with a zero or missing diagonal entry.

Parameters
[in]spmThe sparse matrix, in SpmCSC or SpmCSR format.
[out]zeros_nOn exit, the number of unknowns whose diagonal entry is zero or absent.
[out]zeros_listOn exit, pointer to an array containing the baseval-indexed indices of the affected unknowns. Set to NULL when zeros_n is 0 or when the function fails. The caller is responsible for freeing this array.
Return values
SPM_SUCCESSOn success.
SPM_ERR_BADPARAMETERIf spm->fmttype is neither SpmCSC nor SpmCSR.
SPM_ERR_OUTOFMEMORYIf the allocation of zeros_list failed.

Definition at line 151 of file d_spm_get_diagonal_zeros.c.

References d_spm_get_diagonal_zeros_csx(), spmatrix_s::fmttype, spmatrix_s::n, SPM_ERR_BADPARAMETER, SPM_ERR_NOTIMPLEMENTED, SPM_ERR_OUTOFMEMORY, spm_imax(), SPM_SUCCESS, SpmCSC, SpmCSR, and SpmIJV.

Referenced by spmGetDiagonalZeros().

◆ s_spmGetDiagonalZeros()

int s_spmGetDiagonalZeros ( const spmatrix_t * spm,
spm_int_t * zeros_n,
spm_int_t ** zeros_list )

Detect unknowns with a zero or missing diagonal entry.

Parameters
[in]spmThe sparse matrix, in SpmCSC or SpmCSR format.
[out]zeros_nOn exit, the number of unknowns whose diagonal entry is zero or absent.
[out]zeros_listOn exit, pointer to an array containing the baseval-indexed indices of the affected unknowns. Set to NULL when zeros_n is 0 or when the function fails. The caller is responsible for freeing this array.
Return values
SPM_SUCCESSOn success.
SPM_ERR_BADPARAMETERIf spm->fmttype is neither SpmCSC nor SpmCSR.
SPM_ERR_OUTOFMEMORYIf the allocation of zeros_list failed.

Definition at line 151 of file s_spm_get_diagonal_zeros.c.

References spmatrix_s::fmttype, spmatrix_s::n, s_spm_get_diagonal_zeros_csx(), SPM_ERR_BADPARAMETER, SPM_ERR_NOTIMPLEMENTED, SPM_ERR_OUTOFMEMORY, spm_imax(), SPM_SUCCESS, SpmCSC, SpmCSR, and SpmIJV.

Referenced by spmGetDiagonalZeros().

◆ s_spm_get_diagonal_zeros_csx()

int s_spm_get_diagonal_zeros_csx ( const spmatrix_t * spm,
spm_int_t * zeros_n,
spm_int_t ** zeros_list )
static

Scan a CSC or CSR matrix for zero or missing diagonal entries.

Parameters
[in]spmThe sparse matrix, in SpmCSC or SpmCSR format.
[in,out]zeros_nOn entry, the capacity of zeros_list. On exit, the number of zero or missing diagonal entries.
[in,out]zeros_listOn entry, a pre-allocated array of size *zeros_n. On exit, the first *zeros_n entries contain the indices of the zero or missing diagonal entries. The array may be reallocated.
Return values
SPM_SUCCESSOn success.
SPM_ERR_OUTOFMEMORYIf zeros_list could not be enlarged.

Definition at line 55 of file s_spm_get_diagonal_zeros.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::n, spmatrix_s::rowptr, SPM_ERR_OUTOFMEMORY, spm_imin(), SPM_SUCCESS, SpmCSC, SpmCSR, spmFindBase(), and spmatrix_s::values.

Referenced by s_spmGetDiagonalZeros().

◆ d_spm_get_diagonal_zeros_csx()

int d_spm_get_diagonal_zeros_csx ( const spmatrix_t * spm,
spm_int_t * zeros_n,
spm_int_t ** zeros_list )
static

Scan a CSC or CSR matrix for zero or missing diagonal entries.

Parameters
[in]spmThe sparse matrix, in SpmCSC or SpmCSR format.
[in,out]zeros_nOn entry, the capacity of zeros_list. On exit, the number of zero or missing diagonal entries.
[in,out]zeros_listOn entry, a pre-allocated array of size *zeros_n. On exit, the first *zeros_n entries contain the indices of the zero or missing diagonal entries. The array may be reallocated.
Return values
SPM_SUCCESSOn success.
SPM_ERR_OUTOFMEMORYIf zeros_list could not be enlarged.

Definition at line 55 of file d_spm_get_diagonal_zeros.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::n, spmatrix_s::rowptr, SPM_ERR_OUTOFMEMORY, spm_imin(), SPM_SUCCESS, SpmCSC, SpmCSR, spmFindBase(), and spmatrix_s::values.

Referenced by d_spmGetDiagonalZeros().

◆ c_spm_get_diagonal_zeros_csx()

int c_spm_get_diagonal_zeros_csx ( const spmatrix_t * spm,
spm_int_t * zeros_n,
spm_int_t ** zeros_list )
static

Scan a CSC or CSR matrix for zero or missing diagonal entries.

Parameters
[in]spmThe sparse matrix, in SpmCSC or SpmCSR format.
[in,out]zeros_nOn entry, the capacity of zeros_list. On exit, the number of zero or missing diagonal entries.
[in,out]zeros_listOn entry, a pre-allocated array of size *zeros_n. On exit, the first *zeros_n entries contain the indices of the zero or missing diagonal entries. The array may be reallocated.
Return values
SPM_SUCCESSOn success.
SPM_ERR_OUTOFMEMORYIf zeros_list could not be enlarged.

Definition at line 55 of file c_spm_get_diagonal_zeros.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::n, spmatrix_s::rowptr, SPM_ERR_OUTOFMEMORY, spm_imin(), SPM_SUCCESS, SpmCSC, SpmCSR, spmFindBase(), and spmatrix_s::values.

Referenced by c_spmGetDiagonalZeros().

◆ z_spm_get_diagonal_zeros_csx()

int z_spm_get_diagonal_zeros_csx ( const spmatrix_t * spm,
spm_int_t * zeros_n,
spm_int_t ** zeros_list )
static

Scan a CSC or CSR matrix for zero or missing diagonal entries.

Parameters
[in]spmThe sparse matrix, in SpmCSC or SpmCSR format.
[in,out]zeros_nOn entry, the capacity of zeros_list. On exit, the number of zero or missing diagonal entries.
[in,out]zeros_listOn entry, a pre-allocated array of size *zeros_n. On exit, the first *zeros_n entries contain the indices of the zero or missing diagonal entries. The array may be reallocated.
Return values
SPM_SUCCESSOn success.
SPM_ERR_OUTOFMEMORYIf zeros_list could not be enlarged.

Definition at line 55 of file z_spm_get_diagonal_zeros.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::n, spmatrix_s::rowptr, SPM_ERR_OUTOFMEMORY, spm_imin(), SPM_SUCCESS, SpmCSC, SpmCSR, spmFindBase(), and spmatrix_s::values.

Referenced by z_spmGetDiagonalZeros().