Skip to content

Commit

Permalink
Upgrade Eigen to 3.3.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
PetterS committed Oct 20, 2018
1 parent 78d4ff2 commit 8c59245
Show file tree
Hide file tree
Showing 239 changed files with 6,949 additions and 1,887 deletions.
7 changes: 4 additions & 3 deletions minimum/nonlinear/examples/svm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@ class Norm {
// yi * (w^T * xi + b) ≤ -1.0.
class SVMConstraint {
public:
SVMConstraint(int y_, const Eigen::Vector2d& x_) : y{y_}, x{x_} {}
SVMConstraint(int y_, const Eigen::Vector2d& x) : y{y_}, x0{x[0]}, x1{x[1]} {}

template <typename R>
R operator()(const R* const w, const R* const b) const {
return R(y) * (w[0] * x(0) + w[1] * x[1] + *b) + 1.0;
return R(y) * (w[0] * x0 + w[1] * x1 + *b) + 1.0;
}

private:
const int y;
const Eigen::Vector2d x;
const double x0;
const double x1;
};

int main_function() {
Expand Down
4 changes: 2 additions & 2 deletions third-party/Eigen/.hg_archival.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
repo: 8a21fd850624c931e448cbcfb38168cb2717c790
node: f562a193118d4f40514e2f4a0ace6e974926ef06
node: b3f3d4950030e3fa2e8fde6b68405106ae5685e1
branch: 3.3
tag: 3.3.1
tag: 3.3.5
2 changes: 1 addition & 1 deletion third-party/Eigen/.hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ core
core.*
*.bak
*~
build*
*build*
*.moc.*
*.moc
ui_*
Expand Down
4 changes: 4 additions & 0 deletions third-party/Eigen/.hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ ce5a455b34c0a0ac3545a1497cb4a16c38ed90e8 3.3-beta1
bef509908b9da05d0d07ffc0da105e2c8c6d3996 3.3-rc1
04ab5fa4b241754afcf631117572276444c67239 3.3-rc2
26667be4f70baf4f0d39e96f330714c87b399090 3.3.0
f562a193118d4f40514e2f4a0ace6e974926ef06 3.3.1
da9b4e14c2550e0d11078a3c39e6d56eba9905df 3.3.2
67e894c6cd8f5f1f604b27d37ed47fdf012674ff 3.3.3
5a0156e40feb7c4136680b493c6e433d91a6f355 3.3.4
60 changes: 32 additions & 28 deletions third-party/Eigen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen_minor_
set(EIGEN_MINOR_VERSION "${CMAKE_MATCH_1}")
set(EIGEN_VERSION_NUMBER ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION})

# if the mercurial program is absent, this will leave the EIGEN_HG_CHANGESET string empty,
# but won't stop CMake.
execute_process(COMMAND hg tip -R ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE EIGEN_HGTIP_OUTPUT)
execute_process(COMMAND hg branch -R ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE EIGEN_BRANCH_OUTPUT)
# if we are not in a mercurial clone
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.hg)
# if the mercurial program is absent or this will leave the EIGEN_HG_CHANGESET string empty,
# but won't stop CMake.
execute_process(COMMAND hg tip -R ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE EIGEN_HGTIP_OUTPUT)
execute_process(COMMAND hg branch -R ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE EIGEN_BRANCH_OUTPUT)
endif()

# if this is the default (aka development) branch, extract the mercurial changeset number from the hg tip output...
if(EIGEN_BRANCH_OUTPUT MATCHES "default")
Expand Down Expand Up @@ -416,16 +419,15 @@ add_subdirectory(Eigen)

add_subdirectory(doc EXCLUDE_FROM_ALL)

include(EigenConfigureTesting)

# fixme, not sure this line is still needed:
enable_testing() # must be called from the root CMakeLists, see man page

option(BUILD_TESTING "Enable creation of Eigen tests." ON)
if(BUILD_TESTING)
include(EigenConfigureTesting)

