Fixed the SMPcSolve routine for KLU

This commit is contained in:
Francesco Lannutti 2016-06-12 21:47:31 +02:00
parent 92525887a0
commit 97f8380f02
1 changed files with 4 additions and 5 deletions

View File

@ -339,8 +339,8 @@ SMPcSolve (SMPmatrix *Matrix, double RHS[], double iRHS[], double Spare[], doubl
pExtOrder = &Matrix->SPmatrix->IntToExtRowMap [Matrix->CKTkluN] ;
for (i = 2 * Matrix->CKTkluN - 1 ; i > 0 ; i -= 2)
{
Matrix->CKTkluIntermediate_Complex [i] = RHS [*(pExtOrder)] ;
Matrix->CKTkluIntermediate_Complex [i - 1] = iRHS [*(pExtOrder--)] ;
Matrix->CKTkluIntermediate_Complex [i] = iRHS [*(pExtOrder)] ;
Matrix->CKTkluIntermediate_Complex [i - 1] = RHS [*(pExtOrder--)] ;
}
ret = klu_z_solve (Matrix->CKTkluSymbolic, Matrix->CKTkluNumeric, Matrix->CKTkluN, 1, Matrix->CKTkluIntermediate_Complex, Matrix->CKTkluCommon) ;
@ -348,8 +348,8 @@ SMPcSolve (SMPmatrix *Matrix, double RHS[], double iRHS[], double Spare[], doubl
pExtOrder = &Matrix->SPmatrix->IntToExtColMap [Matrix->CKTkluN] ;
for (i = 2 * Matrix->CKTkluN - 1 ; i > 0 ; i -= 2)
{
RHS [*(pExtOrder)] = Matrix->CKTkluIntermediate_Complex [i] ;
iRHS [*(pExtOrder--)] = Matrix->CKTkluIntermediate_Complex [i - 1] ;
iRHS [*(pExtOrder)] = Matrix->CKTkluIntermediate_Complex [i] ;
RHS [*(pExtOrder--)] = Matrix->CKTkluIntermediate_Complex [i - 1] ;
}
} else {
@ -414,7 +414,6 @@ SMPdestroy (SMPmatrix *Matrix)
{
if (Matrix->CKTkluMODE)
{
printf("Destroy\n") ;
spDestroy (Matrix->SPmatrix) ;
klu_free_numeric (&(Matrix->CKTkluNumeric), Matrix->CKTkluCommon) ;
klu_free_symbolic (&(Matrix->CKTkluSymbolic), Matrix->CKTkluCommon) ;