56 for (i=0; i<n; i++, colptr++)
58 size = colptr[1] - colptr[0];
60#if defined(PRECISION_p)
61 spmIntSort1Asc1( rowptr, size );
65 p_spmIntFltSortAsc( sortptr, size );
72 for (i=0; i<n; i++, rowptr++)
74 size = rowptr[1] - rowptr[0];
76#if defined(PRECISION_p)
77 spmIntSort1Asc1( colptr, size );
81 p_spmIntFltSortAsc( sortptr, size );
93#if defined(PRECISION_p)
94 spmIntMSortIntAsc( sortptr, size );
97 p_spmIntIntFltSortAsc( sortptr, size );
137 int *valtmp = newval;
142 for ( j = 0; j < size; j++, colptr++, loc2glob++ )
144 jg = spm->
replicated ? j : *loc2glob - baseval;
145 dofj = (dof > 0) ? dof : dofs[jg+1] - dofs[jg];
147 for ( i = colptr[0]; i < colptr[1]; i++, rowptr++, indexes++ )
149 ig = *rowptr - baseval;
150 dofi = (dof > 0) ? dof : dofs[ig+1] - dofs[ig];
154 memcpy( valtmp, values + index, dof2 *
sizeof(
int) );
193 int *valtmp = newval;
198 dofs = spm->
dofs - baseval;
199 for ( i = 0; i < size; i++, colptr++, rowptr++, indexes++ )
202 dofj = (dof > 0) ? dof : dofs[jg+1] - dofs[jg];
204 dofi = (dof > 0) ? dof : dofs[ig+1] - dofs[ig];
209 memcpy( valtmp, values + index, dof2 *
sizeof(
int) );
241 int *values = spm->
values;
243 int *newval = malloc( spm->
nnzexp *
sizeof(
int) );
double spm_fixdbl_t
Double datatype that is not converted through precision generator functions.
enum spm_coeftype_e spm_coeftype_t
Arithmetic types.
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.
void p_spmSort(spmatrix_t *spm)
This routine sorts the 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.
int spm_int_t
The main integer datatype used in spm arrays.
int spmSort(spmatrix_t *spm)
Sort the subarray of edges of each vertex.
The sparse matrix data structure.
static void p_spm_sort_multidof_ijv_values(const spmatrix_t *spm, const int *values, int *newval)
Apply the permutations on the values array fon an IJV spm. The values array holds the permutation ind...
static void p_spm_sort_multidof_csx_values(const spmatrix_t *spm, const int *values, int *newval)
Apply the permutations on the values array for a CSX spm The values array holds the permutation index...
spm_int_t * spm_getandset_glob2loc(spmatrix_t *spm)
Computes the glob2loc array if needed, and returns it.
int spm_get_distribution(const spmatrix_t *spm)
Search the distribution pattern used in the spm structure.