Mentions légales du service

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

Move expansion only when needed

parent dbe9c7f8
No related branches found
No related tags found
No related merge requests found
...@@ -294,10 +294,10 @@ spmFindBase( const pastix_spm_t *spm ) ...@@ -294,10 +294,10 @@ spmFindBase( const pastix_spm_t *spm )
int int
spmConvert( int ofmttype, pastix_spm_t *spm ) spmConvert( int ofmttype, pastix_spm_t *spm )
{ {
if ( spm->dof != 1 ) {
spm = spmExpand( spm );
}
if ( conversionTable[spm->fmttype][ofmttype][spm->flttype] ) { if ( conversionTable[spm->fmttype][ofmttype][spm->flttype] ) {
if ( spm->dof != 1 ) {
return PASTIX_ERR_NOTIMPLEMENTED;
}
return conversionTable[spm->fmttype][ofmttype][spm->flttype]( spm ); return conversionTable[spm->fmttype][ofmttype][spm->flttype]( spm );
} }
else { else {
...@@ -420,6 +420,10 @@ spmNorm( int ntype, ...@@ -420,6 +420,10 @@ spmNorm( int ntype,
; ;
} }
if ( spmtmp != spm ) {
spmExit( spmtmp );
free(spmtmp);
}
return norm; return norm;
} }
......
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