mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Replace calls to numext::fma with numext:madd.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
52f570a409
commit
2e8cc042a1
@@ -36,10 +36,10 @@ inline typename internal::traits<Derived>::Scalar SparseMatrixBase<Derived>::dot
|
||||
Scalar res1(0);
|
||||
Scalar res2(0);
|
||||
for (; i; ++i) {
|
||||
res1 = numext::fma(numext::conj(i.value()), other.coeff(i.index()), res1);
|
||||
res1 = numext::madd<Scalar>(numext::conj(i.value()), other.coeff(i.index()), res1);
|
||||
++i;
|
||||
if (i) {
|
||||
res2 = numext::fma(numext::conj(i.value()), other.coeff(i.index()), res2);
|
||||
res2 = numext::madd<Scalar>(numext::conj(i.value()), other.coeff(i.index()), res2);
|
||||
}
|
||||
}
|
||||
return res1 + res2;
|
||||
@@ -67,7 +67,7 @@ inline typename internal::traits<Derived>::Scalar SparseMatrixBase<Derived>::dot
|
||||
Scalar res(0);
|
||||
while (i && j) {
|
||||
if (i.index() == j.index()) {
|
||||
res = numext::fma(numext::conj(i.value()), j.value(), res);
|
||||
res = numext::madd<Scalar>(numext::conj(i.value()), j.value(), res);
|
||||
++i;
|
||||
++j;
|
||||
} else if (i.index() < j.index())
|
||||
|
||||
@@ -41,7 +41,7 @@ struct sparse_solve_triangular_selector<Lhs, Rhs, Mode, Lower, RowMajor> {
|
||||
lastVal = it.value();
|
||||
lastIndex = it.index();
|
||||
if (lastIndex == i) break;
|
||||
tmp = numext::fma(-lastVal, other.coeff(lastIndex, col), tmp);
|
||||
tmp = numext::madd<Scalar>(-lastVal, other.coeff(lastIndex, col), tmp);
|
||||
}
|
||||
if (Mode & UnitDiag)
|
||||
other.coeffRef(i, col) = tmp;
|
||||
@@ -75,7 +75,7 @@ struct sparse_solve_triangular_selector<Lhs, Rhs, Mode, Upper, RowMajor> {
|
||||
} else if (it && it.index() == i)
|
||||
++it;
|
||||
for (; it; ++it) {
|
||||
tmp = numext::fma<Scalar>(-it.value(), other.coeff(it.index(), col), tmp);
|
||||
tmp = numext::madd<Scalar>(-it.value(), other.coeff(it.index(), col), tmp);
|
||||
}
|
||||
|
||||
if (Mode & UnitDiag)
|
||||
@@ -108,7 +108,7 @@ struct sparse_solve_triangular_selector<Lhs, Rhs, Mode, Lower, ColMajor> {
|
||||
}
|
||||
if (it && it.index() == i) ++it;
|
||||
for (; it; ++it) {
|
||||
other.coeffRef(it.index(), col) = numext::fma<Scalar>(-tmp, it.value(), other.coeffRef(it.index(), col));
|
||||
other.coeffRef(it.index(), col) = numext::madd<Scalar>(-tmp, it.value(), other.coeffRef(it.index(), col));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,7 +138,7 @@ struct sparse_solve_triangular_selector<Lhs, Rhs, Mode, Upper, ColMajor> {
|
||||
}
|
||||
LhsIterator it(lhsEval, i);
|
||||
for (; it && it.index() < i; ++it) {
|
||||
other.coeffRef(it.index(), col) = numext::fma<Scalar>(-tmp, it.value(), other.coeffRef(it.index(), col));
|
||||
other.coeffRef(it.index(), col) = numext::madd<Scalar>(-tmp, it.value(), other.coeffRef(it.index(), col));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -220,11 +220,11 @@ struct sparse_solve_triangular_sparse_selector<Lhs, Rhs, Mode, UpLo, ColMajor> {
|
||||
if (IsLower) {
|
||||
if (it.index() == i) ++it;
|
||||
for (; it; ++it) {
|
||||
tempVector.coeffRef(it.index()) = numext::fma(-ci, it.value(), tempVector.coeffRef(it.index()));
|
||||
tempVector.coeffRef(it.index()) = numext::madd<Scalar>(-ci, it.value(), tempVector.coeffRef(it.index()));
|
||||
}
|
||||
} else {
|
||||
for (; it && it.index() < i; ++it) {
|
||||
tempVector.coeffRef(it.index()) = numext::fma(-ci, it.value(), tempVector.coeffRef(it.index()));
|
||||
tempVector.coeffRef(it.index()) = numext::madd<Scalar>(-ci, it.value(), tempVector.coeffRef(it.index()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user