if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
add_subdirectory(test) # can't do EXCLUDE_FROM_ALL here, breaks CTest
else()
add_subdirectory(test EXCLUDE_FROM_ALL)
if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
add_subdirectory(test) # can't do EXCLUDE_FROM_ALL here, breaks CTest
else()
add_subdirectory(test EXCLUDE_FROM_ALL)
endif()
endif()

if(EIGEN_LEAVE_TEST_IN_ALL_TARGET)
Expand Down Expand Up @@ -461,7 +463,9 @@ endif(NOT WIN32)

configure_file(scripts/cdashtesting.cmake.in cdashtesting.cmake @ONLY)

ei_testing_print_summary()
if(BUILD_TESTING)
ei_testing_print_summary()
endif()

message(STATUS "")
message(STATUS "Configured Eigen ${EIGEN_VERSION_NUMBER}")
Expand Down Expand Up @@ -541,7 +545,8 @@ if (NOT CMAKE_VERSION VERSION_LESS 3.0)
set (_Eigen3_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
unset (CMAKE_SIZEOF_VOID_P)
write_basic_package_version_file (Eigen3ConfigVersion.cmake
VERSION ${EIGEN_VERSION_NUMBER} COMPATIBILITY SameMajorVersion)
VERSION ${EIGEN_VERSION_NUMBER}
COMPATIBILITY SameMajorVersion)
set (CMAKE_SIZEOF_VOID_P ${_Eigen3_CMAKE_SIZEOF_VOID_P})

# The Eigen target will be located in the Eigen3 namespace. Other CMake
Expand All @@ -551,13 +556,8 @@ if (NOT CMAKE_VERSION VERSION_LESS 3.0)
# CMake even if it has not been installed to a standard directory.
export (PACKAGE Eigen3)

install (EXPORT Eigen3Targets NAMESPACE Eigen3:: DESTINATION
${CMAKEPACKAGE_INSTALL_DIR})
install (FILES
${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/Eigen3ConfigVersion.cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake/UseEigen3.cmake
DESTINATION ${CMAKEPACKAGE_INSTALL_DIR})
install (EXPORT Eigen3Targets NAMESPACE Eigen3:: DESTINATION ${CMAKEPACKAGE_INSTALL_DIR})

else (NOT CMAKE_VERSION VERSION_LESS 3.0)
# Fallback to legacy Eigen3Config.cmake without the imported target

Expand All @@ -581,16 +581,20 @@ else (NOT CMAKE_VERSION VERSION_LESS 3.0)
set(PACKAGE_EIGEN_ROOT_DIR ${EIGEN_ROOT_DIR})
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Eigen3ConfigLegacy.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake
@ONLY ESCAPE_QUOTES
)
@ONLY ESCAPE_QUOTES )
endif()

install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/UseEigen3.cmake
${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake
DESTINATION ${CMAKEPACKAGE_INSTALL_DIR}
)
write_basic_package_version_file( Eigen3ConfigVersion.cmake
VERSION ${EIGEN_VERSION_NUMBER}
COMPATIBILITY SameMajorVersion )

endif (NOT CMAKE_VERSION VERSION_LESS 3.0)

install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/UseEigen3.cmake
${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/Eigen3ConfigVersion.cmake
DESTINATION ${CMAKEPACKAGE_INSTALL_DIR} )

# Add uninstall target
add_custom_target ( uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/EigenUninstall.cmake)
4 changes: 2 additions & 2 deletions third-party/Eigen/CTestConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "Eigen3.3")
set(CTEST_PROJECT_NAME "Eigen 3.3")
set(CTEST_NIGHTLY_START_TIME "00:00:00 UTC")

set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "manao.inria.fr")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Eigen3.3")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Eigen+3.3")
set(CTEST_DROP_SITE_CDASH TRUE)
5 changes: 5 additions & 0 deletions third-party/Eigen/Eigen/Cholesky
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define EIGEN_CHOLESKY_MODULE_H

#include "Core"
#include "Jacobi"

#include "src/Core/util/DisableStupidWarnings.h"

