Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 5d0d5962 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Factorize some code

parent 44acd7f6
No related branches found
No related tags found
No related merge requests found
...@@ -83,6 +83,11 @@ spmDofExtend( const int type, ...@@ -83,6 +83,11 @@ spmDofExtend( const int type,
switch(spm->fmttype) switch(spm->fmttype)
{ {
case PastixCSR:
/* Swap pointers to call CSC */
colptr = newspm->rowptr;
rowptr = newspm->colptr;
case PastixCSC: case PastixCSC:
for(j=0; j<newspm->n; j++, colptr++) { for(j=0; j<newspm->n; j++, colptr++) {
dofj = dofptr[j+1] - dofptr[j]; dofj = dofptr[j+1] - dofptr[j];
...@@ -95,18 +100,6 @@ spmDofExtend( const int type, ...@@ -95,18 +100,6 @@ spmDofExtend( const int type,
} }
} }
break; break;
case PastixCSR:
for(i=0; i<newspm->n; i++, rowptr++) {
dofi = dofptr[i+1] - dofptr[i];
for(k=rowptr[0]; k<rowptr[1]; k++, rowptr++) {
j = *colptr - baseval;
dofj = dofptr[j+1] - dofptr[j];
newspm->nnzexp += dofi * dofj;
}
}
break;
case PastixIJV: case PastixIJV:
for(k=0; k<newspm->nnz; k++, rowptr++, colptr++) for(k=0; k<newspm->nnz; k++, rowptr++, colptr++)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment