Use spDeterminant_KLU
This commit is contained in:
parent
4f3fa801f1
commit
8a9387a79a
|
|
@ -270,6 +270,7 @@ SMPcReorder (SMPmatrix *Matrix, double PivTol, double PivRel, int *NumSwaps)
|
||||||
{
|
{
|
||||||
*NumSwaps = 1 ;
|
*NumSwaps = 1 ;
|
||||||
spSetComplex (Matrix->SPmatrix) ;
|
spSetComplex (Matrix->SPmatrix) ;
|
||||||
|
// Matrix->CKTkluCommon->tol = PivTol ;
|
||||||
|
|
||||||
if (Matrix->CKTkluNumeric != NULL)
|
if (Matrix->CKTkluNumeric != NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -306,6 +307,7 @@ SMPreorder (SMPmatrix *Matrix, double PivTol, double PivRel, double Gmin)
|
||||||
{
|
{
|
||||||
spSetReal (Matrix->SPmatrix) ;
|
spSetReal (Matrix->SPmatrix) ;
|
||||||
LoadGmin_CSC (Matrix->CKTdiag_CSC, Matrix->CKTkluN, Gmin) ;
|
LoadGmin_CSC (Matrix->CKTdiag_CSC, Matrix->CKTkluN, Gmin) ;
|
||||||
|
// Matrix->CKTkluCommon->tol = PivTol ;
|
||||||
|
|
||||||
if (Matrix->CKTkluNumeric != NULL)
|
if (Matrix->CKTkluNumeric != NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -780,7 +782,12 @@ spDeterminant_KLU (SMPmatrix *Matrix, int *pExponent, RealNumber *pDeterminant,
|
||||||
int
|
int
|
||||||
SMPcProdDiag (SMPmatrix *Matrix, SPcomplex *pMantissa, int *pExponent)
|
SMPcProdDiag (SMPmatrix *Matrix, SPcomplex *pMantissa, int *pExponent)
|
||||||
{
|
{
|
||||||
spDeterminant (Matrix->SPmatrix, pExponent, &(pMantissa->real), &(pMantissa->imag)) ;
|
if (Matrix->CKTkluMODE)
|
||||||
|
{
|
||||||
|
spDeterminant_KLU (Matrix, pExponent, &(pMantissa->real), &(pMantissa->imag)) ;
|
||||||
|
} else {
|
||||||
|
spDeterminant (Matrix->SPmatrix, pExponent, &(pMantissa->real), &(pMantissa->imag)) ;
|
||||||
|
}
|
||||||
return spError (Matrix->SPmatrix) ;
|
return spError (Matrix->SPmatrix) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -793,7 +800,12 @@ SMPcDProd (SMPmatrix *Matrix, SPcomplex *pMantissa, int *pExponent)
|
||||||
double re, im, x, y, z;
|
double re, im, x, y, z;
|
||||||
int p;
|
int p;
|
||||||
|
|
||||||
spDeterminant (Matrix->SPmatrix, &p, &re, &im) ;
|
if (Matrix->CKTkluMODE)
|
||||||
|
{
|
||||||
|
spDeterminant_KLU (Matrix, &p, &re, &im) ;
|
||||||
|
} else {
|
||||||
|
spDeterminant (Matrix->SPmatrix, &p, &re, &im) ;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef M_LN2
|
#ifndef M_LN2
|
||||||
#define M_LN2 0.69314718055994530942
|
#define M_LN2 0.69314718055994530942
|
||||||
|
|
@ -862,7 +874,13 @@ SMPcDProd (SMPmatrix *Matrix, SPcomplex *pMantissa, int *pExponent)
|
||||||
#ifdef debug_print
|
#ifdef debug_print
|
||||||
printf ("Determinant 10->2: (%20g,%20g)^%d\n", pMantissa->real, pMantissa->imag, *pExponent) ;
|
printf ("Determinant 10->2: (%20g,%20g)^%d\n", pMantissa->real, pMantissa->imag, *pExponent) ;
|
||||||
#endif
|
#endif
|
||||||
return spError (Matrix->SPmatrix) ;
|
|
||||||
|
if (Matrix->CKTkluMODE)
|
||||||
|
{
|
||||||
|
return 0 ;
|
||||||
|
} else {
|
||||||
|
return spError (Matrix->SPmatrix) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue