mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-30 18:25:11 +08:00
Merged in advanpix/eigen-mp-devs (pull request PR-31)
Added support for custom scalars in SparseLU
This commit is contained in:
commit
2cf513e973
@ -267,7 +267,8 @@ class SparseLU : public internal::SparseLUImpl<typename _MatrixType::Scalar, typ
|
|||||||
if(it.row() < j) continue;
|
if(it.row() < j) continue;
|
||||||
if(it.row() == j)
|
if(it.row() == j)
|
||||||
{
|
{
|
||||||
det *= (std::abs)(it.value());
|
using std::abs;
|
||||||
|
det *= abs(it.value());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -294,7 +295,8 @@ class SparseLU : public internal::SparseLUImpl<typename _MatrixType::Scalar, typ
|
|||||||
if(it.row() < j) continue;
|
if(it.row() < j) continue;
|
||||||
if(it.row() == j)
|
if(it.row() == j)
|
||||||
{
|
{
|
||||||
det += (std::log)((std::abs)(it.value()));
|
using std::log, std::abs;
|
||||||
|
det += log(abs(it.value()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,8 @@ Index SparseLUImpl<Scalar,Index>::pivotL(const Index jcol, const RealScalar& dia
|
|||||||
RealScalar rtemp;
|
RealScalar rtemp;
|
||||||
Index isub, icol, itemp, k;
|
Index isub, icol, itemp, k;
|
||||||
for (isub = nsupc; isub < nsupr; ++isub) {
|
for (isub = nsupc; isub < nsupr; ++isub) {
|
||||||
rtemp = std::abs(lu_col_ptr[isub]);
|
using std::abs;
|
||||||
|
rtemp = abs(lu_col_ptr[isub]);
|
||||||
if (rtemp > pivmax) {
|
if (rtemp > pivmax) {
|
||||||
pivmax = rtemp;
|
pivmax = rtemp;
|
||||||
pivptr = isub;
|
pivptr = isub;
|
||||||
@ -101,7 +102,8 @@ Index SparseLUImpl<Scalar,Index>::pivotL(const Index jcol, const RealScalar& dia
|
|||||||
if (diag >= 0 )
|
if (diag >= 0 )
|
||||||
{
|
{
|
||||||
// Diagonal element exists
|
// Diagonal element exists
|
||||||
rtemp = std::abs(lu_col_ptr[diag]);
|
using std::abs;
|
||||||
|
rtemp = abs(lu_col_ptr[diag]);
|
||||||
if (rtemp != 0.0 && rtemp >= thresh) pivptr = diag;
|
if (rtemp != 0.0 && rtemp >= thresh) pivptr = diag;
|
||||||
}
|
}
|
||||||
pivrow = lsub_ptr[pivptr];
|
pivrow = lsub_ptr[pivptr];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user