Expand All @@ -31,7 +32,11 @@
#include "src/Cholesky/LLT.h"
#include "src/Cholesky/LDLT.h"
#ifdef EIGEN_USE_LAPACKE
#ifdef EIGEN_USE_MKL
#include "mkl_lapacke.h"
#else
#include "src/misc/lapacke.h"
#endif
#include "src/Cholesky/LLT_LAPACKE.h"
#endif

Expand Down
29 changes: 27 additions & 2 deletions third-party/Eigen/Eigen/Core
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@
// first thing Eigen does: stop the compiler from committing suicide
#include "src/Core/util/DisableStupidWarnings.h"

#if defined(__CUDACC__) && !defined(EIGEN_NO_CUDA)
#define EIGEN_CUDACC __CUDACC__
#endif

#if defined(__CUDA_ARCH__) && !defined(EIGEN_NO_CUDA)
#define EIGEN_CUDA_ARCH __CUDA_ARCH__
#endif

#if defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 9)
#define EIGEN_CUDACC_VER ((__CUDACC_VER_MAJOR__ * 10000) + (__CUDACC_VER_MINOR__ * 100))
#elif defined(__CUDACC_VER__)
#define EIGEN_CUDACC_VER __CUDACC_VER__
#else
#define EIGEN_CUDACC_VER 0
#endif

// Handle NVCC/CUDA/SYCL
#if defined(__CUDACC__) || defined(__SYCL_DEVICE_ONLY__)
// Do not try asserts on CUDA and SYCL!
Expand Down Expand Up @@ -155,6 +171,9 @@
#ifdef __AVX512DQ__
#define EIGEN_VECTORIZE_AVX512DQ
#endif
#ifdef __AVX512ER__
#define EIGEN_VECTORIZE_AVX512ER
#endif
#endif

