Skip to content

Commit 1a356d3

Browse files
committed
- update to Eigen 3.2.9
1 parent 72cf0e9 commit 1a356d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+715
-411
lines changed

Changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
- update to Eigen 3.2.9
12
- added support for x86 compilation (thanks to Josef Kohout)
23
- added implementation of "Position-Based Elastic Rods" paper and a corresponding demo
34
- fixed some problems with VS2015

extern/eigen/CMakeLists.txt

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
project(Eigen)
2-
3-
cmake_minimum_required(VERSION 2.8.2)
2+
cmake_minimum_required(VERSION 2.8.5)
43

54
# guard against in-source builds
65

@@ -55,6 +54,7 @@ endif(EIGEN_HG_CHANGESET)
5554

5655

5756
include(CheckCXXCompilerFlag)
57+
include(GNUInstallDirs)
5858

5959
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
6060

@@ -288,25 +288,26 @@ option(EIGEN_TEST_C++0x "Enables all C++0x features." OFF)
288288

289289
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
290290

291-
# the user modifiable install path for header files
292-
set(EIGEN_INCLUDE_INSTALL_DIR ${EIGEN_INCLUDE_INSTALL_DIR} CACHE PATH "The directory where we install the header files (optional)")
293-
294-
# set the internal install path for header files which depends on wether the user modifiable
295-
# EIGEN_INCLUDE_INSTALL_DIR has been set by the user or not.
296-
if(EIGEN_INCLUDE_INSTALL_DIR)
297-
set(INCLUDE_INSTALL_DIR
298-
${EIGEN_INCLUDE_INSTALL_DIR}
299-
CACHE INTERNAL
300-
"The directory where we install the header files (internal)"
301-
)
291+
# Backward compatibility support for EIGEN_INCLUDE_INSTALL_DIR
292+
if(EIGEN_INCLUDE_INSTALL_DIR AND NOT INCLUDE_INSTALL_DIR)
293+
set(INCLUDE_INSTALL_DIR ${EIGEN_INCLUDE_INSTALL_DIR}
294+
CACHE PATH "The directory relative to CMAKE_PREFIX_PATH where Eigen header files are installed")
302295
else()
303296
set(INCLUDE_INSTALL_DIR
304-
"include/eigen3"
305-
CACHE INTERNAL
306-
"The directory where we install the header files (internal)"
307-
)
297+
"${CMAKE_INSTALL_INCLUDEDIR}/eigen3"
298+
CACHE PATH "The directory relative to CMAKE_PREFIX_PATH where Eigen header files are installed"
299+
)
308300
endif()
309301

302+
set(CMAKEPACKAGE_INSTALL_DIR
303+
"${CMAKE_INSTALL_LIBDIR}/cmake/eigen3"
304+
CACHE PATH "The directory relative to CMAKE_PREFIX_PATH where Eigen3Config.cmake is installed"
305+
)
306+
set(PKGCONFIG_INSTALL_DIR
307+
"${CMAKE_INSTALL_DATADIR}/pkgconfig"
308+
CACHE PATH "The directory relative to CMAKE_PREFIX_PATH where eigen3.pc is installed"
309+
)
310+
310311
# similar to set_target_properties but append the property instead of overwriting it
311312
macro(ei_add_target_property target prop value)
312313

@@ -324,21 +325,9 @@ install(FILES
324325
)
325326

326327
if(EIGEN_BUILD_PKGCONFIG)
327-
SET(path_separator ":")
328-
STRING(REPLACE ${path_separator} ";" pkg_config_libdir_search "$ENV{PKG_CONFIG_LIBDIR}")
329-
message(STATUS "searching for 'pkgconfig' directory in PKG_CONFIG_LIBDIR ( $ENV{PKG_CONFIG_LIBDIR} ), ${CMAKE_INSTALL_PREFIX}/share, and ${CMAKE_INSTALL_PREFIX}/lib")
330-
FIND_PATH(pkg_config_libdir pkgconfig ${pkg_config_libdir_search} ${CMAKE_INSTALL_PREFIX}/share ${CMAKE_INSTALL_PREFIX}/lib ${pkg_config_libdir_search})
331-
if(pkg_config_libdir)
332-
SET(pkg_config_install_dir ${pkg_config_libdir})
333-
message(STATUS "found ${pkg_config_libdir}/pkgconfig" )
334-
else(pkg_config_libdir)
335-
SET(pkg_config_install_dir ${CMAKE_INSTALL_PREFIX}/share)
336-
message(STATUS "pkgconfig not found; installing in ${pkg_config_install_dir}" )
337-
endif(pkg_config_libdir)
338-
339-
configure_file(eigen3.pc.in eigen3.pc)
328+
configure_file(eigen3.pc.in eigen3.pc @ONLY)
340329
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc
341-
DESTINATION ${pkg_config_install_dir}/pkgconfig
330+
DESTINATION ${PKGCONFIG_INSTALL_DIR}
342331
)
343332
endif(EIGEN_BUILD_PKGCONFIG)
344333

