aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseLU/SparseLU_pivotL.h
diff options
context:
space:
mode:
authorGravatar Desire NUENTSA <desire.nuentsa_wakam@inria.fr>2012-07-19 18:15:23 +0200
committerGravatar Desire NUENTSA <desire.nuentsa_wakam@inria.fr>2012-07-19 18:15:23 +0200
commit925ace196c182759026d3eb3edc06565ab5f01ee (patch)
tree0095b8e8e36dfcdab19609b3564d045213cdd981 /Eigen/src/SparseLU/SparseLU_pivotL.h
parent59642da88bf83709e918667680e4ed63af4c31e5 (diff)
correct bug in the complex version
Diffstat (limited to 'Eigen/src/SparseLU/SparseLU_pivotL.h')
-rw-r--r--Eigen/src/SparseLU/SparseLU_pivotL.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/Eigen/src/SparseLU/SparseLU_pivotL.h b/Eigen/src/SparseLU/SparseLU_pivotL.h
index 39151f1e0..0c767c23a 100644
--- a/Eigen/src/SparseLU/SparseLU_pivotL.h
+++ b/Eigen/src/SparseLU/SparseLU_pivotL.h
@@ -71,7 +71,8 @@ template <typename IndexVector, typename ScalarVector>
int LU_pivotL(const int jcol, const typename ScalarVector::RealScalar diagpivotthresh, IndexVector& perm_r, IndexVector& iperm_c, int& pivrow, LU_GlobalLU_t<IndexVector, ScalarVector>& glu)
{
typedef typename IndexVector::Scalar Index;
- typedef typename ScalarVector::Scalar Scalar;
+ typedef typename ScalarVector::Scalar Scalar;
+ typedef typename ScalarVector::RealScalar RealScalar;
// Initialize pointers
IndexVector& lsub = glu.lsub; // Compressed row subscripts of L rectangular supernodes.
IndexVector& xlsub = glu.xlsub; // pointers to the beginning of each column subscript in lsub
@@ -88,10 +89,10 @@ int LU_pivotL(const int jcol, const typename ScalarVector::RealScalar diagpivott
// Determine the largest abs numerical value for partial pivoting
Index diagind = iperm_c(jcol); // diagonal index
- Scalar pivmax = 0.0;
+ RealScalar pivmax = 0.0;
Index pivptr = nsupc;
Index diag = IND_EMPTY;
- Scalar rtemp;
+ RealScalar rtemp;
Index isub, icol, itemp, k;
for (isub = nsupc; isub < nsupr; ++isub) {
rtemp = std::abs(lu_col_ptr[isub]);
@@ -109,7 +110,7 @@ int LU_pivotL(const int jcol, const typename ScalarVector::RealScalar diagpivott
return (jcol+1);
}
- Scalar thresh = diagpivotthresh * pivmax;
+ RealScalar thresh = diagpivotthresh * pivmax;
// Choose appropriate pivotal element
@@ -119,7 +120,7 @@ int LU_pivotL(const int jcol, const typename ScalarVector::RealScalar diagpivott
{
// Diagonal element exists
rtemp = std::abs(lu_col_ptr[diag]);
- if (rtemp != Scalar(0.0) && rtemp >= thresh) pivptr = diag;
+ if (rtemp != 0.0 && rtemp >= thresh) pivptr = diag;
}
pivrow = lsub_ptr[pivptr];
}