// include files
Expand Down Expand Up @@ -229,7 +248,7 @@
#if defined __CUDACC__
#define EIGEN_VECTORIZE_CUDA
#include <vector_types.h>
#if defined __CUDACC_VER__ && __CUDACC_VER__ >= 70500
#if EIGEN_CUDACC_VER >= 70500
#define EIGEN_HAS_CUDA_FP16
#endif
#endif
Expand Down Expand Up @@ -321,12 +340,16 @@ inline static const char *SimdInstructionSetsInUse(void) {
#error Eigen2-support is only available up to version 3.2. Please go to "http://eigen.tuxfamily.org/index.php?title=Eigen2" for further information
#endif

namespace Eigen {

// we use size_t frequently and we'll never remember to prepend it with std:: everytime just to
// ensure QNX/QCC support
using std::size_t;
// gcc 4.6.0 wants std:: for ptrdiff_t
using std::ptrdiff_t;

}

/** \defgroup Core_Module Core module
* This is the main module of Eigen providing dense matrix and vector support
* (both fixed and dynamic size) with all the features corresponding to a BLAS library
Expand All @@ -348,6 +371,7 @@ using std::ptrdiff_t;
#include "src/Core/MathFunctions.h"
#include "src/Core/GenericPacketMath.h"
#include "src/Core/MathFunctionsImpl.h"
#include "src/Core/arch/Default/ConjHelper.h"

#if defined EIGEN_VECTORIZE_AVX512
#include "src/Core/arch/SSE/PacketMath.h"
Expand All @@ -363,6 +387,7 @@ using std::ptrdiff_t;
#include "src/Core/arch/AVX/MathFunctions.h"
#include "src/Core/arch/AVX/Complex.h"
#include "src/Core/arch/AVX/TypeCasting.h"
#include "src/Core/arch/SSE/TypeCasting.h"
#elif defined EIGEN_VECTORIZE_SSE
#include "src/Core/arch/SSE/PacketMath.h"
#include "src/Core/arch/SSE/MathFunctions.h"
Expand Down Expand Up @@ -405,6 +430,7 @@ using std::ptrdiff_t;
// on CUDA devices
#include "src/Core/arch/CUDA/Complex.h"

#include "src/Core/IO.h"
#include "src/Core/DenseCoeffsBase.h"
#include "src/Core/DenseBase.h"
#include "src/Core/MatrixBase.h"
Expand Down Expand Up @@ -452,7 +478,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"
Expand Down
4 changes: 4 additions & 0 deletions third-party/Eigen/Eigen/Eigenvalues
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@
#include "src/Eigenvalues/GeneralizedEigenSolver.h"
#include "src/Eigenvalues/MatrixBaseEigenvalues.h"
#ifdef EIGEN_USE_LAPACKE
#ifdef EIGEN_USE_MKL
#include "mkl_lapacke.h"
#else
#include "src/misc/lapacke.h"
#endif
#include "src/Eigenvalues/RealSchur_LAPACKE.h"
#include "src/Eigenvalues/ComplexSchur_LAPACKE.h"
#include "src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h"
Expand Down
4 changes: 4 additions & 0 deletions third-party/Eigen/Eigen/LU
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
#include "src/LU/FullPivLU.h"
#include "src/LU/PartialPivLU.h"
#ifdef EIGEN_USE_LAPACKE
#ifdef EIGEN_USE_MKL
#include "mkl_lapacke.h"
#else
#include "src/misc/lapacke.h"
#endif
#include "src/LU/PartialPivLU_LAPACKE.h"
#endif
#include "src/LU/Determinant.h"
Expand Down
4 changes: 4 additions & 0 deletions third-party/Eigen/Eigen/QR
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
#include "src/QR/ColPivHouseholderQR.h"
#include "src/QR/CompleteOrthogonalDecomposition.h"
#ifdef EIGEN_USE_LAPACKE
#ifdef EIGEN_USE_MKL
#include "mkl_lapacke.h"
#else
#include "src/misc/lapacke.h"
#endif
#include "src/QR/HouseholderQR_LAPACKE.h"
#include "src/QR/ColPivHouseholderQR_LAPACKE.h"
#endif
Expand Down
6 changes: 3 additions & 3 deletions third-party/Eigen/Eigen/QtAlignedMalloc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "src/Core/util/DisableStupidWarnings.h"

void *qMalloc(size_t size)
void *qMalloc(std::size_t size)
{
return Eigen::internal::aligned_malloc(size);
}
Expand All @@ -24,10 +24,10 @@ void qFree(void *ptr)
Eigen::internal::aligned_free(ptr);
}

void *qRealloc(void *ptr, size_t size)
void *qRealloc(void *ptr, std::size_t size)
{
void* newPtr = Eigen::internal::aligned_malloc(size);
memcpy(newPtr, ptr, size);
std::memcpy(newPtr, ptr, size);
Eigen::internal::aligned_free(ptr);
return newPtr;
}
Expand Down
4 changes: 4 additions & 0 deletions third-party/Eigen/Eigen/SVD
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
#include "src/SVD/JacobiSVD.h"
#include "src/SVD/BDCSVD.h"
#if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT)
#ifdef EIGEN_USE_MKL
#include "mkl_lapacke.h"
#else
#include "src/misc/lapacke.h"
#endif
#include "src/SVD/JacobiSVD_LAPACKE.h"
#endif

Expand Down
2 changes: 2 additions & 0 deletions third-party/Eigen/Eigen/Sparse
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@

#include "SparseCore"
#include "OrderingMethods"
#ifndef EIGEN_MPL2_ONLY
#include "SparseCholesky"
#endif
#include "SparseLU"
#include "SparseQR"
#include "IterativeLinearSolvers"
Expand Down
2 changes: 1 addition & 1 deletion third-party/Eigen/Eigen/StdDeque
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "Core"
#include <deque>

#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 /* MSVC auto aligns in 64 bit builds */
#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */

#define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...)

Expand Down
2 changes: 1 addition & 1 deletion third-party/Eigen/Eigen/StdList
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "Core"
#include <list>

#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 /* MSVC auto aligns in 64 bit builds */
#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */

#define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...)

Expand Down
2 changes: 1 addition & 1 deletion third-party/Eigen/Eigen/StdVector
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "Core"
#include <vector>

#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 /* MSVC auto aligns in 64 bit builds */
#if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */

#define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...)

Expand Down
Loading

0 comments on commit 8c59245

Please sign in to comment.