SpM Handbook 1.2.4
Loading...
Searching...
No Matches
Spm_dev_check

Extra routines. More...

Files

file  spm_update_compute_fields.c
 

Functions

void s_spmSort (spmatrix_t *spm)
 This routine sorts the spm matrix.
 
spm_int_t s_spmMergeDuplicate (spmatrix_t *spm)
 This routine merge the multiple entries in a sparse matrix by summing their values together.
 
void d_spmSort (spmatrix_t *spm)
 This routine sorts the spm matrix.
 
spm_int_t d_spmMergeDuplicate (spmatrix_t *spm)
 This routine merge the multiple entries in a sparse matrix by summing their values together.
 
void c_spmSort (spmatrix_t *spm)
 This routine sorts the spm matrix.
 
spm_int_t c_spmMergeDuplicate (spmatrix_t *spm)
 This routine merge the multiple entries in a sparse matrix by summing their values together.
 
void z_spmSort (spmatrix_t *spm)
 This routine sorts the spm matrix.
 
spm_int_t z_spmMergeDuplicate (spmatrix_t *spm)
 This routine merge the multiple entries in a sparse matrix by summing their values together.
 
void p_spmSort (spmatrix_t *spm)
 This routine sorts the spm matrix.
 
spm_int_t p_spmMergeDuplicate (spmatrix_t *spm)
 This routine merge the multiple entries in a sparse matrix by summing their values together.
 
static void d_spmSortNoDof (spmatrix_t *spm)
 This routine sorts the single dof spm matrix.
 
static void d_spmSortMultidof (spmatrix_t *spm)
 This routine sorts the multiple dof spm matrix.
 
static void c_spmSortNoDof (spmatrix_t *spm)
 This routine sorts the single dof spm matrix.
 
static void c_spmSortMultidof (spmatrix_t *spm)
 This routine sorts the multiple dof spm matrix.
 
static void p_spmSortNoDof (spmatrix_t *spm)
 This routine sorts the single dof spm matrix.
 
static void p_spmSortMultidof (spmatrix_t *spm)
 This routine sorts the multiple dof spm matrix.
 
static void s_spmSortNoDof (spmatrix_t *spm)
 This routine sorts the single dof spm matrix.
 
static void s_spmSortMultidof (spmatrix_t *spm)
 This routine sorts the multiple dof spm matrix.
 
static void z_spmSortNoDof (spmatrix_t *spm)
 This routine sorts the single dof spm matrix.
 
static void z_spmSortMultidof (spmatrix_t *spm)
 This routine sorts the multiple dof spm matrix.
 
spm_int_tspm_get_value_idx_by_col (const spmatrix_t *spm)
 Create an array that represents the shift for each sub-element of the original multidof value array.
 
spm_int_tspm_get_value_idx_by_elt (const spmatrix_t *spm)
 Create an array that represents the shift for each sub-element of the original multidof value array.
 

Detailed Description

Extra routines.

Function Documentation

◆ s_spmSort()

void s_spmSort ( spmatrix_t spm)

This routine sorts the spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are storted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 303 of file s_spm_sort.c.

References spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::rowptr, s_spmSortMultidof(), s_spmSortNoDof(), spm_get_distribution(), spm_getandset_glob2loc(), SpmDistByRow, SpmIJV, and SpmPattern.

Referenced by s_spmConvertIJV2CSC(), and spmSort().

◆ s_spmMergeDuplicate()

spm_int_t s_spmMergeDuplicate ( spmatrix_t spm)

This routine merge the multiple entries in a sparse matrix by summing their values together.

The sparse matrix needs to be sorted first (see s_spmSort()). In distributed, only local entries are merged together.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the reducton of the input sparse matrix where multiple occurences of a same element are summed up together.
Returns
The number of vertices that were merged. -1 on error.

Definition at line 46 of file s_spm_mergeduplicate.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::nnzexp, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_ERR_BADPARAMETER, SpmCSC, SpmCSR, and spmatrix_s::values.

