aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-05-12 08:12:40 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-05-12 08:12:40 +0000
commit3562b011055aca8677c94511a5ce97d6011bede5 (patch)
tree948caf35214f8f74e9152b73646dd8197745a2f5 /Eigen/src
parent4f6d7abc8776f508178e7928001f66304c468262 (diff)
* Give Konstantinos a copyright line
* Fix compilation of Inverse.h with vectorisation * Introduce EIGEN_GNUC_AT_LEAST(x,y) macro doing future-proof (e.g. gcc v5.0) check * Only use ProductWIP if vectorisation is enabled * rename EIGEN_ALWAYS_INLINE -> EIGEN_INLINE with fall-back to inline keyword * some cleanup/indentation
Diffstat (limited to 'Eigen/src')
-rw-r--r--Eigen/src/Core/Assign.h1
-rw-r--r--Eigen/src/Core/MathFunctions.h4
-rw-r--r--Eigen/src/Core/MatrixBase.h2
-rw-r--r--Eigen/src/Core/PacketMath_Altivec.h4
-rw-r--r--Eigen/src/Core/util/Macros.h6
-rw-r--r--Eigen/src/LU/Inverse.h3
6 files changed, 9 insertions, 11 deletions
diff --git a/Eigen/src/Core/Assign.h b/Eigen/src/Core/Assign.h
index 384059185..ad62b209b 100644
--- a/Eigen/src/Core/Assign.h
+++ b/Eigen/src/Core/Assign.h
@@ -184,7 +184,6 @@ struct ei_assignment_impl<Derived, OtherDerived, true, false>
static void execute(Derived & dst, const OtherDerived & src)
{
const bool unroll = Derived::SizeAtCompileTime * OtherDerived::CoeffReadCost <= EIGEN_UNROLLING_LIMIT;
- ei_assert(dst.rows() == src.rows() && dst.cols() == src.cols());
if(unroll)
{
// std::cout << "vectorized unrolled\n";
diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h
index 72cf916f8..64ae7f97b 100644
--- a/Eigen/src/Core/MathFunctions.h
+++ b/Eigen/src/Core/MathFunctions.h
@@ -45,8 +45,8 @@ inline int ei_exp(int) { ei_assert(false); return 0; }
inline int ei_log(int) { ei_assert(false); return 0; }
inline int ei_sin(int) { ei_assert(false); return 0; }
inline int ei_cos(int) { ei_assert(false); return 0; }
-// FIXME naive GCC version test, e.g. 5.0 would not pass
-#if (defined __ICC) || (defined __GNUC__ && (__GNUC__<4 || __GNUC_MINOR__<3))
+
+#if EIGEN_GNUC_AT_LEAST(4,3)
inline int ei_pow(int x, int y) { return int(std::pow(double(x), y)); }
#else
inline int ei_pow(int x, int y) { return std::pow(x, y); }
diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h
index 97e8cab28..1e46b10d2 100644
--- a/Eigen/src/Core/MatrixBase.h
+++ b/Eigen/src/Core/MatrixBase.h
@@ -409,7 +409,7 @@ template<typename Derived> class MatrixBase
template<typename NewType>
const CwiseUnaryOp<ei_scalar_cast_op<typename ei_traits<Derived>::Scalar, NewType>, Derived> cast() const;
- const typename ei_eval<Derived>::type eval() const EIGEN_ALWAYS_INLINE
+ EIGEN_INLINE const typename ei_eval<Derived>::type eval() const
{
return typename ei_eval<Derived>::type(derived());
}
diff --git a/Eigen/src/Core/PacketMath_Altivec.h b/Eigen/src/Core/PacketMath_Altivec.h
index eb702af8c..4056c1ddb 100644
--- a/Eigen/src/Core/PacketMath_Altivec.h
+++ b/Eigen/src/Core/PacketMath_Altivec.h
@@ -1,6 +1,7 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra. Eigen itself is part of the KDE project.
//
+// Copyright (C) 2008 Konstantinos Margaritis <markos@codex.gr>
// Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr>
//
// Eigen is free software; you can redistribute it and/or
@@ -29,10 +30,7 @@
#error include PacketMath_Altivec without EIGEN_VECTORIZE_ALTIVEC
#endif
-#ifdef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
-#undef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
#define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 4
-#endif
static const vector int v0i = vec_splat_u32(0);
static const vector int v16i_ = vec_splat_u32(-16);
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index f703d159a..4b8c5fedb 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -85,10 +85,10 @@ using Eigen::MatrixBase;
// gcc 3.4.x reports the following compilation error:
// Eval.h:91: sorry, unimplemented: inlining failed in call to 'const Eigen::Eval<Derived> Eigen::MatrixBase<Scalar, Derived>::eval() const'
// : function body not available
-#if (defined __GNUC__) && (__GNUC__!=3)
-#define EIGEN_ALWAYS_INLINE __attribute__((always_inline))
+#if EIGEN_GNUC_AT_LEAST(4,0)
+#define EIGEN_INLINE __attribute__((always_inline))
#else
-#define EIGEN_ALWAYS_INLINE
+#define EIGEN_INLINE inline
#endif
#if (defined __GNUC__)
diff --git a/Eigen/src/LU/Inverse.h b/Eigen/src/LU/Inverse.h
index 00ffa25c8..e2494dd08 100644
--- a/Eigen/src/LU/Inverse.h
+++ b/Eigen/src/LU/Inverse.h
@@ -84,9 +84,10 @@ template<typename MatrixType, bool CheckExistence> class Inverse : ei_no_assignm
return m_inverse.coeff(row, col);
}
+ template<int LoadMode>
PacketScalar _packetCoeff(int row, int col) const
{
- return m_inverse.packetCoeff(row, col);
+ return m_inverse.template packetCoeff<LoadMode>(row, col);
}
enum { _Size = MatrixType::RowsAtCompileTime };