aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2017-02-14 15:36:21 -0800
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2017-02-14 15:36:21 -0800
commit31a25ab226b49560c0e652a7c821a3efa6994946 (patch)
tree20c50ae15c349bab7f442e66eda73f24fd46129f /Eigen
parent0d153ded29022021c4f7ac24b73a0adb1e423013 (diff)
parent5937c4ae32feec178d56282694f06ed16cfe7352 (diff)
Merged eigen/eigen into default
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/Core2
-rw-r--r--Eigen/Sparse2
-rw-r--r--Eigen/src/Core/ArithmeticSequence.h4
-rw-r--r--Eigen/src/Core/DenseBase.h12
-rw-r--r--Eigen/src/Core/IO.h14
-rw-r--r--Eigen/src/Core/IndexedView.h10
-rw-r--r--Eigen/src/Core/util/Macros.h6
-rwxr-xr-xEigen/src/Core/util/Meta.h27
-rw-r--r--Eigen/src/plugins/IndexedViewMethods.h10
9 files changed, 49 insertions, 38 deletions
diff --git a/Eigen/Core b/Eigen/Core
index 9f1c63826..d18835613 100644
--- a/Eigen/Core
+++ b/Eigen/Core
@@ -432,6 +432,7 @@ using std::ptrdiff_t;
#include "src/Core/util/IndexedViewHelper.h"
#include "src/Core/ArithmeticSequence.h"
+#include "src/Core/IO.h"
#include "src/Core/DenseCoeffsBase.h"
#include "src/Core/DenseBase.h"
#include "src/Core/MatrixBase.h"
@@ -480,7 +481,6 @@ using std::ptrdiff_t;
#include "src/Core/Redux.h"
#include "src/Core/Visitor.h"
#include "src/Core/Fuzzy.h"
-#include "src/Core/IO.h"
#include "src/Core/Swap.h"
#include "src/Core/CommaInitializer.h"
#include "src/Core/GeneralProduct.h"
diff --git a/Eigen/Sparse b/Eigen/Sparse
index a2ef7a665..136e681a1 100644
--- a/Eigen/Sparse
+++ b/Eigen/Sparse
@@ -25,7 +25,9 @@
#include "SparseCore"
#include "OrderingMethods"
+#ifndef EIGEN_MPL2_ONLY
#include "SparseCholesky"
+#endif
#include "SparseLU"
#include "SparseQR"
#include "IterativeLinearSolvers"
diff --git a/Eigen/src/Core/ArithmeticSequence.h b/Eigen/src/Core/ArithmeticSequence.h
index 99b954432..ada1571f1 100644
--- a/Eigen/src/Core/ArithmeticSequence.h
+++ b/Eigen/src/Core/ArithmeticSequence.h
@@ -14,7 +14,7 @@ namespace Eigen {
namespace internal {
-#if !EIGEN_HAS_CXX11
+#if (!EIGEN_HAS_CXX11) || !((!EIGEN_COMP_GNUC) || EIGEN_COMP_GNUC>=48)
template<typename T> struct aseq_negate {};
template<> struct aseq_negate<Index> {
@@ -138,7 +138,7 @@ protected:
public:
-#if EIGEN_HAS_CXX11
+#if EIGEN_HAS_CXX11 && ((!EIGEN_COMP_GNUC) || EIGEN_COMP_GNUC>=48)
auto reverse() const -> decltype(Eigen::seqN(m_first+(m_size+fix<-1>())*m_incr,m_size,-m_incr)) {
return seqN(m_first+(m_size+fix<-1>())*m_incr,m_size,-m_incr);
}
diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h
index a8229cf03..fc807577b 100644
--- a/Eigen/src/Core/DenseBase.h
+++ b/Eigen/src/Core/DenseBase.h
@@ -463,7 +463,17 @@ template<typename Derived> class DenseBase
EIGEN_DEVICE_FUNC
void visit(Visitor& func) const;
- inline const WithFormat<Derived> format(const IOFormat& fmt) const;
+ /** \returns a WithFormat proxy object allowing to print a matrix the with given
+ * format \a fmt.
+ *
+ * See class IOFormat for some examples.
+ *
+ * \sa class IOFormat, class WithFormat
+ */
+ inline const WithFormat<Derived> format(const IOFormat& fmt) const
+ {
+ return WithFormat<Derived>(derived(), fmt);
+ }
/** \returns the unique coefficient of a 1x1 expression */
EIGEN_DEVICE_FUNC
diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h
index 644228c3f..da7fd6cce 100644
--- a/Eigen/src/Core/IO.h
+++ b/Eigen/src/Core/IO.h
@@ -109,20 +109,6 @@ class WithFormat
IOFormat m_format;
};
-/** \returns a WithFormat proxy object allowing to print a matrix the with given
- * format \a fmt.
- *
- * See class IOFormat for some examples.
- *
- * \sa class IOFormat, class WithFormat
- */
-template<typename Derived>
-inline const WithFormat<Derived>
-DenseBase<Derived>::format(const IOFormat& fmt) const
-{
- return WithFormat<Derived>(derived(), fmt);
-}
-
namespace internal {
// NOTE: This helper is kept for backward compatibility with previous code specializing
diff --git a/Eigen/src/Core/IndexedView.h b/Eigen/src/Core/IndexedView.h
index 63878428e..8c57a277c 100644
--- a/Eigen/src/Core/IndexedView.h
+++ b/Eigen/src/Core/IndexedView.h
@@ -19,8 +19,8 @@ struct traits<IndexedView<XprType, RowIndices, ColIndices> >
: traits<XprType>
{
enum {
- RowsAtCompileTime = array_size<RowIndices>::value,
- ColsAtCompileTime = array_size<ColIndices>::value,
+ RowsAtCompileTime = int(array_size<RowIndices>::value),
+ ColsAtCompileTime = int(array_size<ColIndices>::value),
MaxRowsAtCompileTime = RowsAtCompileTime != Dynamic ? int(RowsAtCompileTime) : int(traits<XprType>::MaxRowsAtCompileTime),
MaxColsAtCompileTime = ColsAtCompileTime != Dynamic ? int(ColsAtCompileTime) : int(traits<XprType>::MaxColsAtCompileTime),
@@ -29,8 +29,8 @@ struct traits<IndexedView<XprType, RowIndices, ColIndices> >
: (MaxColsAtCompileTime==1&&MaxRowsAtCompileTime!=1) ? 0
: XprTypeIsRowMajor,
- RowIncr = get_compile_time_incr<RowIndices>::value,
- ColIncr = get_compile_time_incr<ColIndices>::value,
+ RowIncr = int(get_compile_time_incr<RowIndices>::value),
+ ColIncr = int(get_compile_time_incr<ColIndices>::value),
InnerIncr = IsRowMajor ? ColIncr : RowIncr,
OuterIncr = IsRowMajor ? RowIncr : ColIncr,
@@ -51,7 +51,7 @@ struct traits<IndexedView<XprType, RowIndices, ColIndices> >
// FIXME we deal with compile-time strides if and only if we have DirectAccessBit flag,
// but this is too strict regarding negative strides...
- DirectAccessMask = (InnerIncr!=UndefinedIncr && OuterIncr!=UndefinedIncr && InnerIncr>=0 && OuterIncr>=0) ? DirectAccessBit : 0,
+ DirectAccessMask = (int(InnerIncr)!=UndefinedIncr && int(OuterIncr)!=UndefinedIncr && InnerIncr>=0 && OuterIncr>=0) ? DirectAccessBit : 0,
FlagsRowMajorBit = IsRowMajor ? RowMajorBit : 0,
FlagsLvalueBit = is_lvalue<XprType>::value ? LvalueBit : 0,
Flags = (traits<XprType>::Flags & (HereditaryBits | DirectAccessMask)) | FlagsLvalueBit | FlagsRowMajorBit
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h
index 0e2863306..12531e342 100644
--- a/Eigen/src/Core/util/Macros.h
+++ b/Eigen/src/Core/util/Macros.h
@@ -349,10 +349,12 @@
# define __has_feature(x) 0
#endif
+// Some old compilers do not support template specializations like:
+// template<typename T,int N> void foo(const T x[N]);
#if !( EIGEN_COMP_CLANG && ((EIGEN_COMP_CLANG<309) || defined(__apple_build_version__)) || EIGEN_COMP_GNUC_STRICT && EIGEN_COMP_GNUC<49)
-#define EIGEN_HAS_INDEXED_VIEW 1
+#define EIGEN_HAS_STATIC_ARRAY_TEMPLATE 1
#else
-#define EIGEN_HAS_INDEXED_VIEW 0
+#define EIGEN_HAS_STATIC_ARRAY_TEMPLATE 0
#endif
// Upperbound on the C++ version to use.
diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h
index ee0531b32..90eda6e70 100755
--- a/Eigen/src/Core/util/Meta.h
+++ b/Eigen/src/Core/util/Meta.h
@@ -97,17 +97,22 @@ template<> struct is_arithmetic<unsigned int> { enum { value = true }; };
template<> struct is_arithmetic<signed long> { enum { value = true }; };
template<> struct is_arithmetic<unsigned long> { enum { value = true }; };
-template<typename T> struct is_integral { enum { value = false }; };
-template<> struct is_integral<bool> { enum { value = true }; };
-template<> struct is_integral<char> { enum { value = true }; };
-template<> struct is_integral<signed char> { enum { value = true }; };
-template<> struct is_integral<unsigned char> { enum { value = true }; };
-template<> struct is_integral<signed short> { enum { value = true }; };
-template<> struct is_integral<unsigned short> { enum { value = true }; };
-template<> struct is_integral<signed int> { enum { value = true }; };
-template<> struct is_integral<unsigned int> { enum { value = true }; };
-template<> struct is_integral<signed long> { enum { value = true }; };
-template<> struct is_integral<unsigned long> { enum { value = true }; };
+#if EIGEN_HAS_CXX11
+using std::is_integral;
+#else
+template<typename T> struct is_integral { enum { value = false }; };
+template<> struct is_integral<bool> { enum { value = true }; };
+template<> struct is_integral<char> { enum { value = true }; };
+template<> struct is_integral<signed char> { enum { value = true }; };
+template<> struct is_integral<unsigned char> { enum { value = true }; };
+template<> struct is_integral<signed short> { enum { value = true }; };
+template<> struct is_integral<unsigned short> { enum { value = true }; };
+template<> struct is_integral<signed int> { enum { value = true }; };
+template<> struct is_integral<unsigned int> { enum { value = true }; };
+template<> struct is_integral<signed long> { enum { value = true }; };
+template<> struct is_integral<unsigned long> { enum { value = true }; };
+#endif
+
template <typename T> struct add_const { typedef const T type; };
template <typename T> struct add_const<T&> { typedef T& type; };
diff --git a/Eigen/src/plugins/IndexedViewMethods.h b/Eigen/src/plugins/IndexedViewMethods.h
index 81e463623..22c1666c5 100644
--- a/Eigen/src/plugins/IndexedViewMethods.h
+++ b/Eigen/src/plugins/IndexedViewMethods.h
@@ -7,7 +7,6 @@
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#if EIGEN_HAS_INDEXED_VIEW
#if !defined(EIGEN_PARSED_BY_DOXYGEN)
// This file is automatically included twice to generate const and non-const versions
@@ -113,6 +112,8 @@ operator()(const RowIndices& rowIndices, const ColIndices& colIndices) EIGEN_IND
return Base::operator()(internal::eval_expr_given_size(rowIndices,rows()),internal::eval_expr_given_size(colIndices,cols()));
}
+#if EIGEN_HAS_STATIC_ARRAY_TEMPLATE
+
// The folowing three overloads are needed to handle raw Index[N] arrays.
template<typename RowIndicesT, std::size_t RowIndicesN, typename ColIndices>
@@ -139,6 +140,8 @@ operator()(const RowIndicesT (&rowIndices)[RowIndicesN], const ColIndicesT (&col
(derived(), rowIndices, colIndices);
}
+#endif // EIGEN_HAS_STATIC_ARRAY_TEMPLATE
+
// Overloads for 1D vectors/arrays
template<typename Indices>
@@ -182,6 +185,8 @@ operator()(const IndexType& id) EIGEN_INDEXED_VIEW_METHOD_CONST
return Base::operator()(internal::eval_expr_given_size(id,size()));
}
+#if EIGEN_HAS_STATIC_ARRAY_TEMPLATE
+
template<typename IndicesT, std::size_t IndicesN>
typename internal::enable_if<IsRowMajor,
IndexedView<EIGEN_INDEXED_VIEW_METHOD_CONST Derived,IvcIndex,const IndicesT (&)[IndicesN]> >::type
@@ -202,6 +207,8 @@ operator()(const IndicesT (&indices)[IndicesN]) EIGEN_INDEXED_VIEW_METHOD_CONST
(derived(), indices, IvcIndex(0));
}
+#endif // EIGEN_HAS_STATIC_ARRAY_TEMPLATE
+
#undef EIGEN_INDEXED_VIEW_METHOD_CONST
#undef EIGEN_INDEXED_VIEW_METHOD_TYPE
@@ -258,4 +265,3 @@ IndexedView_or_VectorBlock
operator()(const Indices& indices);
#endif // EIGEN_PARSED_BY_DOXYGEN
-#endif // EIGEN_HAS_INDEXED_VIEW