Referenced by spmMergeDuplicate().

◆ d_spmSort()

void d_spmSort ( spmatrix_t spm)

This routine sorts the spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are storted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 303 of file d_spm_sort.c.

References spmatrix_s::colptr, d_spmSortMultidof(), d_spmSortNoDof(), spmatrix_s::dof, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::rowptr, spm_get_distribution(), spm_getandset_glob2loc(), SpmDistByRow, SpmIJV, and SpmPattern.

Referenced by d_spmConvertIJV2CSC(), and spmSort().

◆ d_spmMergeDuplicate()

spm_int_t d_spmMergeDuplicate ( spmatrix_t spm)

This routine merge the multiple entries in a sparse matrix by summing their values together.

The sparse matrix needs to be sorted first (see d_spmSort()). In distributed, only local entries are merged together.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the reducton of the input sparse matrix where multiple occurences of a same element are summed up together.
Returns
The number of vertices that were merged. -1 on error.

Definition at line 46 of file d_spm_mergeduplicate.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::nnzexp, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_ERR_BADPARAMETER, SpmCSC, SpmCSR, and spmatrix_s::values.

Referenced by spmMergeDuplicate().

◆ c_spmSort()

void c_spmSort ( spmatrix_t spm)

This routine sorts the spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are storted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 303 of file c_spm_sort.c.

References c_spmSortMultidof(), c_spmSortNoDof(), spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::rowptr, spm_get_distribution(), spm_getandset_glob2loc(), SpmDistByRow, SpmIJV, and SpmPattern.

Referenced by c_spmConvertIJV2CSC(), and spmSort().

◆ c_spmMergeDuplicate()

spm_int_t c_spmMergeDuplicate ( spmatrix_t spm)

This routine merge the multiple entries in a sparse matrix by summing their values together.

The sparse matrix needs to be sorted first (see c_spmSort()). In distributed, only local entries are merged together.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the reducton of the input sparse matrix where multiple occurences of a same element are summed up together.
Returns
The number of vertices that were merged. -1 on error.

Definition at line 46 of file c_spm_mergeduplicate.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::nnzexp, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_ERR_BADPARAMETER, SpmCSC, SpmCSR, and spmatrix_s::values.

Referenced by spmMergeDuplicate().

◆ z_spmSort()

void z_spmSort ( spmatrix_t spm)

This routine sorts the spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are storted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 303 of file z_spm_sort.c.

References spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::rowptr, spm_get_distribution(), spm_getandset_glob2loc(), SpmDistByRow, SpmIJV, SpmPattern, z_spmSortMultidof(), and z_spmSortNoDof().

Referenced by spmSort(), and z_spmConvertIJV2CSC().

◆ z_spmMergeDuplicate()

spm_int_t z_spmMergeDuplicate ( spmatrix_t spm)

This routine merge the multiple entries in a sparse matrix by summing their values together.

The sparse matrix needs to be sorted first (see z_spmSort()). In distributed, only local entries are merged together.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the reducton of the input sparse matrix where multiple occurences of a same element are summed up together.
Returns
The number of vertices that were merged. -1 on error.

Definition at line 46 of file z_spm_mergeduplicate.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::nnzexp, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_ERR_BADPARAMETER, SpmCSC, SpmCSR, and spmatrix_s::values.

Referenced by spmMergeDuplicate().

◆ p_spmSort()

void p_spmSort ( spmatrix_t spm)

This routine sorts the spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are storted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 303 of file p_spm_sort.c.

References spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::flttype, spmatrix_s::fmttype, p_spmSortMultidof(), p_spmSortNoDof(), spmatrix_s::rowptr, spm_get_distribution(), spm_getandset_glob2loc(), SpmDistByRow, SpmIJV, and SpmPattern.

Referenced by p_spmConvertIJV2CSC(), and spmSort().

