diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-03-21 14:04:53 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-03-21 14:04:53 +0400 |
commit | 3411146984316c97f56543333a46f47aeb7f9d35 (patch) | |
tree | 5de608a3c18ff2a5459fd2191609dd882ad86213 /extern/Eigen3/Eigen/src/Householder | |
parent | 1781928f9d720fa1dc4811afb69935b35aa89878 (diff) |
Update Eigen to version 3.2.1
Main purpose of this is to have SparseLU solver which
we can use now as a replacement to opennl library.
Diffstat (limited to 'extern/Eigen3/Eigen/src/Householder')
-rw-r--r-- | extern/Eigen3/Eigen/src/Householder/Householder.h | 13 | ||||
-rw-r--r-- | extern/Eigen3/Eigen/src/Householder/HouseholderSequence.h | 14 |
2 files changed, 15 insertions, 12 deletions
diff --git a/extern/Eigen3/Eigen/src/Householder/Householder.h b/extern/Eigen3/Eigen/src/Householder/Householder.h index 3f64b7dde2f..32112af9bfd 100644 --- a/extern/Eigen3/Eigen/src/Householder/Householder.h +++ b/extern/Eigen3/Eigen/src/Householder/Householder.h @@ -67,25 +67,28 @@ void MatrixBase<Derived>::makeHouseholder( Scalar& tau, RealScalar& beta) const { + using std::sqrt; + using numext::conj; + EIGEN_STATIC_ASSERT_VECTOR_ONLY(EssentialPart) VectorBlock<const Derived, EssentialPart::SizeAtCompileTime> tail(derived(), 1, size()-1); RealScalar tailSqNorm = size()==1 ? RealScalar(0) : tail.squaredNorm(); Scalar c0 = coeff(0); - if(tailSqNorm == RealScalar(0) && internal::imag(c0)==RealScalar(0)) + if(tailSqNorm == RealScalar(0) && numext::imag(c0)==RealScalar(0)) { tau = RealScalar(0); - beta = internal::real(c0); + beta = numext::real(c0); essential.setZero(); } else { - beta = internal::sqrt(internal::abs2(c0) + tailSqNorm); - if (internal::real(c0)>=RealScalar(0)) + beta = sqrt(numext::abs2(c0) + tailSqNorm); + if (numext::real(c0)>=RealScalar(0)) beta = -beta; essential = tail / (c0 - beta); - tau = internal::conj((beta - c0) / beta); + tau = conj((beta - c0) / beta); } } diff --git a/extern/Eigen3/Eigen/src/Householder/HouseholderSequence.h b/extern/Eigen3/Eigen/src/Householder/HouseholderSequence.h index 1e71e16a785..d800ca1fa42 100644 --- a/extern/Eigen3/Eigen/src/Householder/HouseholderSequence.h +++ b/extern/Eigen3/Eigen/src/Householder/HouseholderSequence.h @@ -112,6 +112,9 @@ template<typename OtherScalarType, typename MatrixType> struct matrix_type_times template<typename VectorsType, typename CoeffsType, int Side> class HouseholderSequence : public EigenBase<HouseholderSequence<VectorsType,CoeffsType,Side> > { + typedef typename internal::hseq_side_dependent_impl<VectorsType,CoeffsType,Side>::EssentialVectorType EssentialVectorType; + + public: enum { RowsAtCompileTime = internal::traits<HouseholderSequence>::RowsAtCompileTime, ColsAtCompileTime = internal::traits<HouseholderSequence>::ColsAtCompileTime, @@ -121,13 +124,10 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS typedef typename internal::traits<HouseholderSequence>::Scalar Scalar; typedef typename VectorsType::Index Index; - typedef typename internal::hseq_side_dependent_impl<VectorsType,CoeffsType,Side>::EssentialVectorType - EssentialVectorType; - - public: - typedef HouseholderSequence< - VectorsType, + typename internal::conditional<NumTraits<Scalar>::IsComplex, + typename internal::remove_all<typename VectorsType::ConjugateReturnType>::type, + VectorsType>::type, typename internal::conditional<NumTraits<Scalar>::IsComplex, typename internal::remove_all<typename CoeffsType::ConjugateReturnType>::type, CoeffsType>::type, @@ -208,7 +208,7 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS /** \brief Complex conjugate of the Householder sequence. */ ConjugateReturnType conjugate() const { - return ConjugateReturnType(m_vectors, m_coeffs.conjugate()) + return ConjugateReturnType(m_vectors.conjugate(), m_coeffs.conjugate()) .setTrans(m_trans) .setLength(m_length) .setShift(m_shift); |