mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-27 07:29:52 +08:00
Fix bug in symmetric rank-2 update for row-major matrices (bug #144).
This commit is contained in:
parent
fb023b871f
commit
004488a31d
@ -83,10 +83,15 @@ SelfAdjointView<MatrixType,UpLo>& SelfAdjointView<MatrixType,UpLo>
|
||||
typedef typename internal::remove_all<ActualVType>::type _ActualVType;
|
||||
const ActualVType actualV = VBlasTraits::extract(v.derived());
|
||||
|
||||
Scalar actualAlpha = alpha * UBlasTraits::extractScalarFactor(u.derived())
|
||||
* internal::conj(VBlasTraits::extractScalarFactor(v.derived()));
|
||||
// If MatrixType is row major, then we use the routine for lower triangular in the upper triangular case and
|
||||
// vice versa, and take the complex conjugate of all coefficients and vector entries.
|
||||
|
||||
enum { IsRowMajor = (internal::traits<MatrixType>::Flags&RowMajorBit) ? 1 : 0 };
|
||||
Scalar actualAlpha = alpha * UBlasTraits::extractScalarFactor(u.derived())
|
||||
* internal::conj(VBlasTraits::extractScalarFactor(v.derived()));
|
||||
if (IsRowMajor)
|
||||
actualAlpha = internal::conj(actualAlpha);
|
||||
|
||||
internal::selfadjoint_rank2_update_selector<Scalar, Index,
|
||||
typename internal::remove_all<typename internal::conj_expr_if<IsRowMajor ^ UBlasTraits::NeedToConjugate,_ActualUType>::type>::type,
|
||||
typename internal::remove_all<typename internal::conj_expr_if<IsRowMajor ^ VBlasTraits::NeedToConjugate,_ActualVType>::type>::type,
|
||||
|
Loading…
Reference in New Issue
Block a user