◆ p_spmMergeDuplicate()

spm_int_t p_spmMergeDuplicate ( spmatrix_t spm)

This routine merge the multiple entries in a sparse matrix by summing their values together.

The sparse matrix needs to be sorted first (see p_spmSort()). In distributed, only local entries are merged together.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the reducton of the input sparse matrix where multiple occurences of a same element are summed up together.
Returns
The number of vertices that were merged. -1 on error.

Definition at line 46 of file p_spm_mergeduplicate.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::nnzexp, spmatrix_s::replicated, spmatrix_s::rowptr, SPM_ERR_BADPARAMETER, SpmCSC, SpmCSR, and spmatrix_s::values.

Referenced by spmMergeDuplicate().

◆ d_spmSortNoDof()

static void d_spmSortNoDof ( spmatrix_t spm)
static

This routine sorts the single dof spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are storted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine.

Warning
This function should NOT be called if dof is greater than 1.
Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 44 of file d_spm_sort.c.

References spmatrix_s::colptr, d_spmIntFltSortAsc(), d_spmIntIntFltSortAsc(), spmatrix_s::fmttype, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::rowptr, SpmCSC, SpmCSR, SpmIJV, and spmatrix_s::values.

Referenced by d_spmSort().

◆ d_spmSortMultidof()

static void d_spmSortMultidof ( spmatrix_t spm)
static

This routine sorts the multiple dof spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are sorted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine. This routine is used for multidof matrices. It's way less efficient than the single dof one.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 237 of file d_spm_sort.c.

References d_spm_sort_multidof_csx_values(), d_spm_sort_multidof_ijv_values(), spmatrix_s::dof, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::nnzexp, spm_get_value_idx_by_elt(), SpmIJV, spmSort(), and spmatrix_s::values.

Referenced by d_spmSort().

◆ c_spmSortNoDof()

static void c_spmSortNoDof ( spmatrix_t spm)
static

This routine sorts the single dof spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are storted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine.

Warning
This function should NOT be called if dof is greater than 1.
Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 44 of file c_spm_sort.c.

References c_spmIntFltSortAsc(), c_spmIntIntFltSortAsc(), spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::rowptr, SpmCSC, SpmCSR, SpmIJV, and spmatrix_s::values.

Referenced by c_spmSort().

◆ c_spmSortMultidof()

static void c_spmSortMultidof ( spmatrix_t spm)
static

This routine sorts the multiple dof spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are sorted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine. This routine is used for multidof matrices. It's way less efficient than the single dof one.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 237 of file c_spm_sort.c.

References c_spm_sort_multidof_csx_values(), c_spm_sort_multidof_ijv_values(), spmatrix_s::dof, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::nnzexp, spm_get_value_idx_by_elt(), SpmIJV, spmSort(), and spmatrix_s::values.

Referenced by c_spmSort().

◆ p_spmSortNoDof()

static void p_spmSortNoDof ( spmatrix_t spm)
static

This routine sorts the single dof spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are storted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine.

Warning
This function should NOT be called if dof is greater than 1.
Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 44 of file p_spm_sort.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::rowptr, SpmCSC, SpmCSR, SpmIJV, and spmatrix_s::values.

Referenced by p_spmSort().

◆ p_spmSortMultidof()

static void p_spmSortMultidof ( spmatrix_t spm)
static

This routine sorts the multiple dof spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are sorted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine. This routine is used for multidof matrices. It's way less efficient than the single dof one.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 237 of file p_spm_sort.c.

References spmatrix_s::dof, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::nnzexp, p_spm_sort_multidof_csx_values(), p_spm_sort_multidof_ijv_values(), spm_get_value_idx_by_elt(), SpmIJV, spmSort(), and spmatrix_s::values.

Referenced by p_spmSort().

◆ s_spmSortNoDof()

