diff --git a/z_spm_2dense.c b/z_spm_2dense.c index 479951a768922b86f5335ece5fc6c80ebf2f5fb0..16bc3374742192091b18db288b8ce733b1684ad4 100644 --- a/z_spm_2dense.c +++ b/z_spm_2dense.c @@ -104,14 +104,14 @@ z_spmCSC2dense( const pastix_spm_t *spm ) case PastixHermitian: for(j=0; j<spm->n; j++, colptr++) { - dofj = ( spm->dof > 1 ) ? spm->dof : dofs[j+1] - dofs[j]; - col = dofs[j]; + dofj = ( spm->dof > 1 ) ? spm->dof : dofs[j+1] - dofs[j]; + col = ( spm->dof > 1 ) ? (spm->dof * j) : dofs[j]; for(k=colptr[0]; k<colptr[1]; k++, rowptr++) { i = (*rowptr - baseval); - dofi = ( spm->dof > 1 ) ? spm->dof : dofs[i+1] - dofs[i]; - row = dofs[i]; + dofi = ( spm->dof > 1 ) ? spm->dof : dofs[i+1] - dofs[i]; + row = ( spm->dof > 1 ) ? (spm->dof * i) : dofs[i]; for(jj=0; jj<dofj; jj++) { @@ -128,14 +128,14 @@ z_spmCSC2dense( const pastix_spm_t *spm ) case PastixSymmetric: for(j=0; j<spm->n; j++, colptr++) { - dofj = ( spm->dof > 1 ) ? spm->dof : dofs[j+1] - dofs[j]; - col = dofs[j]; + dofj = ( spm->dof > 1 ) ? spm->dof : dofs[j+1] - dofs[j]; + col = ( spm->dof > 1 ) ? (spm->dof * j) : dofs[j]; for(k=colptr[0]; k<colptr[1]; k++, rowptr++) { i = (*rowptr - baseval); - dofi = ( spm->dof > 1 ) ? spm->dof : dofs[i+1] - dofs[i]; - row = dofs[i]; + dofi = ( spm->dof > 1 ) ? spm->dof : dofs[i+1] - dofs[i]; + row = ( spm->dof > 1 ) ? (spm->dof * i) : dofs[i]; for(jj=0; jj<dofj; jj++) { @@ -152,14 +152,14 @@ z_spmCSC2dense( const pastix_spm_t *spm ) default: for(j=0; j<spm->n; j++, colptr++) { - dofj = ( spm->dof > 1 ) ? spm->dof : dofs[j+1] - dofs[j]; - col = dofs[j]; + dofj = ( spm->dof > 1 ) ? spm->dof : dofs[j+1] - dofs[j]; + col = ( spm->dof > 1 ) ? (spm->dof * j) : dofs[j]; for(k=colptr[0]; k<colptr[1]; k++, rowptr++) { i = (*rowptr - baseval); - dofi = ( spm->dof > 1 ) ? spm->dof : dofs[i+1] - dofs[i]; - row = dofs[i]; + dofi = ( spm->dof > 1 ) ? spm->dof : dofs[i+1] - dofs[i]; + row = ( spm->dof > 1 ) ? (spm->dof * i) : dofs[i]; for(jj=0; jj<dofj; jj++) { @@ -255,14 +255,14 @@ z_spmCSR2dense( const pastix_spm_t *spm ) case PastixHermitian: for(i=0; i<spm->n; i++, rowptr++) { - dofi = ( spm->dof > 1 ) ? spm->dof : dofs[i+1] - dofs[i]; - row = dofs[i]; + dofi = ( spm->dof > 1 ) ? spm->dof : dofs[i+1] - dofs[i]; + row = ( spm->dof > 1 ) ? (spm->dof * i) : dofs[i]; for(k=rowptr[0]; k<rowptr[1]; k++, colptr++) { j = (*colptr - baseval); - dofj = ( spm->dof > 1 ) ? spm->dof : dofs[j+1] - dofs[j]; - col = dofs[j]; + dofj = ( spm->dof > 1 ) ? spm->dof : dofs[j+1] - dofs[j]; + col = ( spm->dof > 1 ) ? (spm->dof * j) : dofs[j]; for(jj=0; jj<dofj; jj++) { @@ -280,13 +280,13 @@ z_spmCSR2dense( const pastix_spm_t *spm ) for(i=0; i<spm->n; i++, rowptr++) { dofi = ( spm->dof > 1 ) ? spm->dof : dofs[i+1] - dofs[i]; - row = dofs[i]; + row = ( spm->dof > 1 ) ? (spm->dof * i) : dofs[i]; for(k=rowptr[0]; k<rowptr[1]; k++, colptr++) { j = (*colptr - baseval); dofj = ( spm->dof > 1 ) ? spm->dof : dofs[j+1] - dofs[j]; - col = dofs[j]; + col = ( spm->dof > 1 ) ? (spm->dof * j) : dofs[j]; for(jj=0; jj<dofj; jj++) { @@ -304,13 +304,13 @@ z_spmCSR2dense( const pastix_spm_t *spm ) for(i=0; i<spm->n; i++, rowptr++) { dofi = ( spm->dof > 1 ) ? spm->dof : dofs[i+1] - dofs[i]; - row = dofs[i]; + row = ( spm->dof > 1 ) ? (spm->dof * i) : dofs[i]; for(k=rowptr[0]; k<rowptr[1]; k++, colptr++) { j = (*colptr - baseval); dofj = ( spm->dof > 1 ) ? spm->dof : dofs[j+1] - dofs[j]; - col = dofs[j]; + col = ( spm->dof > 1 ) ? (spm->dof * j) : dofs[j]; for(jj=0; jj<dofj; jj++) { @@ -406,11 +406,18 @@ z_spmIJV2dense( const pastix_spm_t *spm ) i = *rowptr - baseval; j = *colptr - baseval; - dofi = ( spm->dof > 1 ) ? spm->dof : dofs[i+1] - dofs[i]; - row = dofs[i]; - - dofj = ( spm->dof > 1 ) ? spm->dof : dofs[j+1] - dofs[j]; - col = dofs[j]; + if ( spm->dof > 1 ) { + dofi = spm->dof; + row = spm->dof * i; + dofj = spm->dof; + col = spm->dof * j; + } + else { + dofi = dofs[i+1] - dofs[i]; + row = dofs[i]; + dofj = dofs[j+1] - dofs[j]; + col = dofs[j]; + } for(jj=0; jj<dofj; jj++) { @@ -435,11 +442,18 @@ z_spmIJV2dense( const pastix_spm_t *spm ) i = *rowptr - baseval; j = *colptr - baseval; - dofi = ( spm->dof > 1 ) ? spm->dof : dofs[i+1] - dofs[i]; - row = dofs[i]; - - dofj = ( spm->dof > 1 ) ? spm->dof : dofs[j+1] - dofs[j]; - col = dofs[j]; + if ( spm->dof > 1 ) { + dofi = spm->dof; + row = spm->dof * i; + dofj = spm->dof; + col = spm->dof * j; + } + else { + dofi = dofs[i+1] - dofs[i]; + row = dofs[i]; + dofj = dofs[j+1] - dofs[j]; + col = dofs[j]; + } for(jj=0; jj<dofj; jj++) { @@ -459,11 +473,18 @@ z_spmIJV2dense( const pastix_spm_t *spm ) i = *rowptr - baseval; j = *colptr - baseval; - dofi = ( spm->dof > 1 ) ? spm->dof : dofs[i+1] - dofs[i]; - row = dofs[i]; - - dofj = ( spm->dof > 1 ) ? spm->dof : dofs[j+1] - dofs[j]; - col = dofs[j]; + if ( spm->dof > 1 ) { + dofi = spm->dof; + row = spm->dof * i; + dofj = spm->dof; + col = spm->dof * j; + } + else { + dofi = dofs[i+1] - dofs[i]; + row = dofs[i]; + dofj = dofs[j+1] - dofs[j]; + col = dofs[j]; + } for(jj=0; jj<dofj; jj++) {