Handled an empty circuit with KLU
This commit is contained in:
parent
4427a1f6dd
commit
937325e2ce
|
|
@ -186,7 +186,7 @@ com_version(wordlist *wl)
|
||||||
|
|
||||||
#ifdef KLU
|
#ifdef KLU
|
||||||
"** Compiled with KLU Direct Linear Solver\n"
|
"** Compiled with KLU Direct Linear Solver\n"
|
||||||
"** (NDEV and URC models not supported yet)\n"
|
"** (NDEV model not supported yet)\n"
|
||||||
#else
|
#else
|
||||||
"** Compiled with Sparse Direct Linear Solver\n"
|
"** Compiled with Sparse Direct Linear Solver\n"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -231,7 +231,7 @@ com_version(wordlist *wl)
|
||||||
|
|
||||||
#ifdef KLU
|
#ifdef KLU
|
||||||
"** Compiled with KLU Direct Linear Solver\n"
|
"** Compiled with KLU Direct Linear Solver\n"
|
||||||
"** (NDEV and URC models not supported yet)\n"
|
"** (NDEV model not supported yet)\n"
|
||||||
#else
|
#else
|
||||||
"** Compiled with Sparse Direct Linear Solver\n"
|
"** Compiled with Sparse Direct Linear Solver\n"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,32 @@ void SMPconvertCOOtoCSC (SMPmatrix *Matrix)
|
||||||
KluLinkedListCOO *current, *temp ;
|
KluLinkedListCOO *current, *temp ;
|
||||||
unsigned int *Ap_COO, current_group, i, j ;
|
unsigned int *Ap_COO, current_group, i, j ;
|
||||||
|
|
||||||
|
if (Matrix->SMPkluMatrix->KLUmatrixLinkedListNZ == 0) {
|
||||||
|
/* Assign N and NZ */
|
||||||
|
Matrix->SMPkluMatrix->KLUmatrixN = 0 ;
|
||||||
|
Matrix->SMPkluMatrix->KLUmatrixNZ = 0 ;
|
||||||
|
|
||||||
|
/* Allocate Diag Gmin CSC Vector */
|
||||||
|
Matrix->SMPkluMatrix->KLUmatrixDiag = NULL ;
|
||||||
|
|
||||||
|
/* Allocate the temporary COO Column Index */
|
||||||
|
Ap_COO = NULL ;
|
||||||
|
|
||||||
|
/* Allocate the needed KLU data structures */
|
||||||
|
Matrix->SMPkluMatrix->KLUmatrixAp = (int *) malloc (sizeof (int)) ;
|
||||||
|
Matrix->SMPkluMatrix->KLUmatrixAi = NULL ;
|
||||||
|
Matrix->SMPkluMatrix->KLUmatrixBindStructCOO = NULL ;
|
||||||
|
Matrix->SMPkluMatrix->KLUmatrixAx = NULL ;
|
||||||
|
Matrix->SMPkluMatrix->KLUmatrixAxComplex = NULL ;
|
||||||
|
Matrix->SMPkluMatrix->KLUmatrixIntermediate = NULL ;
|
||||||
|
Matrix->SMPkluMatrix->KLUmatrixIntermediateComplex = NULL ;
|
||||||
|
|
||||||
|
/* Set the Matrix as Real */
|
||||||
|
Matrix->SMPkluMatrix->KLUmatrixIsComplex = KLUmatrixReal ;
|
||||||
|
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
/* Allocate the compressed COO elements */
|
/* Allocate the compressed COO elements */
|
||||||
MatrixCOO = (Element *) malloc (Matrix->SMPkluMatrix->KLUmatrixLinkedListNZ * sizeof (Element)) ;
|
MatrixCOO = (Element *) malloc (Matrix->SMPkluMatrix->KLUmatrixLinkedListNZ * sizeof (Element)) ;
|
||||||
|
|
||||||
|
|
@ -1181,8 +1207,13 @@ SMPgetError (SMPmatrix *Matrix, int *Col, int *Row)
|
||||||
{
|
{
|
||||||
if (Matrix->CKTkluMODE)
|
if (Matrix->CKTkluMODE)
|
||||||
{
|
{
|
||||||
*Row = Matrix->SMPkluMatrix->KLUmatrixCommon->singular_col + 1 ;
|
if (Matrix->SMPkluMatrix->KLUmatrixNZ == 0) {
|
||||||
*Col = Matrix->SMPkluMatrix->KLUmatrixCommon->singular_col + 1 ;
|
*Row = 0 ;
|
||||||
|
*Col = 0 ;
|
||||||
|
} else {
|
||||||
|
*Row = Matrix->SMPkluMatrix->KLUmatrixCommon->singular_col + 1 ;
|
||||||
|
*Col = Matrix->SMPkluMatrix->KLUmatrixCommon->singular_col + 1 ;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
spWhereSingular (Matrix->SPmatrix, Row, Col) ;
|
spWhereSingular (Matrix->SPmatrix, Row, Col) ;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue