diff options
author | Gael Guennebaud <g.gael@free.fr> | 2019-02-07 15:21:35 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2019-02-07 15:21:35 +0100 |
commit | b3c4344a6852e55c849976dd46ec4e861399bf16 (patch) | |
tree | 54656766450e12fba109e0535f55d7b35f2fecfa | |
parent | 3091c0389808216a1892444e16209ed411c4093a (diff) |
bug #1676: workaround GCC's bug in c++17 mode.
-rw-r--r-- | Eigen/src/Core/DenseBase.h | 4 | ||||
-rw-r--r-- | Eigen/src/Core/util/ForwardDeclarations.h | 6 | ||||
-rw-r--r-- | bench/bench_gemm.cpp | 5 |
3 files changed, 6 insertions, 9 deletions
diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h index 65ec1f54b..406e66013 100644 --- a/Eigen/src/Core/DenseBase.h +++ b/Eigen/src/Core/DenseBase.h @@ -40,7 +40,7 @@ static inline void check_DenseIndex_is_signed() { */ template<typename Derived> class DenseBase #ifndef EIGEN_PARSED_BY_DOXYGEN - : public DenseCoeffsBase<Derived> + : public DenseCoeffsBase<Derived, internal::accessors_level<Derived>::value> #else : public DenseCoeffsBase<Derived,DirectWriteAccessors> #endif // not EIGEN_PARSED_BY_DOXYGEN @@ -71,7 +71,7 @@ template<typename Derived> class DenseBase typedef Scalar value_type; typedef typename NumTraits<Scalar>::Real RealScalar; - typedef DenseCoeffsBase<Derived> Base; + typedef DenseCoeffsBase<Derived, internal::accessors_level<Derived>::value> Base; using Base::derived; using Base::const_cast_derived; diff --git a/Eigen/src/Core/util/ForwardDeclarations.h b/Eigen/src/Core/util/ForwardDeclarations.h index 5d86a51ac..050d15e96 100644 --- a/Eigen/src/Core/util/ForwardDeclarations.h +++ b/Eigen/src/Core/util/ForwardDeclarations.h @@ -47,11 +47,7 @@ template<typename T> struct NumTraits; template<typename Derived> struct EigenBase; template<typename Derived> class DenseBase; template<typename Derived> class PlainObjectBase; - - -template<typename Derived, - int Level = internal::accessors_level<Derived>::value > -class DenseCoeffsBase; +template<typename Derived, int Level> class DenseCoeffsBase; template<typename _Scalar, int _Rows, int _Cols, int _Options = AutoAlign | diff --git a/bench/bench_gemm.cpp b/bench/bench_gemm.cpp index 688d99c4a..7c6dbea61 100644 --- a/bench/bench_gemm.cpp +++ b/bench/bench_gemm.cpp @@ -112,6 +112,7 @@ void matlab_cplx_cplx(const M& ar, const M& ai, const M& br, const M& bi, M& cr, cr.noalias() -= ai * bi; ci.noalias() += ar * bi; ci.noalias() += ai * br; + // [cr ci] += [ar ai] * br + [-ai ar] * bi } void matlab_real_cplx(const M& a, const M& br, const M& bi, M& cr, M& ci) @@ -240,7 +241,7 @@ int main(int argc, char ** argv) blas_gemm(a,b,r); c.noalias() += a * b; if(!r.isApprox(c)) { - std::cout << r - c << "\n"; + std::cout << (r - c).norm() << "\n"; std::cerr << "Warning, your product is crap!\n\n"; } #else @@ -249,7 +250,7 @@ int main(int argc, char ** argv) gemm(a,b,c); r.noalias() += a.cast<Scalar>() .lazyProduct( b.cast<Scalar>() ); if(!r.isApprox(c)) { - std::cout << r - c << "\n"; + std::cout << (r - c).norm() << "\n"; std::cerr << "Warning, your product is crap!\n\n"; } } |