@@ -401,12 +390,15 @@ if(cmake_generator_tolower MATCHES "makefile")
401390
message(STATUS "--------------+--------------------------------------------------------------")
402391
message(STATUS "Command | Description")
403392
message(STATUS "--------------+--------------------------------------------------------------")
404-
message(STATUS "make install | Install to ${CMAKE_INSTALL_PREFIX}. To change that:")
405-
message(STATUS " | cmake . -DCMAKE_INSTALL_PREFIX=yourpath")
406-
message(STATUS " | Eigen headers will then be installed to:")
407-
message(STATUS " | ${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}")
408-
message(STATUS " | To install Eigen headers to a separate location, do:")
409-
message(STATUS " | cmake . -DEIGEN_INCLUDE_INSTALL_DIR=yourpath")
393+
message(STATUS "make install | Install Eigen. Headers will be installed to:")
394+
message(STATUS " | <CMAKE_INSTALL_PREFIX>/<INCLUDE_INSTALL_DIR>")
395+
message(STATUS " | Using the following values:")
396+
message(STATUS " | CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
397+
message(STATUS " | INCLUDE_INSTALL_DIR: ${INCLUDE_INSTALL_DIR}")
398+
message(STATUS " | Change the install location of Eigen headers using:")
399+
message(STATUS " | cmake . -DCMAKE_INSTALL_PREFIX=yourprefix")
400+
message(STATUS " | Or:")
401+
message(STATUS " | cmake . -DINCLUDE_INSTALL_DIR=yourdir")
410402
message(STATUS "make doc | Generate the API documentation, requires Doxygen & LaTeX")
411403
message(STATUS "make check | Build and run the unit-tests. Read this page:")
412404
message(STATUS " | http://eigen.tuxfamily.org/index.php?title=Tests")

extern/eigen/Eigen/CholmodSupport

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern "C" {
1212
/** \ingroup Support_modules
1313
* \defgroup CholmodSupport_Module CholmodSupport module
1414
*
15-
* This module provides an interface to the Cholmod library which is part of the <a href="http://www.cise.ufl.edu/research/sparse/SuiteSparse/">suitesparse</a> package.
15+
* This module provides an interface to the Cholmod library which is part of the <a href="http://www.suitesparse.com">suitesparse</a> package.
1616
* It provides the two following main factorization classes:
1717
* - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization.
1818
* - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial).

extern/eigen/Eigen/SPQRSupport

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/** \ingroup Support_modules
1111
* \defgroup SPQRSupport_Module SuiteSparseQR module
1212
*
13-
* This module provides an interface to the SPQR library, which is part of the <a href="http://www.cise.ufl.edu/research/sparse/SuiteSparse/">suitesparse</a> package.
13+
* This module provides an interface to the SPQR library, which is part of the <a href="http://www.suitesparse.com">suitesparse</a> package.
1414
*
1515
* \code
1616
* #include <Eigen/SPQRSupport>

extern/eigen/Eigen/UmfPackSupport

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern "C" {
1212
/** \ingroup Support_modules
1313
* \defgroup UmfPackSupport_Module UmfPackSupport module
1414
*
15-
* This module provides an interface to the UmfPack library which is part of the <a href="http://www.cise.ufl.edu/research/sparse/SuiteSparse/">suitesparse</a> package.
15+
* This module provides an interface to the UmfPack library which is part of the <a href="http://www.suitesparse.com">suitesparse</a> package.
1616
* It provides the following factorization class:
1717
* - class UmfPackLU: a multifrontal sequential LU factorization.
1818
*

extern/eigen/Eigen/src/Core/CommaInitializer.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,11 @@ struct CommaInitializer
7676
template<typename OtherDerived>
7777
CommaInitializer& operator,(const DenseBase<OtherDerived>& other)
7878
{
79-
if(other.cols()==0 || other.rows()==0)
79+
if(other.rows()==0)
80+
{
81+
m_col += other.cols();
8082
return *this;
83+
}
8184
if (m_col==m_xpr.cols())
8285
{
8386
m_row+=m_currentBlockRows;
@@ -86,7 +89,7 @@ struct CommaInitializer
8689
eigen_assert(m_row+m_currentBlockRows<=m_xpr.rows()
8790
&& "Too many rows passed to comma initializer (operator<<)");
8891
}
89-
eigen_assert(m_col<m_xpr.cols()
92+
eigen_assert((m_col<m_xpr.cols() || (m_xpr.cols()==0 && m_col==0))
9093
&& "Too many coefficients passed to comma initializer (operator<<)");
9194
eigen_assert(m_currentBlockRows==other.rows());
9295
if (OtherDerived::SizeAtCompileTime != Dynamic)

extern/eigen/Eigen/src/Core/CwiseUnaryView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct traits<CwiseUnaryView<ViewOp, MatrixType> >
3838
typedef typename remove_all<MatrixTypeNested>::type _MatrixTypeNested;
3939
enum {
4040
Flags = (traits<_MatrixTypeNested>::Flags & (HereditaryBits | LvalueBit | LinearAccessBit | DirectAccessBit)),
41-
CoeffReadCost = traits<_MatrixTypeNested>::CoeffReadCost + functor_traits<ViewOp>::Cost,
41+
CoeffReadCost = EIGEN_ADD_COST(traits<_MatrixTypeNested>::CoeffReadCost, functor_traits<ViewOp>::Cost),
4242
MatrixTypeInnerStride = inner_stride_at_compile_time<MatrixType>::ret,
4343
// need to cast the sizeof's from size_t to int explicitly, otherwise:
4444
// "error: no integral type can represent all of the enumerator values

extern/eigen/Eigen/src/Core/DiagonalMatrix.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ class DiagonalBase : public EigenBase<Derived>
4444
template<typename DenseDerived>
4545
void evalTo(MatrixBase<DenseDerived> &other) const;
4646
template<typename DenseDerived>
47-
void addTo(MatrixBase<DenseDerived> &other) const
47+
inline void addTo(MatrixBase<DenseDerived> &other) const
4848
{ other.diagonal() += diagonal(); }
4949
template<typename DenseDerived>
50-
void subTo(MatrixBase<DenseDerived> &other) const
50+
inline void subTo(MatrixBase<DenseDerived> &other) const
5151
{ other.diagonal() -= diagonal(); }
5252

5353
inline const DiagonalVectorType& diagonal() const { return derived().diagonal(); }
@@ -98,7 +98,7 @@ class DiagonalBase : public EigenBase<Derived>
9898

9999
template<typename Derived>
100100
template<typename DenseDerived>
101-
void DiagonalBase<Derived>::evalTo(MatrixBase<DenseDerived> &other) const
101+
inline void DiagonalBase<Derived>::evalTo(MatrixBase<DenseDerived> &other) const
102102
{
103103
other.setZero();
104104
other.diagonal() = diagonal();

extern/eigen/Eigen/src/Core/Dot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct dot_nocheck<T, U, true>
5959
*/
6060
template<typename Derived>
6161
template<typename OtherDerived>
62-
typename internal::scalar_product_traits<typename internal::traits<Derived>::Scalar,typename internal::traits<OtherDerived>::Scalar>::ReturnType
62+
inline typename internal::scalar_product_traits<typename internal::traits<Derived>::Scalar,typename internal::traits<OtherDerived>::Scalar>::ReturnType
6363
MatrixBase<Derived>::dot(const MatrixBase<OtherDerived>& other) const
6464
{
6565
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)

extern/eigen/Eigen/src/Core/GeneralProduct.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,6 @@ class GeneralProduct<Lhs, Rhs, InnerProduct>
205205
public:
206206
GeneralProduct(const Lhs& lhs, const Rhs& rhs)
207207
{
208-
EIGEN_STATIC_ASSERT((internal::is_same<typename Lhs::RealScalar, typename Rhs::RealScalar>::value),
209-
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
210-
211208
Base::coeffRef(0,0) = (lhs.transpose().cwiseProduct(rhs)).sum();
212209
}
213210

@@ -264,8 +261,6 @@ class GeneralProduct<Lhs, Rhs, OuterProduct>
264261

265262
GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs)
266263
{
267-
EIGEN_STATIC_ASSERT((internal::is_same<typename Lhs::RealScalar, typename Rhs::RealScalar>::value),
268-
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
269264
}
270265

271266
struct set { template<typename Dst, typename Src> void operator()(const Dst& dst, const Src& src) const { dst.const_cast_derived() = src; } };
@@ -425,15 +420,18 @@ template<> struct gemv_selector<OnTheRight,ColMajor,true>
425420
ResScalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(prod.lhs())
426421
* RhsBlasTraits::extractScalarFactor(prod.rhs());
427422

423+
// make sure Dest is a compile-time vector type (bug 1166)
424+
typedef typename conditional<Dest::IsVectorAtCompileTime, Dest, typename Dest::ColXpr>::type ActualDest;
425+
428426
enum {
429427
// FIXME find a way to allow an inner stride on the result if packet_traits<Scalar>::size==1
430428
// on, the other hand it is good for the cache to pack the vector anyways...
431-
EvalToDestAtCompileTime = Dest::InnerStrideAtCompileTime==1,
429+
EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime==1),
432430
ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex),
433-
MightCannotUseDest = (Dest::InnerStrideAtCompileTime!=1) || ComplexByReal
431+
MightCannotUseDest = (ActualDest::InnerStrideAtCompileTime!=1) || ComplexByReal
434432
};
435433

436-
gemv_static_vector_if<ResScalar,Dest::SizeAtCompileTime,Dest::MaxSizeAtCompileTime,MightCannotUseDest> static_dest;
434+
gemv_static_vector_if<ResScalar,ActualDest::SizeAtCompileTime,ActualDest::MaxSizeAtCompileTime,MightCannotUseDest> static_dest;
437435

438436
bool alphaIsCompatible = (!ComplexByReal) || (numext::imag(actualAlpha)==RealScalar(0));
439437
bool evalToDest = EvalToDestAtCompileTime && alphaIsCompatible;
@@ -522,7 +520,7 @@ template<> struct gemv_selector<OnTheRight,RowMajor,true>
522520
actualLhs.rows(), actualLhs.cols(),
523521
actualLhs.data(), actualLhs.outerStride(),
524522
actualRhsPtr, 1,
525-
dest.data(), dest.innerStride(),
523+
dest.data(), dest.col(0).innerStride(), //NOTE if dest is not a vector at compile-time, then dest.innerStride() might be wrong. (bug 1166)
526524
actualAlpha);
527525
}
528526
};

0 commit comments

Comments
 (0)