59 spm_pconj_fct_t conjfct,
65 for(jj=0; jj<dofi; jj++)
68 for(ii=0; ii<jj; ii++) {
76 for(ii=jj+1; ii<dofi; ii++, valptr++)
121 spm_pconj_fct_t conjfct,
127 for(jj=0; jj<dofj; jj++)
129 for(ii=0; ii<dofi; ii++, valptr++)
171 spm_pconj_fct_t conjfct,
177 for(ii=0; ii<dofi; ii++)
179 for(jj=0; jj<dofj; jj++, valptr++)
225 const spm_pconj_fct_t conjfct,
275 spm_pconj_fct_t conjfct,
340 spm_pconj_fct_t conjfct;
342#if defined(PRECISION_c) || defined(PRECISION_z)
344 conjfct = __spm_pconj;
353 assert( dofi == dofj );
383 const spm_int_t *colptr, *rowptr, *dofs, *loc2glob;
393 valptr = (
int*)(spm->
values);
397 for(j=0; j<spm->
n; j++, colptr++, loc2glob++)
399 jg = spm->
replicated ? j : (*loc2glob) - baseval;
400 if ( spm->
dof > 0 ) {
405 dofj = dofs[jg+1] - dofs[jg];
406 col = dofs[jg] - baseval;
409 for(k=colptr[0]; k<colptr[1]; k++, rowptr++)
411 ig = (*rowptr - baseval);
412 if ( spm->
dof > 0 ) {
417 dofi = dofs[ig+1] - dofs[ig];
418 row = dofs[ig] - baseval;
422 row, dofi, col, dofj, valptr, f );
423 valptr += dofi * dofj;
463 valptr = (
int*)(spm->
values);
467 for(i=0; i<spm->
n; i++, rowptr++, loc2glob++)
469 ig = spm->
replicated ? i : (*loc2glob) - baseval;
470 if ( spm->
dof > 0 ) {
475 dofi = dofs[ig+1] - dofs[ig];
476 row = dofs[ig] - baseval;
479 for(k=rowptr[0]; k<rowptr[1]; k++, colptr++)
481 jg = (*colptr - baseval);
482 if ( spm->
dof > 0 ) {
487 dofj = dofs[jg+1] - dofs[jg];
488 col = dofs[jg] - baseval;
492 row, dofi, col, dofj, valptr, f );
493 valptr += dofi * dofj;
533 valptr = (
int*)(spm->
values);
536 for(k=0; k<spm->
nnz; k++, rowptr++, colptr++)
538 i = *rowptr - baseval;
539 j = *colptr - baseval;
541 if ( spm->
dof > 0 ) {
548 dofi = dofs[i+1] - dofs[i];
549 row = dofs[i] - baseval;
550 dofj = dofs[j+1] - dofs[j];
551 col = dofs[j] - baseval;
555 row, dofi, col, dofj, valptr, f );
556 valptr += dofi * dofj;
618 const int *xptr = (
const int *)x;
623 for( j=0; j<nrhs; j++) {
624 for( i=0; i < spm->
nexp; i++, xptr++ ) {
enum spm_layout_e spm_layout_t
Direction of the matrix storage.
enum spm_mtxtype_e spm_mtxtype_t
Matrix symmetry type property.
void p_spmPrint(FILE *f, const spmatrix_t *spm)
Write a spm matrix in a file.
void p_spmPrintRHS(FILE *f, const spmatrix_t *spm, int nrhs, const void *x, spm_int_t ldx)
Write into a file the vectors associated to a spm.
int spm_int_t
The main integer datatype used in spm arrays.
The sparse matrix data structure.
void p_spmCSCPrint(FILE *f, const spmatrix_t *spm)
Write CSC matrix in a file.
static void p_spm_print_elt(spm_mtxtype_t mtxtype, spm_layout_t layout, spm_int_t row, spm_int_t dofi, spm_int_t col, spm_int_t dofj, const int *valptr, FILE *f)
Print an element matrix.
static void p_spm_print_elt_gen_col(spm_int_t row, spm_int_t dofi, spm_int_t col, spm_int_t dofj, spm_pconj_fct_t conjfct, const int *valptr, FILE *f)
Print a general element matrix with column major storage.
static void p_spm_print_elt_sym_offd(spm_layout_t layout, spm_int_t row, spm_int_t dofi, spm_int_t col, spm_int_t dofj, spm_pconj_fct_t conjfct, const int *valptr, FILE *f)
Print an off-diagonal element matrix in the symmetric/symmetric case.
static void p_spm_print_elt_gen(spm_layout_t layout, spm_int_t row, spm_int_t dofi, spm_int_t col, spm_int_t dofj, const spm_pconj_fct_t conjfct, const int *valptr, FILE *f)
Print a general element matrix.
static void p_spm_print_elt_sym_diag(spm_int_t row, spm_int_t dofi, spm_pconj_fct_t conjfct, const int *valptr, FILE *f)
Print a diagonal element within a symmetric/symmetric matrix with column/row major storage.
void p_spmIJVPrint(FILE *f, const spmatrix_t *spm)
Write IJV matrix in a file.
static void p_spm_print_elt_gen_row(spm_int_t row, spm_int_t dofi, spm_int_t col, spm_int_t dofj, spm_pconj_fct_t conjfct, const int *valptr, FILE *f)
Print a general element matrix with row major storage.
void p_spmCSRPrint(FILE *f, const spmatrix_t *spm)
Write CSR matrix in a file.
#define p_spmPrintElt(f, i, j, A)
Subroutines to print one element of an spm structure.