static void s_spmSortNoDof ( spmatrix_t spm)
static

This routine sorts the single dof spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are storted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine.

Warning
This function should NOT be called if dof is greater than 1.
Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 44 of file s_spm_sort.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::rowptr, s_spmIntFltSortAsc(), s_spmIntIntFltSortAsc(), SpmCSC, SpmCSR, SpmIJV, and spmatrix_s::values.

Referenced by s_spmSort().

◆ s_spmSortMultidof()

static void s_spmSortMultidof ( spmatrix_t spm)
static

This routine sorts the multiple dof spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are sorted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine. This routine is used for multidof matrices. It's way less efficient than the single dof one.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 237 of file s_spm_sort.c.

References spmatrix_s::dof, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::nnzexp, s_spm_sort_multidof_csx_values(), s_spm_sort_multidof_ijv_values(), spm_get_value_idx_by_elt(), SpmIJV, spmSort(), and spmatrix_s::values.

Referenced by s_spmSort().

◆ z_spmSortNoDof()

static void z_spmSortNoDof ( spmatrix_t spm)
static

This routine sorts the single dof spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are storted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine.

Warning
This function should NOT be called if dof is greater than 1.
Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 44 of file z_spm_sort.c.

References spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::rowptr, SpmCSC, SpmCSR, SpmIJV, spmatrix_s::values, z_spmIntFltSortAsc(), and z_spmIntIntFltSortAsc().

Referenced by z_spmSort().

◆ z_spmSortMultidof()

static void z_spmSortMultidof ( spmatrix_t spm)
static

This routine sorts the multiple dof spm matrix.

For the CSC and CSR formats, the subarray of edges for each vertex are sorted. For the IJV format, the edges are sorted first by column indexes, and then by row indexes. To perform a sort first by row, second by column, please swap the colptr and rowptr of the structure before calling the subroutine. This routine is used for multidof matrices. It's way less efficient than the single dof one.

Parameters
[in,out]spmOn entry, the pointer to the sparse matrix structure. On exit, the same sparse matrix with subarrays of edges sorted by ascending order.

Definition at line 237 of file z_spm_sort.c.

References spmatrix_s::dof, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::nnzexp, spm_get_value_idx_by_elt(), SpmIJV, spmSort(), spmatrix_s::values, z_spm_sort_multidof_csx_values(), and z_spm_sort_multidof_ijv_values().

Referenced by z_spmSort().

◆ spm_get_value_idx_by_col()

spm_int_t * spm_get_value_idx_by_col ( const spmatrix_t spm)

Create an array that represents the shift for each sub-element of the original multidof value array.

Parameters
[in]spmThe sparse matrix structure.
Returns
An array of size nnz+1 that stores the indices of each A(i,j) subblock in the spm->values array

Definition at line 2140 of file spm.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnzexp, spmatrix_s::replicated, spmatrix_s::rowptr, SpmCSC, SpmCSR, and SpmIJV.

◆ spm_get_value_idx_by_elt()

spm_int_t * spm_get_value_idx_by_elt ( const spmatrix_t spm)

Create an array that represents the shift for each sub-element of the original multidof value array.

Parameters
[in]spmThe sparse matrix structure.
Returns
An array of size nnz+1 that stores the indices of each A(i,j) subblock in the spm->values array

Definition at line 2211 of file spm.c.

References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::nnzexp, spmatrix_s::replicated, spmatrix_s::rowptr, SpmCSC, SpmCSR, and SpmIJV.

Referenced by c_spmConvertCSR2CSC_gen(), c_spmSortMultidof(), d_spmConvertCSR2CSC_gen(), d_spmSortMultidof(), p_spmConvertCSR2CSC_gen(), p_spmSortMultidof(), s_spmConvertCSR2CSC_gen(), s_spmSortMultidof(), spm_scatter_csx_local_generic(), z_spmConvertCSR2CSC_gen(), and z_spmSortMultidof().