From 0e424f4050a1c329c3a740e07263df2bb1702a81 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen <4643818-rmlarsen1@users.noreply.gitlab.com> Date: Sat, 21 Feb 2026 12:49:56 -0800 Subject: [PATCH] Remove dead code, commented-out blocks, and outdated comments libeigen/eigen!2172 Co-authored-by: Rasmus Munk Larsen --- Eigen/src/Core/Block.h | 2 - Eigen/src/Core/CommaInitializer.h | 1 - Eigen/src/Core/CoreEvaluators.h | 58 ----- Eigen/src/Core/ForceAlignedAccess.h | 19 -- Eigen/src/Core/MatrixBase.h | 1 - Eigen/src/Core/ProductEvaluators.h | 12 -- Eigen/src/Core/Reshaped.h | 36 ---- Eigen/src/Core/SelfAdjointView.h | 8 - Eigen/src/Core/StlIterators.h | 6 +- Eigen/src/Core/arch/AVX/PacketMath.h | 6 - Eigen/src/Core/arch/AVX512/GemmKernel.h | 5 - .../src/Core/arch/AltiVec/MatrixProductMMA.h | 1 - Eigen/src/Core/arch/MSA/PacketMath.h | 11 - Eigen/src/Core/arch/SSE/PacketMath.h | 199 ------------------ Eigen/src/Core/arch/SSE/TypeCasting.h | 50 ----- .../Core/products/SelfadjointMatrixVector.h | 2 - .../Core/products/TriangularMatrixMatrix.h | 24 --- Eigen/src/Core/util/MaxSizeVector.h | 1 - Eigen/src/Core/util/Meta.h | 6 - Eigen/src/Geometry/Quaternion.h | 7 - Eigen/src/Householder/BlockHouseholder.h | 29 --- Eigen/src/KLUSupport/KLUSupport.h | 78 ------- Eigen/src/LU/PartialPivLU.h | 3 - Eigen/src/QR/FullPivHouseholderQR.h | 5 - Eigen/src/SVD/UpperBidiagonalization.h | 13 -- Eigen/src/SparseCore/SparseDenseProduct.h | 11 - Eigen/src/plugins/ArrayCwiseBinaryOps.inc | 20 -- 27 files changed, 3 insertions(+), 611 deletions(-) diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h index 5f19205a7..ddec4a7b0 100644 --- a/Eigen/src/Core/Block.h +++ b/Eigen/src/Core/Block.h @@ -196,8 +196,6 @@ class BlockImpl_dense : public internal::dense_xpr_base { template struct nullary_wrapper {}; -#if 0 && EIGEN_COMP_MSVC > 0 -// Disable this ugly workaround. This is now handled in traits::match, -// but this piece of code might still become handly if some other weird compilation -// errors pop up again. - -// MSVC exhibits a weird compilation error when -// compiling: -// Eigen::MatrixXf A = MatrixXf::Random(3,3); -// Ref R = 2.f*A; -// and that has_*ary_operator> have not been instantiated yet. -// The "problem" is that evaluator<2.f*A> is instantiated by traits::match<2.f*A> -// and at that time has_*ary_operator returns true regardless of T. -// Then nullary_wrapper is badly instantiated as nullary_wrapper<.,.,true,true,true>. -// The trick is thus to defer the proper instantiation of nullary_wrapper when coeff(), -// and packet() are really instantiated as implemented below: - -// This is a simple wrapper around Index to enforce the re-instantiation of -// has_*ary_operator when needed. -template struct nullary_wrapper_workaround_msvc { - nullary_wrapper_workaround_msvc(const T&); - operator T()const; -}; - -template -struct nullary_wrapper -{ - template - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i, IndexType j) const { - return nullary_wrapper >::value, - has_unary_operator >::value, - has_binary_operator >::value>().operator()(op,i,j); - } - template - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()(const NullaryOp& op, IndexType i) const { - return nullary_wrapper >::value, - has_unary_operator >::value, - has_binary_operator >::value>().operator()(op,i); - } - - template - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i, IndexType j) const { - return nullary_wrapper >::value, - has_unary_operator >::value, - has_binary_operator >::value>().template packetOp(op,i,j); - } - template - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T packetOp(const NullaryOp& op, IndexType i) const { - return nullary_wrapper >::value, - has_unary_operator >::value, - has_binary_operator >::value>().template packetOp(op,i); - } -}; -#endif // MSVC workaround - template struct evaluator> : evaluator_base> { diff --git a/Eigen/src/Core/ForceAlignedAccess.h b/Eigen/src/Core/ForceAlignedAccess.h index 55beab35a..cdbb3b8f4 100644 --- a/Eigen/src/Core/ForceAlignedAccess.h +++ b/Eigen/src/Core/ForceAlignedAccess.h @@ -103,25 +103,6 @@ inline ForceAlignedAccess MatrixBase::forceAlignedAccess() { return ForceAlignedAccess(derived()); } -/** \returns an expression of *this with forced aligned access if \a Enable is true. - * \sa forceAlignedAccess(), class ForceAlignedAccess - */ -template -template -inline add_const_on_value_type_t, Derived&>> -MatrixBase::forceAlignedAccessIf() const { - return derived(); // FIXME This should not work but apparently is never used -} - -/** \returns an expression of *this with forced aligned access if \a Enable is true. - * \sa forceAlignedAccess(), class ForceAlignedAccess - */ -template -template -inline std::conditional_t, Derived&> MatrixBase::forceAlignedAccessIf() { - return derived(); // FIXME This should not work but apparently is never used -} - } // end namespace Eigen #endif // EIGEN_FORCEALIGNEDACCESS_H diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index 35d8327a6..1fedfdace 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -409,7 +409,6 @@ class MatrixBase : public DenseBase { EIGEN_DEVICE_FUNC inline Matrix canonicalEulerAngles(Index a0, Index a1, Index a2) const; - // put this as separate enum value to work around possible GCC 4.3 bug (?) enum { HomogeneousReturnTypeDirection = ColsAtCompileTime == 1 && RowsAtCompileTime == 1 diff --git a/Eigen/src/Core/ProductEvaluators.h b/Eigen/src/Core/ProductEvaluators.h index be55be5e8..c703ec392 100644 --- a/Eigen/src/Core/ProductEvaluators.h +++ b/Eigen/src/Core/ProductEvaluators.h @@ -500,18 +500,6 @@ struct product_evaluator, ProductTag, DenseShape, EIGEN_INTERNAL_CHECK_COST_VALUE(NumTraits::MulCost); EIGEN_INTERNAL_CHECK_COST_VALUE(NumTraits::AddCost); EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); -#if 0 - std::cerr << "LhsOuterStrideBytes= " << LhsOuterStrideBytes << "\n"; - std::cerr << "RhsOuterStrideBytes= " << RhsOuterStrideBytes << "\n"; - std::cerr << "LhsAlignment= " << LhsAlignment << "\n"; - std::cerr << "RhsAlignment= " << RhsAlignment << "\n"; - std::cerr << "CanVectorizeLhs= " << CanVectorizeLhs << "\n"; - std::cerr << "CanVectorizeRhs= " << CanVectorizeRhs << "\n"; - std::cerr << "CanVectorizeInner= " << CanVectorizeInner << "\n"; - std::cerr << "EvalToRowMajor= " << EvalToRowMajor << "\n"; - std::cerr << "Alignment= " << Alignment << "\n"; - std::cerr << "Flags= " << Flags << "\n"; -#endif } // Everything below here is taken from CoeffBasedProduct.h diff --git a/Eigen/src/Core/Reshaped.h b/Eigen/src/Core/Reshaped.h index 22acdc0bc..be3f7f12d 100644 --- a/Eigen/src/Core/Reshaped.h +++ b/Eigen/src/Core/Reshaped.h @@ -333,43 +333,7 @@ struct reshaped_evaluator - inline PacketScalar packet(Index rowId, Index colId) const - { - const RowCol row_col = index_remap(rowId, colId); - return m_argImpl.template packet(row_col.first, row_col.second); - } - - template - EIGEN_DEVICE_FUNC - inline void writePacket(Index rowId, Index colId, const PacketScalar& val) - { - const RowCol row_col = index_remap(rowId, colId); - m_argImpl.const_cast_derived().template writePacket - (row_col.first, row_col.second, val); - } - - template - EIGEN_DEVICE_FUNC - inline PacketScalar packet(Index index) const - { - const RowCol row_col = index_remap(RowsAtCompileTime == 1 ? 0 : index, - RowsAtCompileTime == 1 ? index : 0); - return m_argImpl.template packet(row_col.first, row_col.second); - } - - template - EIGEN_DEVICE_FUNC - inline void writePacket(Index index, const PacketScalar& val) - { - const RowCol row_col = index_remap(RowsAtCompileTime == 1 ? 0 : index, - RowsAtCompileTime == 1 ? index : 0); - return m_argImpl.template packet(row_col.first, row_col.second, val); - } -#endif protected: evaluator m_argImpl; const XprType& m_xpr; diff --git a/Eigen/src/Core/SelfAdjointView.h b/Eigen/src/Core/SelfAdjointView.h index 7a87e9d7e..b8c9e75d6 100644 --- a/Eigen/src/Core/SelfAdjointView.h +++ b/Eigen/src/Core/SelfAdjointView.h @@ -236,14 +236,6 @@ class SelfAdjointView : public TriangularBase MatrixTypeNested m_matrix; }; -// template -// internal::selfadjoint_matrix_product_returntype > -// operator*(const MatrixBase& lhs, const SelfAdjointView& rhs) -// { -// return internal::matrix_selfadjoint_product_returntype -// >(lhs.derived(),rhs); -// } - // selfadjoint to dense matrix namespace internal { diff --git a/Eigen/src/Core/StlIterators.h b/Eigen/src/Core/StlIterators.h index c466aaf0e..d3cfce01e 100644 --- a/Eigen/src/Core/StlIterators.h +++ b/Eigen/src/Core/StlIterators.h @@ -28,7 +28,7 @@ class indexed_based_stl_iterator_base { typedef indexed_based_stl_iterator_base non_const_iterator; typedef indexed_based_stl_iterator_base const_iterator; typedef std::conditional_t::value, non_const_iterator, const_iterator> other_iterator; - // NOTE: in C++03 we cannot declare friend classes through typedefs because we need to write friend class: + friend class indexed_based_stl_iterator_base; friend class indexed_based_stl_iterator_base; @@ -174,7 +174,7 @@ class indexed_based_stl_reverse_iterator_base { typedef indexed_based_stl_reverse_iterator_base non_const_iterator; typedef indexed_based_stl_reverse_iterator_base const_iterator; typedef std::conditional_t::value, non_const_iterator, const_iterator> other_iterator; - // NOTE: in C++03 we cannot declare friend classes through typedefs because we need to write friend class: + friend class indexed_based_stl_reverse_iterator_base; friend class indexed_based_stl_reverse_iterator_base; @@ -318,7 +318,7 @@ class pointer_based_stl_iterator { typedef pointer_based_stl_iterator> non_const_iterator; typedef pointer_based_stl_iterator> const_iterator; typedef std::conditional_t::value, non_const_iterator, const_iterator> other_iterator; - // NOTE: in C++03 we cannot declare friend classes through typedefs because we need to write friend class: + friend class pointer_based_stl_iterator>; friend class pointer_based_stl_iterator>; diff --git a/Eigen/src/Core/arch/AVX/PacketMath.h b/Eigen/src/Core/arch/AVX/PacketMath.h index f814d30b4..df94f70be 100644 --- a/Eigen/src/Core/arch/AVX/PacketMath.h +++ b/Eigen/src/Core/arch/AVX/PacketMath.h @@ -1766,12 +1766,6 @@ template <> EIGEN_STRONG_INLINE Packet4d preverse(const Packet4d& a) { __m256d tmp = _mm256_shuffle_pd(a, a, 5); return _mm256_permute2f128_pd(tmp, tmp, 1); -#if 0 - // This version is unlikely to be faster as _mm256_shuffle_ps and _mm256_permute_pd - // exhibit the same latency/throughput, but it is here for future reference/benchmarking... - __m256d swap_halves = _mm256_permute2f128_pd(a,a,1); - return _mm256_permute_pd(swap_halves,5); -#endif } template <> EIGEN_STRONG_INLINE Packet8i preverse(const Packet8i& a) { diff --git a/Eigen/src/Core/arch/AVX512/GemmKernel.h b/Eigen/src/Core/arch/AVX512/GemmKernel.h index b37b6ed6b..1ec9033e7 100644 --- a/Eigen/src/Core/arch/AVX512/GemmKernel.h +++ b/Eigen/src/Core/arch/AVX512/GemmKernel.h @@ -832,10 +832,6 @@ class gemm_class { // n-remainders. if (n & 4 && max_b_unroll > 4) nloop(aa, ao, bo, co1, co2); -#if 0 - if (n & 2 && max_b_unroll > 2) nloop(aa, ao, bo, co1, co2); - if (n & 1 && max_b_unroll > 1) nloop(aa, ao, bo, co1, co2); -#else // Copy kernels don't support tails of n = 2 for single/double precision. // Loop over ones. int n_rem = 2 * ((n & 2) != 0) + 1 * ((n & 1) != 0); @@ -843,7 +839,6 @@ class gemm_class { nloop(aa, ao, bo, co1, co2); n_rem--; } -#endif // Advance A matrix pointer. a = ao + a_unroll * (a_stride - k - a_off); diff --git a/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h b/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h index 94c5dd273..ab02d320a 100644 --- a/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +++ b/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h @@ -82,7 +82,6 @@ EIGEN_ALWAYS_INLINE void storeComplexAccumulator(Index i, const DataMapper& data } } -// Defaults to float32, since Eigen still supports C++03 we can't use default template arguments template EIGEN_ALWAYS_INLINE void pgerMMA(__vector_quad* acc, const RhsPacket& a, const LhsPacket& b) { if (NegativeAccumulate) { diff --git a/Eigen/src/Core/arch/MSA/PacketMath.h b/Eigen/src/Core/arch/MSA/PacketMath.h index 2d5032a62..ff708a0e6 100644 --- a/Eigen/src/Core/arch/MSA/PacketMath.h +++ b/Eigen/src/Core/arch/MSA/PacketMath.h @@ -35,18 +35,7 @@ namespace internal { #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 32 #endif -#if 0 -#define EIGEN_MSA_DEBUG \ - static bool firstTime = true; \ - do { \ - if (firstTime) { \ - std::cout << __FILE__ << ':' << __LINE__ << ':' << __FUNCTION__ << std::endl; \ - firstTime = false; \ - } \ - } while (0) -#else #define EIGEN_MSA_DEBUG -#endif #define EIGEN_MSA_SHF_I8(a, b, c, d) (((d) << 6) | ((c) << 4) | ((b) << 2) | (a)) diff --git a/Eigen/src/Core/arch/SSE/PacketMath.h b/Eigen/src/Core/arch/SSE/PacketMath.h index bd6f5dfff..e7039d4a5 100644 --- a/Eigen/src/Core/arch/SSE/PacketMath.h +++ b/Eigen/src/Core/arch/SSE/PacketMath.h @@ -2127,205 +2127,6 @@ EIGEN_STRONG_INLINE __m128i float2half(__m128 f) { } #endif -// Packet math for Eigen::half -// Disable the following code since it's broken on too many platforms / compilers. -// #elif defined(EIGEN_VECTORIZE_SSE) && (!EIGEN_ARCH_x86_64) && (!EIGEN_COMP_MSVC) -#if 0 - -typedef struct { - __m64 x; -} Packet4h; - - -template<> struct is_arithmetic { enum { value = true }; }; - -template <> -struct packet_traits : default_packet_traits { - typedef Packet4h type; - // There is no half-size packet for Packet4h. - typedef Packet4h half; - enum { - Vectorizable = 1, - AlignedOnScalar = 1, - size = 4, - HasAdd = 1, - HasSub = 1, - HasMul = 1, - HasDiv = 1, - HasNegate = 0, - HasAbs = 0, - HasMin = 0, - HasMax = 0, - HasConj = 0, - HasSetLinear = 0, - }; -}; - - -template<> struct unpacket_traits { typedef Eigen::half type; enum {size=4, alignment=Aligned16, vectorizable=true, masked_load_available=false, masked_store_available=false}; typedef Packet4h half; }; - -template<> EIGEN_STRONG_INLINE Packet4h pset1(const Eigen::half& from) { - Packet4h result; - result.x = _mm_set1_pi16(from.x); - return result; -} - -template<> EIGEN_STRONG_INLINE Eigen::half pfirst(const Packet4h& from) { - return half_impl::raw_uint16_to_half(static_cast(_mm_cvtsi64_si32(from.x))); -} - -template<> EIGEN_STRONG_INLINE Packet4h pconj(const Packet4h& a) { return a; } - -template<> EIGEN_STRONG_INLINE Packet4h padd(const Packet4h& a, const Packet4h& b) { - __int64_t a64 = _mm_cvtm64_si64(a.x); - __int64_t b64 = _mm_cvtm64_si64(b.x); - - Eigen::half h[4]; - - Eigen::half ha = half_impl::raw_uint16_to_half(static_cast(a64)); - Eigen::half hb = half_impl::raw_uint16_to_half(static_cast(b64)); - h[0] = ha + hb; - ha = half_impl::raw_uint16_to_half(static_cast(a64 >> 16)); - hb = half_impl::raw_uint16_to_half(static_cast(b64 >> 16)); - h[1] = ha + hb; - ha = half_impl::raw_uint16_to_half(static_cast(a64 >> 32)); - hb = half_impl::raw_uint16_to_half(static_cast(b64 >> 32)); - h[2] = ha + hb; - ha = half_impl::raw_uint16_to_half(static_cast(a64 >> 48)); - hb = half_impl::raw_uint16_to_half(static_cast(b64 >> 48)); - h[3] = ha + hb; - Packet4h result; - result.x = _mm_set_pi16(h[3].x, h[2].x, h[1].x, h[0].x); - return result; -} - -template<> EIGEN_STRONG_INLINE Packet4h psub(const Packet4h& a, const Packet4h& b) { - __int64_t a64 = _mm_cvtm64_si64(a.x); - __int64_t b64 = _mm_cvtm64_si64(b.x); - - Eigen::half h[4]; - - Eigen::half ha = half_impl::raw_uint16_to_half(static_cast(a64)); - Eigen::half hb = half_impl::raw_uint16_to_half(static_cast(b64)); - h[0] = ha - hb; - ha = half_impl::raw_uint16_to_half(static_cast(a64 >> 16)); - hb = half_impl::raw_uint16_to_half(static_cast(b64 >> 16)); - h[1] = ha - hb; - ha = half_impl::raw_uint16_to_half(static_cast(a64 >> 32)); - hb = half_impl::raw_uint16_to_half(static_cast(b64 >> 32)); - h[2] = ha - hb; - ha = half_impl::raw_uint16_to_half(static_cast(a64 >> 48)); - hb = half_impl::raw_uint16_to_half(static_cast(b64 >> 48)); - h[3] = ha - hb; - Packet4h result; - result.x = _mm_set_pi16(h[3].x, h[2].x, h[1].x, h[0].x); - return result; -} - -template<> EIGEN_STRONG_INLINE Packet4h pmul(const Packet4h& a, const Packet4h& b) { - __int64_t a64 = _mm_cvtm64_si64(a.x); - __int64_t b64 = _mm_cvtm64_si64(b.x); - - Eigen::half h[4]; - - Eigen::half ha = half_impl::raw_uint16_to_half(static_cast(a64)); - Eigen::half hb = half_impl::raw_uint16_to_half(static_cast(b64)); - h[0] = ha * hb; - ha = half_impl::raw_uint16_to_half(static_cast(a64 >> 16)); - hb = half_impl::raw_uint16_to_half(static_cast(b64 >> 16)); - h[1] = ha * hb; - ha = half_impl::raw_uint16_to_half(static_cast(a64 >> 32)); - hb = half_impl::raw_uint16_to_half(static_cast(b64 >> 32)); - h[2] = ha * hb; - ha = half_impl::raw_uint16_to_half(static_cast(a64 >> 48)); - hb = half_impl::raw_uint16_to_half(static_cast(b64 >> 48)); - h[3] = ha * hb; - Packet4h result; - result.x = _mm_set_pi16(h[3].x, h[2].x, h[1].x, h[0].x); - return result; -} - -template<> EIGEN_STRONG_INLINE Packet4h pdiv(const Packet4h& a, const Packet4h& b) { - __int64_t a64 = _mm_cvtm64_si64(a.x); - __int64_t b64 = _mm_cvtm64_si64(b.x); - - Eigen::half h[4]; - - Eigen::half ha = half_impl::raw_uint16_to_half(static_cast(a64)); - Eigen::half hb = half_impl::raw_uint16_to_half(static_cast(b64)); - h[0] = ha / hb; - ha = half_impl::raw_uint16_to_half(static_cast(a64 >> 16)); - hb = half_impl::raw_uint16_to_half(static_cast(b64 >> 16)); - h[1] = ha / hb; - ha = half_impl::raw_uint16_to_half(static_cast(a64 >> 32)); - hb = half_impl::raw_uint16_to_half(static_cast(b64 >> 32)); - h[2] = ha / hb; - ha = half_impl::raw_uint16_to_half(static_cast(a64 >> 48)); - hb = half_impl::raw_uint16_to_half(static_cast(b64 >> 48)); - h[3] = ha / hb; - Packet4h result; - result.x = _mm_set_pi16(h[3].x, h[2].x, h[1].x, h[0].x); - return result; -} - -template<> EIGEN_STRONG_INLINE Packet4h pload(const Eigen::half* from) { - Packet4h result; - result.x = _mm_cvtsi64_m64(*reinterpret_cast(from)); - return result; -} - -template<> EIGEN_STRONG_INLINE Packet4h ploadu(const Eigen::half* from) { - Packet4h result; - result.x = _mm_cvtsi64_m64(*reinterpret_cast(from)); - return result; -} - -template<> EIGEN_STRONG_INLINE void pstore(Eigen::half* to, const Packet4h& from) { - __int64_t r = _mm_cvtm64_si64(from.x); - *(reinterpret_cast<__int64_t*>(to)) = r; -} - -template<> EIGEN_STRONG_INLINE void pstoreu(Eigen::half* to, const Packet4h& from) { - __int64_t r = _mm_cvtm64_si64(from.x); - *(reinterpret_cast<__int64_t*>(to)) = r; -} - -template<> EIGEN_STRONG_INLINE Packet4h -ploadquad(const Eigen::half* from) { - return pset1(*from); -} - -template<> EIGEN_STRONG_INLINE Packet4h pgather(const Eigen::half* from, Index stride) -{ - Packet4h result; - result.x = _mm_set_pi16(from[3*stride].x, from[2*stride].x, from[1*stride].x, from[0*stride].x); - return result; -} - -template<> EIGEN_STRONG_INLINE void pscatter(Eigen::half* to, const Packet4h& from, Index stride) -{ - __int64_t a = _mm_cvtm64_si64(from.x); - to[stride*0].x = static_cast(a); - to[stride*1].x = static_cast(a >> 16); - to[stride*2].x = static_cast(a >> 32); - to[stride*3].x = static_cast(a >> 48); -} - -EIGEN_STRONG_INLINE void -ptranspose(PacketBlock& kernel) { - __m64 T0 = _mm_unpacklo_pi16(kernel.packet[0].x, kernel.packet[1].x); - __m64 T1 = _mm_unpacklo_pi16(kernel.packet[2].x, kernel.packet[3].x); - __m64 T2 = _mm_unpackhi_pi16(kernel.packet[0].x, kernel.packet[1].x); - __m64 T3 = _mm_unpackhi_pi16(kernel.packet[2].x, kernel.packet[3].x); - - kernel.packet[0].x = _mm_unpacklo_pi32(T0, T1); - kernel.packet[1].x = _mm_unpackhi_pi32(T0, T1); - kernel.packet[2].x = _mm_unpacklo_pi32(T2, T3); - kernel.packet[3].x = _mm_unpackhi_pi32(T2, T3); -} - -#endif - } // end namespace internal } // end namespace Eigen diff --git a/Eigen/src/Core/arch/SSE/TypeCasting.h b/Eigen/src/Core/arch/SSE/TypeCasting.h index 9a7732a60..8eebc025f 100644 --- a/Eigen/src/Core/arch/SSE/TypeCasting.h +++ b/Eigen/src/Core/arch/SSE/TypeCasting.h @@ -173,56 +173,6 @@ EIGEN_STRONG_INLINE Packet4i preinterpret(const Packet4ui& return Packet4i(a); } -// Disable the following code since it's broken on too many platforms / compilers. -// #elif defined(EIGEN_VECTORIZE_SSE) && (!EIGEN_ARCH_x86_64) && (!EIGEN_COMP_MSVC) -#if 0 - -template <> -struct type_casting_traits { - enum { - VectorizedCast = 1, - SrcCoeffRatio = 1, - TgtCoeffRatio = 1 - }; -}; - -template<> EIGEN_STRONG_INLINE Packet4f pcast(const Packet4h& a) { - __int64_t a64 = _mm_cvtm64_si64(a.x); - Eigen::half h = raw_uint16_to_half(static_cast(a64)); - float f1 = static_cast(h); - h = raw_uint16_to_half(static_cast(a64 >> 16)); - float f2 = static_cast(h); - h = raw_uint16_to_half(static_cast(a64 >> 32)); - float f3 = static_cast(h); - h = raw_uint16_to_half(static_cast(a64 >> 48)); - float f4 = static_cast(h); - return _mm_set_ps(f4, f3, f2, f1); -} - -template <> -struct type_casting_traits { - enum { - VectorizedCast = 1, - SrcCoeffRatio = 1, - TgtCoeffRatio = 1 - }; -}; - -template<> EIGEN_STRONG_INLINE Packet4h pcast(const Packet4f& a) { - EIGEN_ALIGN16 float aux[4]; - pstore(aux, a); - Eigen::half h0(aux[0]); - Eigen::half h1(aux[1]); - Eigen::half h2(aux[2]); - Eigen::half h3(aux[3]); - - Packet4h result; - result.x = _mm_set_pi16(h3.x, h2.x, h1.x, h0.x); - return result; -} - -#endif - } // end namespace internal } // end namespace Eigen diff --git a/Eigen/src/Core/products/SelfadjointMatrixVector.h b/Eigen/src/Core/products/SelfadjointMatrixVector.h index 580f6a850..786822394 100644 --- a/Eigen/src/Core/products/SelfadjointMatrixVector.h +++ b/Eigen/src/Core/products/SelfadjointMatrixVector.h @@ -98,8 +98,6 @@ selfadjoint_matrix_vector_product huge speed up) - // gcc 4.2 does this optimization automatically. const Scalar* EIGEN_RESTRICT a0It = A0 + alignedStart; const Scalar* EIGEN_RESTRICT a1It = A1 + alignedStart; const Scalar* EIGEN_RESTRICT rhsIt = rhs + alignedStart; diff --git a/Eigen/src/Core/products/TriangularMatrixMatrix.h b/Eigen/src/Core/products/TriangularMatrixMatrix.h index a0d05ef8f..e4e446e4d 100644 --- a/Eigen/src/Core/products/TriangularMatrixMatrix.h +++ b/Eigen/src/Core/products/TriangularMatrixMatrix.h @@ -17,30 +17,6 @@ namespace Eigen { namespace internal { -// template -// struct gemm_pack_lhs_triangular -// { -// Matrix::IsComplex && Conjugate> cj; -// const_blas_data_mapper lhs(lhs_,lhsStride); -// int count = 0; -// const int peeled_mc = (rows/mr)*mr; -// for(int i=0; i EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void emplace_back(const X& x) { eigen_assert(m_size < m_reserve); diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index 4c36d4c1c..1be5b5923 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -425,12 +425,6 @@ struct scalar_product_traits { enum { Defined = 0 }; }; -// FIXME quick workaround around current limitation of result_of -// template -// struct result_of(ArgType0,ArgType1)> { -// typedef typename scalar_product_traits, remove_all_t>::ReturnType type; -// }; - /** \internal Obtains a POD type suitable to use as storage for an object of a size * of at most Len bytes, aligned as specified by \c Align. */ diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h index f2d2d051f..b2ccfc6c8 100644 --- a/Eigen/src/Geometry/Quaternion.h +++ b/Eigen/src/Geometry/Quaternion.h @@ -115,13 +115,6 @@ class QuaternionBase : public RotationBase { template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const QuaternionBase& other); - // disabled this copy operator as it is giving very strange compilation errors when compiling - // test_stdvector with GCC 4.4.2. This looks like a GCC bug though, so feel free to re-enable it if it's - // useful; however notice that we already have the templated operator= above and e.g. in MatrixBase - // we didn't have to add, in addition to templated operator=, such a non-templated copy operator. - // Derived& operator=(const QuaternionBase& other) - // { return operator=(other); } - EIGEN_DEVICE_FUNC Derived& operator=(const AngleAxisType& aa); template EIGEN_DEVICE_FUNC Derived& operator=(const MatrixBase& m); diff --git a/Eigen/src/Householder/BlockHouseholder.h b/Eigen/src/Householder/BlockHouseholder.h index 8b9230491..e730b94fe 100644 --- a/Eigen/src/Householder/BlockHouseholder.h +++ b/Eigen/src/Householder/BlockHouseholder.h @@ -20,35 +20,6 @@ namespace Eigen { namespace internal { -/** \internal */ -// template -// void make_block_householder_triangular_factor(TriangularFactorType& triFactor, const VectorsType& vectors, const -// CoeffsType& hCoeffs) -// { -// typedef typename VectorsType::Scalar Scalar; -// const Index nbVecs = vectors.cols(); -// eigen_assert(triFactor.rows() == nbVecs && triFactor.cols() == nbVecs && vectors.rows()>=nbVecs); -// -// for(Index i = 0; i < nbVecs; i++) -// { -// Index rs = vectors.rows() - i; -// // Warning, note that hCoeffs may alias with vectors. -// // It is then necessary to copy it before modifying vectors(i,i). -// typename CoeffsType::Scalar h = hCoeffs(i); -// // This hack permits to pass through nested Block<> and Transpose<> expressions. -// Scalar *Vii_ptr = const_cast(vectors.data() + vectors.outerStride()*i + vectors.innerStride()*i); -// Scalar Vii = *Vii_ptr; -// *Vii_ptr = Scalar(1); -// triFactor.col(i).head(i).noalias() = -h * vectors.block(i, 0, rs, i).adjoint() -// * vectors.col(i).tail(rs); -// *Vii_ptr = Vii; -// // FIXME add .noalias() once the triangular product can work inplace -// triFactor.col(i).head(i) = triFactor.block(0,0,i,i).template triangularView() -// * triFactor.col(i).head(i); -// triFactor(i,i) = hCoeffs(i); -// } -// } - /** \internal */ // This variant avoid modifications in vectors template diff --git a/Eigen/src/KLUSupport/KLUSupport.h b/Eigen/src/KLUSupport/KLUSupport.h index 21324ab74..69ca8a87e 100644 --- a/Eigen/src/KLUSupport/KLUSupport.h +++ b/Eigen/src/KLUSupport/KLUSupport.h @@ -112,31 +112,6 @@ class KLU : public SparseSolverBase > { eigen_assert(m_isInitialized && "Decomposition is not initialized."); return m_info; } -#if 0 // not implemented yet - inline const LUMatrixType& matrixL() const - { - if (m_extractedDataAreDirty) extractData(); - return m_l; - } - - inline const LUMatrixType& matrixU() const - { - if (m_extractedDataAreDirty) extractData(); - return m_u; - } - - inline const IntColVectorType& permutationP() const - { - if (m_extractedDataAreDirty) extractData(); - return m_p; - } - - inline const IntRowVectorType& permutationQ() const - { - if (m_extractedDataAreDirty) extractData(); - return m_q; - } -#endif /** Computes the sparse Cholesky decomposition of \a matrix * Note that the matrix should be column-major, and in compressed format for best performance. * \sa SparseMatrix::makeCompressed(). @@ -200,12 +175,6 @@ class KLU : public SparseSolverBase > { template bool _solve_impl(const MatrixBase &b, MatrixBase &x) const; -#if 0 // not implemented yet - Scalar determinant() const; - - void extractData() const; -#endif - protected: void init() { m_info = InvalidInput; @@ -255,14 +224,6 @@ class KLU : public SparseSolverBase > { } } - // cached data to reduce reallocation, etc. -#if 0 // not implemented yet - mutable LUMatrixType m_l; - mutable LUMatrixType m_u; - mutable IntColVectorType m_p; - mutable IntRowVectorType m_q; -#endif - KLUMatrixType m_dummy; KLUMatrixRef mp_matrix; @@ -278,45 +239,6 @@ class KLU : public SparseSolverBase > { KLU(const KLU &) {} }; -#if 0 // not implemented yet -template -void KLU::extractData() const -{ - if (m_extractedDataAreDirty) - { - eigen_assert(false && "KLU: extractData Not Yet Implemented"); - - // get size of the data - int lnz, unz, rows, cols, nz_udiag; - umfpack_get_lunz(&lnz, &unz, &rows, &cols, &nz_udiag, m_numeric, Scalar()); - - // allocate data - m_l.resize(rows,(std::min)(rows,cols)); - m_l.resizeNonZeros(lnz); - - m_u.resize((std::min)(rows,cols),cols); - m_u.resizeNonZeros(unz); - - m_p.resize(rows); - m_q.resize(cols); - - // extract - umfpack_get_numeric(m_l.outerIndexPtr(), m_l.innerIndexPtr(), m_l.valuePtr(), - m_u.outerIndexPtr(), m_u.innerIndexPtr(), m_u.valuePtr(), - m_p.data(), m_q.data(), 0, 0, 0, m_numeric); - - m_extractedDataAreDirty = false; - } -} - -template -typename KLU::Scalar KLU::determinant() const -{ - eigen_assert(false && "KLU: extractData Not Yet Implemented"); - return Scalar(); -} -#endif - template template bool KLU::_solve_impl(const MatrixBase &b, MatrixBase &x) const { diff --git a/Eigen/src/LU/PartialPivLU.h b/Eigen/src/LU/PartialPivLU.h index 4abb0bf4d..4f4227e6f 100644 --- a/Eigen/src/LU/PartialPivLU.h +++ b/Eigen/src/LU/PartialPivLU.h @@ -28,9 +28,6 @@ struct traits > : traits struct enable_if_ref; -// { -// typedef Derived type; -// }; template struct enable_if_ref, Derived> { diff --git a/Eigen/src/QR/FullPivHouseholderQR.h b/Eigen/src/QR/FullPivHouseholderQR.h index e98b5d655..be72c6f12 100644 --- a/Eigen/src/QR/FullPivHouseholderQR.h +++ b/Eigen/src/QR/FullPivHouseholderQR.h @@ -703,11 +703,6 @@ struct FullPivHouseholderQRMatrixQReturnType typename IntDiagSizeVectorType::Nested m_rowsTranspositions; }; -// template -// struct evaluator > -// : public evaluator > > -// {}; - } // end namespace internal template diff --git a/Eigen/src/SVD/UpperBidiagonalization.h b/Eigen/src/SVD/UpperBidiagonalization.h index 6df6318c9..33f32e6f7 100644 --- a/Eigen/src/SVD/UpperBidiagonalization.h +++ b/Eigen/src/SVD/UpperBidiagonalization.h @@ -359,19 +359,6 @@ UpperBidiagonalization& UpperBidiagonalization::comput return *this; } -#if 0 -/** \return the Householder QR decomposition of \c *this. - * - * \sa class Bidiagonalization - */ -template -const UpperBidiagonalization::PlainObject> -MatrixBase::bidiagonalization() const -{ - return UpperBidiagonalization(eval()); -} -#endif - } // end namespace internal } // end namespace Eigen diff --git a/Eigen/src/SparseCore/SparseDenseProduct.h b/Eigen/src/SparseCore/SparseDenseProduct.h index 46bdacce6..4de497f42 100644 --- a/Eigen/src/SparseCore/SparseDenseProduct.h +++ b/Eigen/src/SparseCore/SparseDenseProduct.h @@ -152,17 +152,6 @@ struct sparse_time_dense_product_impl let's disable it for now as it is conflicting with generic scalar*matrix and matrix*scalar operators -// template -// struct ScalarBinaryOpTraits > -// { -// enum { -// Defined = 1 -// }; -// typedef typename CwiseUnaryOp, T2>::PlainObject ReturnType; -// }; - // ColMajor, single column (ColPerCol=true): CSC SpMV template struct sparse_time_dense_product_impl { diff --git a/Eigen/src/plugins/ArrayCwiseBinaryOps.inc b/Eigen/src/plugins/ArrayCwiseBinaryOps.inc index c8c2434d7..7a4ab19fe 100644 --- a/Eigen/src/plugins/ArrayCwiseBinaryOps.inc +++ b/Eigen/src/plugins/ArrayCwiseBinaryOps.inc @@ -301,26 +301,6 @@ friend inline const CwiseBinaryOp, Const const T &s, const StorageBaseType &a); #endif -// NOTE disabled until we agree on argument order -#if 0 -/** \cpp11 \returns an expression of the coefficient-wise polygamma function. - * - * \specialfunctions_module - * - * It returns the \a n -th derivative of the digamma(psi) evaluated at \c *this. - * - * \warning Be careful with the order of the parameters: x.polygamma(n) is equivalent to polygamma(n,x) - * - * \sa Eigen::polygamma() - */ -template -inline const CwiseBinaryOp, const DerivedN, const Derived> -polygamma(const EIGEN_CURRENT_STORAGE_BASE_CLASS &n) const -{ - return CwiseBinaryOp, const DerivedN, const Derived>(n.derived(), this->derived()); -} -#endif - /** \returns an expression of the coefficient-wise zeta function. * * \specialfunctions_module