From 005f86a00a6347db7907e96d7748ae738614f899 Mon Sep 17 00:00:00 2001 From: Francesco Lannutti Date: Fri, 2 Nov 2012 10:39:33 +0100 Subject: [PATCH] Updated SMPprint and SMPprintRHS for KLU, SuperLU and UMFPACK --- src/maths/KLU/klusmp.c | 27 +++++++++++++++++++++------ src/maths/SuperLU/superlusmp.c | 27 +++++++++++++++++++++------ src/maths/UMFPACK/umfpacksmp.c | 27 +++++++++++++++++++++------ src/maths/sparse/spsmp.c | 2 +- 4 files changed, 64 insertions(+), 19 deletions(-) diff --git a/src/maths/KLU/klusmp.c b/src/maths/KLU/klusmp.c index 07fa4d287..7fb97b85e 100644 --- a/src/maths/KLU/klusmp.c +++ b/src/maths/KLU/klusmp.c @@ -448,16 +448,31 @@ SMPpreOrder (SMPmatrix *Matrix) } } +/* + * SMPprintRHS() + */ + +void +SMPprintRHS (SMPmatrix *Matrix, char *Filename, RealVector RHS, RealVector iRHS) +{ + if (!Matrix->CKTkluMODE) + spFileVector (Matrix->SPmatrix, Filename, RHS, iRHS) ; +} + /* * SMPprint() */ -/*ARGSUSED*/ -void -SMPprint (SMPmatrix *Matrix, FILE *File) -{ - NG_IGNORE (File) ; - spPrint (Matrix->SPmatrix, 0, 1, 1) ; +void +SMPprint (SMPmatrix *Matrix, char *Filename) +{ + if (!Matrix->CKTkluMODE) + { + if (Filename) + spFileMatrix (Matrix->SPmatrix, Filename, "Circuit Matrix", 0, 1, 1) ; + else + spPrint (Matrix->SPmatrix, 0, 1, 1) ; + } } /* diff --git a/src/maths/SuperLU/superlusmp.c b/src/maths/SuperLU/superlusmp.c index 6ca5d079d..79dffa2f4 100644 --- a/src/maths/SuperLU/superlusmp.c +++ b/src/maths/SuperLU/superlusmp.c @@ -416,16 +416,31 @@ SMPpreOrder (SMPmatrix *Matrix) } } +/* + * SMPprintRHS() + */ + +void +SMPprintRHS (SMPmatrix *Matrix, char *Filename, RealVector RHS, RealVector iRHS) +{ + if (!Matrix->CKTsuperluMODE) + spFileVector (Matrix->SPmatrix, Filename, RHS, iRHS) ; +} + /* * SMPprint() */ -/*ARGSUSED*/ -void -SMPprint (SMPmatrix *Matrix, FILE *File) -{ - NG_IGNORE (File) ; - spPrint (Matrix->SPmatrix, 0, 1, 1) ; +void +SMPprint (SMPmatrix *Matrix, char *Filename) +{ + if (!Matrix->CKTsuperluMODE) + { + if (Filename) + spFileMatrix (Matrix->SPmatrix, Filename, "Circuit Matrix", 0, 1, 1) ; + else + spPrint (Matrix->SPmatrix, 0, 1, 1) ; + } } /* diff --git a/src/maths/UMFPACK/umfpacksmp.c b/src/maths/UMFPACK/umfpacksmp.c index 1171e3c80..1c74000cf 100644 --- a/src/maths/UMFPACK/umfpacksmp.c +++ b/src/maths/UMFPACK/umfpacksmp.c @@ -395,16 +395,31 @@ SMPpreOrder (SMPmatrix *Matrix) } } +/* + * SMPprintRHS() + */ + +void +SMPprintRHS (SMPmatrix *Matrix, char *Filename, RealVector RHS, RealVector iRHS) +{ + if (!Matrix->CKTumfpackMODE) + spFileVector (Matrix->SPmatrix, Filename, RHS, iRHS) ; +} + /* * SMPprint() */ -/*ARGSUSED*/ -void -SMPprint (SMPmatrix *Matrix, FILE *File) -{ - NG_IGNORE (File) ; - spPrint (Matrix->SPmatrix, 0, 1, 1) ; +void +SMPprint (SMPmatrix *Matrix, char *Filename) +{ + if (!Matrix->CKTumfpackMODE) + { + if (Filename) + spFileMatrix (Matrix->SPmatrix, Filename, "Circuit Matrix", 0, 1, 1) ; + else + spPrint (Matrix->SPmatrix, 0, 1, 1) ; + } } /* diff --git a/src/maths/sparse/spsmp.c b/src/maths/sparse/spsmp.c index c85d98468..e453d944d 100644 --- a/src/maths/sparse/spsmp.c +++ b/src/maths/sparse/spsmp.c @@ -275,7 +275,7 @@ SMPpreOrder(SMPmatrix *Matrix) } /* - * SMPprint() + * SMPprintRHS() */ void