No public description PiperOrigin-RevId: 998003033 Change-Id: I63251a7185b868b9c25ba36194bf33195b616541
diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index a57caee..0000000 --- a/CMakeLists.txt +++ /dev/null
@@ -1,684 +0,0 @@ -# cmake_minimum_require must be the first command of the file -cmake_minimum_required(VERSION 3.10.0) - -# NOTE Remove setting the policy once the minimum required CMake version is -# increased to at least 3.15. Retain enabling the export to package registry. -if (POLICY CMP0090) - # The export command does not populate package registry by default - cmake_policy (SET CMP0090 NEW) - - # Unless otherwise specified, always export to package registry to ensure - # backwards compatibility. - if (NOT DEFINED CMAKE_EXPORT_PACKAGE_REGISTRY) - set (CMAKE_EXPORT_PACKAGE_REGISTRY ON) - endif (NOT DEFINED CMAKE_EXPORT_PACKAGE_REGISTRY) -endif (POLICY CMP0090) - -project(Eigen3) - -# Remove this block after bumping CMake to v3.21.0 -# PROJECT_IS_TOP_LEVEL is defined then by default -if(CMAKE_VERSION VERSION_LESS 3.21.0) - if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - set(PROJECT_IS_TOP_LEVEL TRUE) - else() - set(PROJECT_IS_TOP_LEVEL FALSE) - endif() -endif() - -set(CMAKE_CXX_STANDARD 14 CACHE STRING "Default C++ standard") -set(CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL "Require C++ standard") -set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Allow C++ extensions") - -# guard against in-source builds - -if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) - message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. You may need to remove CMakeCache.txt. ") -endif() - - -# Alias Eigen_*_DIR to Eigen3_*_DIR: - -set(Eigen_SOURCE_DIR ${Eigen3_SOURCE_DIR}) -set(Eigen_BINARY_DIR ${Eigen3_BINARY_DIR}) - -# guard against bad build-type strings - -if (NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") -endif() - - -############################################################################# -# retrieve version information # -############################################################################# - -# automatically parse the version number -file(READ "${PROJECT_SOURCE_DIR}/Eigen/src/Core/util/Macros.h" _eigen_version_header) -string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen_world_version_match "${_eigen_version_header}") -set(EIGEN_WORLD_VERSION "${CMAKE_MATCH_1}") -string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen_major_version_match "${_eigen_version_header}") -set(EIGEN_MAJOR_VERSION "${CMAKE_MATCH_1}") -string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen_minor_version_match "${_eigen_version_header}") -set(EIGEN_MINOR_VERSION "${CMAKE_MATCH_1}") -set(EIGEN_VERSION_NUMBER ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION}) - -# if we are not in a git clone -if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git) - # if the git program is absent or this will leave the EIGEN_GIT_REVNUM string empty, - # but won't stop CMake. - execute_process(COMMAND git ls-remote --refs -q ${CMAKE_SOURCE_DIR} HEAD OUTPUT_VARIABLE EIGEN_GIT_OUTPUT) -endif() - -# extract the git rev number from the git output... -if(EIGEN_GIT_OUTPUT) -string(REGEX MATCH "^([0-9;a-f]+).*" EIGEN_GIT_CHANGESET_MATCH "${EIGEN_GIT_OUTPUT}") -set(EIGEN_GIT_REVNUM "${CMAKE_MATCH_1}") -endif() -#...and show it next to the version number -if(EIGEN_GIT_REVNUM) - set(EIGEN_VERSION "${EIGEN_VERSION_NUMBER} (git rev ${EIGEN_GIT_REVNUM})") -else() - set(EIGEN_VERSION "${EIGEN_VERSION_NUMBER}") -endif() - -include(CheckCXXCompilerFlag) -include(GNUInstallDirs) -include(CMakeDependentOption) - -set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) - -macro(ei_add_cxx_compiler_flag FLAG) - string(REGEX REPLACE "-" "" SFLAG1 ${FLAG}) - string(REGEX REPLACE "\\+" "p" SFLAG ${SFLAG1}) - check_cxx_compiler_flag(${FLAG} COMPILER_SUPPORT_${SFLAG}) - if(COMPILER_SUPPORT_${SFLAG}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}") - endif() -endmacro() - -# Determine if we should build shared libraries on this platform. -get_cmake_property(EIGEN_BUILD_SHARED_LIBS TARGET_SUPPORTS_SHARED_LIBS) - -############################################################################# -# find how to link to the standard libraries # -############################################################################# - -find_package(StandardMathLibrary) - - -set(EIGEN_TEST_CUSTOM_LINKER_FLAGS "" CACHE STRING "Additional linker flags when linking unit tests.") -set(EIGEN_TEST_CUSTOM_CXX_FLAGS "" CACHE STRING "Additional compiler flags when compiling unit tests.") -# convert space separated argument into CMake lists for downstream consumption -separate_arguments(EIGEN_TEST_CUSTOM_CXX_FLAGS NATIVE_COMMAND ${EIGEN_TEST_CUSTOM_CXX_FLAGS}) - -set(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO "") - -if(NOT STANDARD_MATH_LIBRARY_FOUND) - - message(FATAL_ERROR - "Can't link to the standard math library. Please report to the Eigen developers, telling them about your platform.") - -else() - if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) - set(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO "${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO} ${STANDARD_MATH_LIBRARY}") - else() - set(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO "${STANDARD_MATH_LIBRARY}") - endif() -endif() - -if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) - message(STATUS "Standard libraries to link to explicitly: ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}") -else() - message(STATUS "Standard libraries to link to explicitly: none") -endif() - -option(EIGEN_BUILD_BTL "Build benchmark suite" OFF) -option(EIGEN_BUILD_SPBENCH "Build sparse benchmark suite" OFF) - -# Disable pkgconfig only for native Windows builds -if(NOT WIN32 OR NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows) - option(EIGEN_BUILD_PKGCONFIG "Build pkg-config .pc file for Eigen" ON) -endif() - -set(CMAKE_INCLUDE_CURRENT_DIR OFF) - -option(EIGEN_SPLIT_LARGE_TESTS "Split large tests into smaller executables" ON) - -option(EIGEN_DEFAULT_TO_ROW_MAJOR "Use row-major as default matrix storage order" OFF) -if(EIGEN_DEFAULT_TO_ROW_MAJOR) - add_definitions("-DEIGEN_DEFAULT_TO_ROW_MAJOR") -endif() - -set(EIGEN_TEST_MAX_SIZE "320" CACHE STRING "Maximal matrix/vector size, default is 320") - -if(NOT MSVC) - # We assume that other compilers are partly compatible with GNUCC - - # clang outputs some warnings for unknown flags that are not caught by check_cxx_compiler_flag - # adding -Werror turns such warnings into errors - check_cxx_compiler_flag("-Werror" COMPILER_SUPPORT_WERROR) - if(COMPILER_SUPPORT_WERROR) - set(CMAKE_REQUIRED_FLAGS "-Werror") - endif() - ei_add_cxx_compiler_flag("-pedantic") - ei_add_cxx_compiler_flag("-Wall") - ei_add_cxx_compiler_flag("-Wextra") - #ei_add_cxx_compiler_flag("-Weverything") # clang - - ei_add_cxx_compiler_flag("-Wundef") - ei_add_cxx_compiler_flag("-Wcast-align") - ei_add_cxx_compiler_flag("-Wchar-subscripts") - ei_add_cxx_compiler_flag("-Wnon-virtual-dtor") - ei_add_cxx_compiler_flag("-Wunused-local-typedefs") - ei_add_cxx_compiler_flag("-Wpointer-arith") - ei_add_cxx_compiler_flag("-Wwrite-strings") - ei_add_cxx_compiler_flag("-Wformat-security") - ei_add_cxx_compiler_flag("-Wshorten-64-to-32") - ei_add_cxx_compiler_flag("-Wlogical-op") - ei_add_cxx_compiler_flag("-Wenum-conversion") - ei_add_cxx_compiler_flag("-Wc++11-extensions") - ei_add_cxx_compiler_flag("-Wdouble-promotion") -# ei_add_cxx_compiler_flag("-Wconversion") - - ei_add_cxx_compiler_flag("-Wshadow") - - ei_add_cxx_compiler_flag("-Wno-psabi") - ei_add_cxx_compiler_flag("-Wno-variadic-macros") - ei_add_cxx_compiler_flag("-Wno-long-long") - - ei_add_cxx_compiler_flag("-fno-check-new") - ei_add_cxx_compiler_flag("-fno-common") - ei_add_cxx_compiler_flag("-fstrict-aliasing") - ei_add_cxx_compiler_flag("-wd981") # disable ICC's "operands are evaluated in unspecified order" remark - ei_add_cxx_compiler_flag("-wd2304") # disable ICC's "warning #2304: non-explicit constructor with single argument may cause implicit type conversion" produced by -Wnon-virtual-dtor - - if(ANDROID_NDK) - ei_add_cxx_compiler_flag("-pie") - ei_add_cxx_compiler_flag("-fPIE") - endif() - - set(CMAKE_REQUIRED_FLAGS "") - - option(EIGEN_TEST_SSE2 "Enable/Disable SSE2 in tests/examples" OFF) - if(EIGEN_TEST_SSE2) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2") - message(STATUS "Enabling SSE2 in tests/examples") - endif() - - option(EIGEN_TEST_SSE3 "Enable/Disable SSE3 in tests/examples" OFF) - if(EIGEN_TEST_SSE3) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse3") - message(STATUS "Enabling SSE3 in tests/examples") - endif() - - option(EIGEN_TEST_SSSE3 "Enable/Disable SSSE3 in tests/examples" OFF) - if(EIGEN_TEST_SSSE3) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mssse3") - message(STATUS "Enabling SSSE3 in tests/examples") - endif() - - option(EIGEN_TEST_SSE4_1 "Enable/Disable SSE4.1 in tests/examples" OFF) - if(EIGEN_TEST_SSE4_1) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1") - message(STATUS "Enabling SSE4.1 in tests/examples") - endif() - - option(EIGEN_TEST_SSE4_2 "Enable/Disable SSE4.2 in tests/examples" OFF) - if(EIGEN_TEST_SSE4_2) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2") - message(STATUS "Enabling SSE4.2 in tests/examples") - endif() - - option(EIGEN_TEST_AVX "Enable/Disable AVX in tests/examples" OFF) - if(EIGEN_TEST_AVX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx") - message(STATUS "Enabling AVX in tests/examples") - endif() - - option(EIGEN_TEST_FMA "Enable/Disable FMA in tests/examples" OFF) - if(EIGEN_TEST_FMA AND NOT EIGEN_TEST_NEON) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfma") - message(STATUS "Enabling FMA in tests/examples") - endif() - - option(EIGEN_TEST_AVX2 "Enable/Disable AVX2 in tests/examples" OFF) - if(EIGEN_TEST_AVX2) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2 -mfma") - message(STATUS "Enabling AVX2 in tests/examples") - endif() - - option(EIGEN_TEST_AVX512 "Enable/Disable AVX512 in tests/examples" OFF) - if(EIGEN_TEST_AVX512) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512f -mfma") - message(STATUS "Enabling AVX512 in tests/examples") - endif() - - option(EIGEN_TEST_AVX512DQ "Enable/Disable AVX512DQ in tests/examples" OFF) - if(EIGEN_TEST_AVX512DQ) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512dq -mfma") - message(STATUS "Enabling AVX512DQ in tests/examples") - endif() - - option(EIGEN_TEST_AVX512FP16 "Enable/Disable AVX512-FP16 in tests/examples" OFF) - if(EIGEN_TEST_AVX512FP16) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512f -mfma -mavx512vl -mavx512fp16") - message(STATUS "Enabling AVX512-FP16 in tests/examples") - endif() - - option(EIGEN_TEST_F16C "Enable/Disable F16C in tests/examples" OFF) - if(EIGEN_TEST_F16C) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mf16c") - message(STATUS "Enabling F16C in tests/examples") - endif() - - option(EIGEN_TEST_ALTIVEC "Enable/Disable AltiVec in tests/examples" OFF) - if(EIGEN_TEST_ALTIVEC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maltivec -mabi=altivec") - message(STATUS "Enabling AltiVec in tests/examples") - endif() - - option(EIGEN_TEST_VSX "Enable/Disable VSX in tests/examples" OFF) - if(EIGEN_TEST_VSX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -mvsx") - message(STATUS "Enabling VSX in tests/examples") - endif() - - option(EIGEN_TEST_MSA "Enable/Disable MSA in tests/examples" OFF) - if(EIGEN_TEST_MSA) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmsa") - message(STATUS "Enabling MSA in tests/examples") - endif() - - option(EIGEN_TEST_NEON "Enable/Disable Neon in tests/examples" OFF) - if(EIGEN_TEST_NEON) - if(EIGEN_TEST_FMA) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon-vfpv4") - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon") - endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfloat-abi=hard") - message(STATUS "Enabling NEON in tests/examples") - endif() - - option(EIGEN_TEST_NEON64 "Enable/Disable Neon in tests/examples" OFF) - if(EIGEN_TEST_NEON64) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - message(STATUS "Enabling NEON in tests/examples") - endif() - - option(EIGEN_TEST_Z13 "Enable/Disable S390X(zEC13) ZVECTOR in tests/examples" OFF) - if(EIGEN_TEST_Z13) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=z13 -mzvector") - message(STATUS "Enabling S390X(zEC13) ZVECTOR in tests/examples") - endif() - - option(EIGEN_TEST_Z14 "Enable/Disable S390X(zEC14) ZVECTOR in tests/examples" OFF) - if(EIGEN_TEST_Z14) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=z14 -mzvector") - message(STATUS "Enabling S390X(zEC13) ZVECTOR in tests/examples") - endif() - - check_cxx_compiler_flag("-fopenmp" COMPILER_SUPPORT_OPENMP) - if(COMPILER_SUPPORT_OPENMP) - option(EIGEN_TEST_OPENMP "Enable/Disable OpenMP in tests/examples" OFF) - if(EIGEN_TEST_OPENMP) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") - message(STATUS "Enabling OpenMP in tests/examples") - endif() - endif() - -else() - - # C4127 - conditional expression is constant - # C4714 - marked as __forceinline not inlined (I failed to deactivate it selectively) - # We can disable this warning in the unit tests since it is clear that it occurs - # because we are oftentimes returning objects that have a destructor or may - # throw exceptions - in particular in the unit tests we are throwing extra many - # exceptions to cover indexing errors. - # C4505 - unreferenced local function has been removed (impossible to deactivate selectively) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /wd4127 /wd4505 /wd4714") - - # replace all /Wx by /W4 - string(REGEX REPLACE "/W[0-9]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - - check_cxx_compiler_flag("/openmp" COMPILER_SUPPORT_OPENMP) - if(COMPILER_SUPPORT_OPENMP) - option(EIGEN_TEST_OPENMP "Enable/Disable OpenMP in tests/examples" OFF) - if(EIGEN_TEST_OPENMP) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp") - message(STATUS "Enabling OpenMP in tests/examples") - endif() - endif() - - option(EIGEN_TEST_SSE2 "Enable/Disable SSE2 in tests/examples" OFF) - if(EIGEN_TEST_SSE2) - if(NOT CMAKE_CL_64) - # arch is not supported on 64 bit systems, SSE is enabled automatically. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2") - endif() - message(STATUS "Enabling SSE2 in tests/examples") - endif() - - option(EIGEN_TEST_AVX "Enable/Disable AVX in tests/examples" OFF) - if(EIGEN_TEST_AVX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX") - message(STATUS "Enabling AVX in tests/examples") - endif() - - option(EIGEN_TEST_FMA "Enable/Disable FMA/AVX2 in tests/examples" OFF) - option(EIGEN_TEST_AVX2 "Enable/Disable FMA/AVX2 in tests/examples" OFF) - if((EIGEN_TEST_FMA AND NOT EIGEN_TEST_NEON) OR EIGEN_TEST_AVX2) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX2") - message(STATUS "Enabling FMA/AVX2 in tests/examples") - endif() - - option(EIGEN_TEST_AVX512 "Enable/Disable AVX512 in tests/examples" OFF) - option(EIGEN_TEST_AVX512DQ "Enable/Disable AVX512DQ in tests/examples" OFF) - if(EIGEN_TEST_AVX512 OR EIGEN_TEST_AVX512DQ) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX512") - message(STATUS "Enabling AVX512 in tests/examples") - endif() - -endif() - -option(EIGEN_TEST_NO_EXPLICIT_VECTORIZATION "Disable explicit vectorization in tests/examples" OFF) -option(EIGEN_TEST_X87 "Force using X87 instructions. Implies no vectorization." OFF) -option(EIGEN_TEST_32BIT "Force generating 32bit code." OFF) - -if(EIGEN_TEST_X87) - set(EIGEN_TEST_NO_EXPLICIT_VECTORIZATION ON) - if(CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=387") - message(STATUS "Forcing use of x87 instructions in tests/examples") - else() - message(STATUS "EIGEN_TEST_X87 ignored on your compiler") - endif() -endif() - -if(EIGEN_TEST_32BIT) - if(CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") - message(STATUS "Forcing generation of 32-bit code in tests/examples") - else() - message(STATUS "EIGEN_TEST_32BIT ignored on your compiler") - endif() -endif() - -if(EIGEN_TEST_NO_EXPLICIT_VECTORIZATION) - add_definitions(-DEIGEN_DONT_VECTORIZE=1) - message(STATUS "Disabling vectorization in tests/examples") -endif() - -option(EIGEN_TEST_NO_EXPLICIT_ALIGNMENT "Disable explicit alignment (hence vectorization) in tests/examples" OFF) -if(EIGEN_TEST_NO_EXPLICIT_ALIGNMENT) - add_definitions(-DEIGEN_DONT_ALIGN=1) - message(STATUS "Disabling alignment in tests/examples") -endif() - -option(EIGEN_TEST_NO_EXCEPTIONS "Disables C++ exceptions" OFF) -if(EIGEN_TEST_NO_EXCEPTIONS) - ei_add_cxx_compiler_flag("-fno-exceptions") - message(STATUS "Disabling exceptions in tests/examples") -endif() - -set(EIGEN_CUDA_CXX_FLAGS "" CACHE STRING "Additional flags to pass to the cuda compiler.") -set(EIGEN_CUDA_COMPUTE_ARCH 30 CACHE STRING "The CUDA compute architecture(s) to target when compiling CUDA code") - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - -# Backward compatibility support for EIGEN_INCLUDE_INSTALL_DIR -if(EIGEN_INCLUDE_INSTALL_DIR) - message(WARNING "EIGEN_INCLUDE_INSTALL_DIR is deprecated. Use INCLUDE_INSTALL_DIR instead.") -endif() - -if(EIGEN_INCLUDE_INSTALL_DIR AND NOT INCLUDE_INSTALL_DIR) - set(INCLUDE_INSTALL_DIR ${EIGEN_INCLUDE_INSTALL_DIR} - CACHE PATH "The directory relative to CMAKE_INSTALL_PREFIX where Eigen header files are installed") -else() - set(INCLUDE_INSTALL_DIR - "${CMAKE_INSTALL_INCLUDEDIR}/eigen3" - CACHE PATH "The directory relative to CMAKE_INSTALL_PREFIX where Eigen header files are installed" - ) -endif() -set(CMAKEPACKAGE_INSTALL_DIR - "${CMAKE_INSTALL_DATADIR}/eigen3/cmake" - CACHE PATH "The directory relative to CMAKE_INSTALL_PREFIX where Eigen3Config.cmake is installed" - ) -set(PKGCONFIG_INSTALL_DIR - "${CMAKE_INSTALL_DATADIR}/pkgconfig" - CACHE PATH "The directory relative to CMAKE_INSTALL_PREFIX where eigen3.pc is installed" - ) - -foreach(var INCLUDE_INSTALL_DIR CMAKEPACKAGE_INSTALL_DIR PKGCONFIG_INSTALL_DIR) - # If an absolute path is specified, make it relative to "{CMAKE_INSTALL_PREFIX}". - if(IS_ABSOLUTE "${${var}}") - file(RELATIVE_PATH "${var}" "${CMAKE_INSTALL_PREFIX}" "${${var}}") - endif() -endforeach() - -install(FILES - signature_of_eigen3_matrix_library - DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel - ) - -if(EIGEN_BUILD_PKGCONFIG) - configure_file(eigen3.pc.in eigen3.pc @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc - DESTINATION ${PKGCONFIG_INSTALL_DIR} - ) -endif() - -install(DIRECTORY Eigen DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel) - - -option(EIGEN_BUILD_DOC "Enable creation of Eigen documentation" ON) -if(EIGEN_BUILD_DOC) - add_subdirectory(doc EXCLUDE_FROM_ALL) -endif() - - -cmake_dependent_option(BUILD_TESTING "Enable creation of tests." ON "PROJECT_IS_TOP_LEVEL" OFF) -option(EIGEN_BUILD_TESTING "Enable creation of Eigen tests." ${BUILD_TESTING}) -if(EIGEN_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) - endif() - - add_subdirectory(failtest) -endif() - -include(CMakeDetermineFortranCompiler) -option(EIGEN_BUILD_BLAS "Toggles the building of the Eigen Blas library" ${CMAKE_Fortran_COMPILER}) -option(EIGEN_BUILD_LAPACK "Toggles the building of the included Eigen LAPACK library" ${CMAKE_Fortran_COMPILER}) -if(EIGEN_LEAVE_TEST_IN_ALL_TARGET) - add_subdirectory(blas) - add_subdirectory(lapack) -else() - add_subdirectory(blas EXCLUDE_FROM_ALL) - add_subdirectory(lapack EXCLUDE_FROM_ALL) -endif() - -# add SYCL -option(EIGEN_TEST_SYCL "Add Sycl support." OFF) -option(EIGEN_SYCL_TRISYCL "Use the triSYCL Sycl implementation (ComputeCPP by default)." OFF) -if(EIGEN_TEST_SYCL) - set (CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules" "cmake/Modules/" "${CMAKE_MODULE_PATH}") - find_package(Threads REQUIRED) - if(EIGEN_SYCL_TRISYCL) - message(STATUS "Using triSYCL") - include(FindTriSYCL) - else() - message(STATUS "Using ComputeCPP SYCL") - include(FindComputeCpp) - set(COMPUTECPP_DRIVER_DEFAULT_VALUE OFF) - if (NOT MSVC) - set(COMPUTECPP_DRIVER_DEFAULT_VALUE ON) - endif() - option(COMPUTECPP_USE_COMPILER_DRIVER - "Use ComputeCpp driver instead of a 2 steps compilation" - ${COMPUTECPP_DRIVER_DEFAULT_VALUE} - ) - endif(EIGEN_SYCL_TRISYCL) - option(EIGEN_DONT_VECTORIZE_SYCL "Don't use vectorisation in the SYCL tests." OFF) - if(EIGEN_DONT_VECTORIZE_SYCL) - message(STATUS "Disabling SYCL vectorization in tests/examples") - # When disabling SYCL vectorization, also disable Eigen default vectorization - add_definitions(-DEIGEN_DONT_VECTORIZE=1) - add_definitions(-DEIGEN_DONT_VECTORIZE_SYCL=1) - endif() -endif() - -add_subdirectory(unsupported) - -add_subdirectory(demos EXCLUDE_FROM_ALL) - -# must be after test and unsupported, for configuring buildtests.in -add_subdirectory(scripts EXCLUDE_FROM_ALL) - -# TODO: consider also replacing EIGEN_BUILD_BTL by a custom target "make btl"? -if(EIGEN_BUILD_BTL) - add_subdirectory(bench/btl EXCLUDE_FROM_ALL) -endif() - -find_package(CLANG_FORMAT 9 EXACT) -if(CLANG_FORMAT_FOUND) -set(FORMAT_SOURCES) -list(APPEND FORMAT_SUBDIRS blas bench demos "doc" Eigen include lapack scripts share unsupported test failtest) -foreach(DIR ${FORMAT_SUBDIRS}) - set(ABS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${DIR}) - file(GLOB_RECURSE ${DIR}_SOURCES ${ABS_DIR}/*.cc ${ABS_DIR}/*.h ${ABS_DIR}/*.cpp ${ABS_DIR}/*.hpp ${ABS_DIR}/*.c) - list(APPEND FORMAT_SOURCES ${${DIR}_SOURCES}) - endforeach() - file(GLOB FORMAT_SOURCES_WITHOUTENDING LIST_DIRECTORIES false ${CMAKE_CURRENT_SOURCE_DIR}/Eigen/* ${CMAKE_CURRENT_SOURCE_DIR}/Eigen/CXX11/* ${CMAKE_CURRENT_SOURCE_DIR}/unsupported/Eigen/* ${CMAKE_CURRENT_SOURCE_DIR}/unsupported/Eigen/CXX11/*) - list(FILTER FORMAT_SOURCES_WITHOUTENDING EXCLUDE REGEX ".*.txt$") - list (APPEND FORMAT_SOURCES ${FORMAT_SOURCES_WITHOUTENDING}) - add_custom_target(format - COMMAND ${CLANG_FORMAT_EXECUTABLE} -i -style=file ${FORMAT_SOURCES} - DEPENDS ${FORMAT_SOURCES}) -endif() - -if(NOT WIN32 AND EIGEN_BUILD_SPBENCH) - add_subdirectory(bench/spbench EXCLUDE_FROM_ALL) -endif() - -configure_file(scripts/cdashtesting.cmake.in cdashtesting.cmake @ONLY) - -if(EIGEN_BUILD_TESTING) - ei_testing_print_summary() -endif() - -message(STATUS "") -message(STATUS "Configured Eigen ${EIGEN_VERSION_NUMBER}") -message(STATUS "") - -if(PROJECT_IS_TOP_LEVEL) - string(TOLOWER "${CMAKE_GENERATOR}" cmake_generator_tolower) - if(cmake_generator_tolower MATCHES "makefile") - message(STATUS "Available targets (use: make TARGET):") - else() - message(STATUS "Available targets (use: cmake --build . --target TARGET):") - endif() - message(STATUS "---------+--------------------------------------------------------------") - message(STATUS "Target | Description") - message(STATUS "---------+--------------------------------------------------------------") - message(STATUS "install | Install Eigen. Headers will be installed to:") - message(STATUS " | <CMAKE_INSTALL_PREFIX>/<INCLUDE_INSTALL_DIR>") - message(STATUS " | Using the following values:") - message(STATUS " | CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") - message(STATUS " | INCLUDE_INSTALL_DIR: ${INCLUDE_INSTALL_DIR}") - message(STATUS " | Change the install location of Eigen headers using:") - message(STATUS " | cmake . -DCMAKE_INSTALL_PREFIX=yourprefix") - message(STATUS " | Or:") - message(STATUS " | cmake . -DINCLUDE_INSTALL_DIR=yourdir") - message(STATUS "doc | Generate the API documentation, requires Doxygen & LaTeX") - if(EIGEN_BUILD_TESTING) - message(STATUS "check | Build and run the unit-tests. Read this page:") - message(STATUS " | http://eigen.tuxfamily.org/index.php?title=Tests") - endif() - if(CLANG_FORMAT_FOUND) - message(STATUS "format | Formats the source code according to .clang-format file") - endif() - message(STATUS "blas | Build BLAS library (not the same thing as Eigen)") - message(STATUS "uninstall| Remove files installed by the install target") - message(STATUS "---------+--------------------------------------------------------------") - message(STATUS "") -endif() - -set ( EIGEN_VERSION_STRING ${EIGEN_VERSION_NUMBER} ) -set ( EIGEN_VERSION_MAJOR ${EIGEN_WORLD_VERSION} ) -set ( EIGEN_VERSION_MINOR ${EIGEN_MAJOR_VERSION} ) -set ( EIGEN_VERSION_PATCH ${EIGEN_MINOR_VERSION} ) - -include (CMakePackageConfigHelpers) - -# Imported target support -add_library (eigen INTERFACE) -add_library (Eigen3::Eigen ALIAS eigen) -target_include_directories (eigen INTERFACE - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> - $<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}> -) - -# Export as title case Eigen -set_target_properties (eigen PROPERTIES EXPORT_NAME Eigen) - -install (TARGETS eigen EXPORT Eigen3Targets) - -option(EIGEN_BUILD_CMAKE_PACKAGE "Enables the creation of EigenConfig.cmake and related files" ON) -if(EIGEN_BUILD_CMAKE_PACKAGE) -configure_package_config_file ( - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Eigen3Config.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake - INSTALL_DESTINATION ${CMAKEPACKAGE_INSTALL_DIR} - NO_SET_AND_CHECK_MACRO # Eigen does not provide legacy style defines - NO_CHECK_REQUIRED_COMPONENTS_MACRO # Eigen does not provide components -) - -# NOTE Remove the first code path once the minimum required CMake version is -# bumped to 3.14 or above. -if (CMAKE_VERSION VERSION_LESS 3.14) - # Remove CMAKE_SIZEOF_VOID_P from Eigen3ConfigVersion.cmake since Eigen does - # not depend on architecture specific settings or libraries. More - # specifically, an Eigen3Config.cmake generated from a 64 bit target can be - # used for 32 bit targets as well (and vice versa). - 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) - set (CMAKE_SIZEOF_VOID_P ${_Eigen3_CMAKE_SIZEOF_VOID_P}) -else (CMAKE_VERSION VERSION_LESS 3.14) - write_basic_package_version_file (Eigen3ConfigVersion.cmake - VERSION ${EIGEN_VERSION_NUMBER} - COMPATIBILITY SameMajorVersion - ARCH_INDEPENDENT) -endif (CMAKE_VERSION VERSION_LESS 3.14) - -# The Eigen target will be located in the Eigen3 namespace. Other CMake -# targets can refer to it using Eigen3::Eigen. -export (TARGETS eigen NAMESPACE Eigen3:: FILE Eigen3Targets.cmake) -# Export Eigen3 package to CMake registry such that it can be easily found by -# 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 - DESTINATION ${CMAKEPACKAGE_INSTALL_DIR}) - -# Add uninstall target -if(NOT TARGET uninstall) - add_custom_target ( uninstall - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/EigenUninstall.cmake) -endif() -endif() - -if (EIGEN_SPLIT_TESTSUITE) - ei_split_testsuite("${EIGEN_SPLIT_TESTSUITE}") -endif()
diff --git a/COPYING.APACHE b/COPYING.APACHE deleted file mode 100644 index 61e948d..0000000 --- a/COPYING.APACHE +++ /dev/null
@@ -1,203 +0,0 @@ -/* - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ \ No newline at end of file
diff --git a/COPYING.BSD b/COPYING.BSD deleted file mode 100644 index 8964ddf..0000000 --- a/COPYING.BSD +++ /dev/null
@@ -1,26 +0,0 @@ -/* - Copyright (c) 2011, Intel Corporation. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of Intel Corporation nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/
diff --git a/COPYING.MINPACK b/COPYING.MINPACK deleted file mode 100644 index 132cc3f..0000000 --- a/COPYING.MINPACK +++ /dev/null
@@ -1,51 +0,0 @@ -Minpack Copyright Notice (1999) University of Chicago. All rights reserved - -Redistribution and use in source and binary forms, with or -without modification, are permitted provided that the -following conditions are met: - -1. Redistributions of source code must retain the above -copyright notice, this list of conditions and the following -disclaimer. - -2. Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following -disclaimer in the documentation and/or other materials -provided with the distribution. - -3. The end-user documentation included with the -redistribution, if any, must include the following -acknowledgment: - - "This product includes software developed by the - University of Chicago, as Operator of Argonne National - Laboratory. - -Alternately, this acknowledgment may appear in the software -itself, if and wherever such third-party acknowledgments -normally appear. - -4. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" -WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE -UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND -THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE -OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY -OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR -USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF -THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) -DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION -UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL -BE CORRECTED. - -5. LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT -HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF -ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, -INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF -ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF -PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER -SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT -(INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, -EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE -POSSIBILITY OF SUCH LOSS OR DAMAGES.
diff --git a/COPYING.MPL2 b/COPYING.MPL2 deleted file mode 100644 index ee6256c..0000000 --- a/COPYING.MPL2 +++ /dev/null
@@ -1,373 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at https://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0.
diff --git a/COPYING.README b/COPYING.README deleted file mode 100644 index de5b632..0000000 --- a/COPYING.README +++ /dev/null
@@ -1,18 +0,0 @@ -Eigen is primarily MPL2 licensed. See COPYING.MPL2 and these links: - http://www.mozilla.org/MPL/2.0/ - http://www.mozilla.org/MPL/2.0/FAQ.html - -Some files contain third-party code under BSD or LGPL licenses, whence the other -COPYING.* files here. - -All the LGPL code is either LGPL 2.1-only, or LGPL 2.1-or-later. -For this reason, the COPYING.LGPL file contains the LGPL 2.1 text. - -If you want to guarantee that the Eigen code that you are #including is licensed -under the MPL2 and possibly more permissive licenses (like BSD), #define this -preprocessor symbol: - EIGEN_MPL2_ONLY -For example, with most compilers, you could add this to your project CXXFLAGS: - -DEIGEN_MPL2_ONLY -This will cause a compilation error to be generated if you #include any code that is -LGPL licensed.
diff --git a/CTestConfig.cmake b/CTestConfig.cmake deleted file mode 100644 index 0ea24b8..0000000 --- a/CTestConfig.cmake +++ /dev/null
@@ -1,17 +0,0 @@ -## This file should be placed in the root directory of your project. -## Then modify the CMakeLists.txt file in the root directory of your -## project to incorporate the testing dashboard. -## # The following are required to uses Dart and the Cdash dashboard -## enable_testing() -## include(CTest) -set(CTEST_PROJECT_NAME "Eigen") -set(CTEST_NIGHTLY_START_TIME "00:00:00 UTC") - -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "my.cdash.org") -set(CTEST_DROP_LOCATION "/submit.php?project=Eigen") -set(CTEST_DROP_SITE_CDASH TRUE) -#set(CTEST_PROJECT_SUBPROJECTS -#Official -#Unsupported -#)
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in deleted file mode 100644 index 89e487f..0000000 --- a/CTestCustom.cmake.in +++ /dev/null
@@ -1,4 +0,0 @@ - -set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "2000") -set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS "2000") -list(APPEND CTEST_CUSTOM_ERROR_EXCEPTION @EIGEN_CTEST_ERROR_EXCEPTION@)
diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 4f717e9..0000000 --- a/INSTALL +++ /dev/null
@@ -1,35 +0,0 @@ -Installation instructions for Eigen -*********************************** - -Explanation before starting -*************************** - -Eigen consists only of header files, hence there is nothing to compile -before you can use it. Moreover, these header files do not depend on your -platform, they are the same for everybody. - -Method 1. Installing without using CMake -**************************************** - -You can use right away the headers in the Eigen/ subdirectory. In order -to install, just copy this Eigen/ subdirectory to your favorite location. -If you also want the unsupported features, copy the unsupported/ -subdirectory too. - -Method 2. Installing using CMake -******************************** - -Let's call this directory 'source_dir' (where this INSTALL file is). -Before starting, create another directory which we will call 'build_dir'. - -Do: - - cd build_dir - cmake source_dir - make install - -The "make install" step may require administrator privileges. - -You can adjust the installation destination (the "prefix") -by passing the -DCMAKE_INSTALL_PREFIX=myprefix option to cmake, as is -explained in the message that cmake prints at the end.
diff --git a/blas/testing/runblastest.sh b/blas/testing/runblastest.sh new file mode 100755 index 0000000..2577ef9 --- /dev/null +++ b/blas/testing/runblastest.sh
@@ -0,0 +1,47 @@ +#!/bin/bash +# SPDX-FileCopyrightText: The Eigen Authors +# SPDX-License-Identifier: MPL-2.0 + +black='\E[30m' +red='\E[31m' +green='\E[32m' +yellow='\E[33m' +blue='\E[34m' +magenta='\E[35m' +cyan='\E[36m' +white='\E[37m' + +if [ -f $2 ]; then + data=$2 + if [ -f $1.summ ]; then rm $1.summ; fi + if [ -f $1.snap ]; then rm $1.snap; fi +else + data=$1 +fi + +if ! ./$1 < $data > /dev/null 2> .runtest.log ; then + echo -e $red Test $1 failed: $black + echo -e $blue + cat .runtest.log + echo -e $black + exit 1 +else + if [ -f $1.summ ]; then + if [ `grep "FATAL ERROR" $1.summ | wc -l` -gt 0 ]; then + echo -e $red "Test $1 failed (FATAL ERROR, read the file $1.summ for details)" $black + echo -e $blue + cat .runtest.log + echo -e $black + exit 1; + fi + + if [ `grep "FAILED THE TESTS OF ERROR-EXITS" $1.summ | wc -l` -gt 0 ]; then + echo -e $red "Test $1 failed (FAILED THE TESTS OF ERROR-EXITS, read the file $1.summ for details)" $black + echo -e $blue + cat .runtest.log + echo -e $black + exit 1; + fi + fi + echo -e $green Test $1 passed$black +fi
diff --git a/debug/gdb/__init__.py b/debug/gdb/__init__.py deleted file mode 100644 index 7dcb21d..0000000 --- a/debug/gdb/__init__.py +++ /dev/null
@@ -1,3 +0,0 @@ -# Intentionally empty -# SPDX-FileCopyrightText: The Eigen Authors -# SPDX-License-Identifier: MPL-2.0
diff --git a/debug/gdb/printers.py b/debug/gdb/printers.py deleted file mode 100644 index ca9e013..0000000 --- a/debug/gdb/printers.py +++ /dev/null
@@ -1,339 +0,0 @@ -# -*- coding: utf-8 -*- -# This file is part of Eigen, a lightweight C++ template library -# for linear algebra. -# -# Copyright (C) 2009 Benjamin Schindler <bschindler@inf.ethz.ch> -# -# This Source Code Form is subject to the terms of the Mozilla 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/. -# SPDX-License-Identifier: MPL-2.0 - -# Pretty printers for Eigen::Matrix -# This is still pretty basic as the python extension to gdb is still pretty basic. -# It cannot handle complex eigen types and it doesn't support many of the other eigen types -# This code supports fixed size as well as dynamic size matrices - -# To use it: -# -# * Create a directory and put the file as well as an empty __init__.py in -# that directory. -# * Create a ~/.gdbinit file, that contains the following: -# python -# import sys -# sys.path.insert(0, '/path/to/eigen/printer/directory') -# from printers import register_eigen_printers -# register_eigen_printers(None) -# end - -import gdb -import re -from bisect import bisect_left - - -# Basic row/column iteration code for use with Sparse and Dense matrices -class _MatrixEntryIterator(object): - - def __init__(self, rows, cols, row_major): - self.rows = rows - self.cols = cols - self.currentRow = 0 - self.currentCol = 0 - self.rowMajor = row_major - - def __iter__(self): - return self - - def next(self): - return self.__next__() # Python 2.x compatibility - - def __next__(self): - row = self.currentRow - col = self.currentCol - if self.rowMajor == 0: - if self.currentCol >= self.cols: - raise StopIteration - - self.currentRow += 1 - if self.currentRow >= self.rows: - self.currentRow = 0 - self.currentCol += 1 - else: - if self.currentRow >= self.rows: - raise StopIteration - - self.currentCol += 1 - if self.currentCol >= self.cols: - self.currentCol = 0 - self.currentRow += 1 - - return row, col - - -class EigenMatrixPrinter: - """Print Eigen Matrix or Array of some kind""" - - def __init__(self, variety, val): - """Extract all the necessary information""" - - # Save the variety (presumably "Matrix" or "Array") for later usage - self.variety = variety - - # The gdb extension does not support value template arguments - need to extract them by hand - typeinfo = val.type - if typeinfo.code == gdb.TYPE_CODE_REF: - typeinfo = typeinfo.target() - self.type = typeinfo.unqualified().strip_typedefs() - tag = self.type.tag - regex = re.compile('<.*>') - m = regex.findall(tag)[0][1:-1] - template_params = m.split(',') - template_params = [x.replace(" ", "") for x in template_params] - - if template_params[1] in ['-0x00000000000000001', '-0x000000001', '-1']: - self.rows = val['m_storage']['m_rows'] - else: - self.rows = int(template_params[1]) - - if template_params[2] in ['-0x00000000000000001', '-0x000000001', '-1']: - self.cols = val['m_storage']['m_cols'] - else: - self.cols = int(template_params[2]) - - self.options = 0 # default value - if len(template_params) > 3: - self.options = template_params[3] - - self.rowMajor = (int(self.options) & 0x1) - - self.innerType = self.type.template_argument(0) - - self.val = val - - # Fixed size matrices have a struct as their storage, so we need to walk through this - self.data = self.val['m_storage']['m_data'] - if self.data.type.code == gdb.TYPE_CODE_STRUCT: - self.data = self.data['array'] - self.data = self.data.cast(self.innerType.pointer()) - - class _Iterator(_MatrixEntryIterator): - def __init__(self, rows, cols, data_ptr, row_major): - super(EigenMatrixPrinter._Iterator, self).__init__(rows, cols, row_major) - - self.dataPtr = data_ptr - - def __next__(self): - row, col = super(EigenMatrixPrinter._Iterator, self).__next__() - - item = self.dataPtr.dereference() - self.dataPtr += 1 - if self.cols == 1: # if it's a column vector - return '[%d]' % (row,), item - elif self.rows == 1: # if it's a row vector - return '[%d]' % (col,), item - return '[%d,%d]' % (row, col), item - - def children(self): - return self._Iterator(self.rows, self.cols, self.data, self.rowMajor) - - def to_string(self): - return "Eigen::%s<%s,%d,%d,%s> (data ptr: %s)" % ( - self.variety, self.innerType, self.rows, self.cols, - "RowMajor" if self.rowMajor else "ColMajor", self.data) - - -class EigenSparseMatrixPrinter: - """Print an Eigen SparseMatrix""" - - def __init__(self, val): - """Extract all the necessary information""" - - typeinfo = val.type - if typeinfo.code == gdb.TYPE_CODE_REF: - typeinfo = typeinfo.target() - self.type = typeinfo.unqualified().strip_typedefs() - tag = self.type.tag - regex = re.compile('<.*>') - m = regex.findall(tag)[0][1:-1] - template_params = m.split(',') - template_params = [x.replace(" ", "") for x in template_params] - - self.options = 0 - if len(template_params) > 1: - self.options = template_params[1] - - self.rowMajor = (int(self.options) & 0x1) - - self.innerType = self.type.template_argument(0) - - self.val = val - - self.data = self.val['m_data'] - self.data = self.data.cast(self.innerType.pointer()) - - class _Iterator(_MatrixEntryIterator): - def __init__(self, rows, cols, val, row_major): - super(EigenSparseMatrixPrinter._Iterator, self).__init__(rows, cols, row_major) - - self.val = val - - def __next__(self): - row, col = super(EigenSparseMatrixPrinter._Iterator, self).__next__() - - # repeat calculations from SparseMatrix.h: - outer = row if self.rowMajor else col - inner = col if self.rowMajor else row - start = self.val['m_outerIndex'][outer] - end = ( - (start + self.val['m_innerNonZeros'][outer]) - if self.val['m_innerNonZeros'] else self.val['m_outerIndex'][outer+1] - ) - - # and from CompressedStorage.h: - data = self.val['m_data'] - if start >= end: - item = 0 - elif (end > start) and (inner == data['m_indices'][end-1]): - item = data['m_values'][end-1] - else: - # create Python index list from the target range within m_indices - indices = [data['m_indices'][x] for x in range(int(start), int(end)-1)] - # find the index with binary search - idx = int(start) + bisect_left(indices, inner) - if idx < end and data['m_indices'][idx] == inner: - item = data['m_values'][idx] - else: - item = 0 - - return '[%d,%d]' % (row, col), item - - def children(self): - if self.data: - return self._Iterator(self.rows(), self.cols(), self.val, self.rowMajor) - - return iter([]) # empty matrix, for now - - def rows(self): - return self.val['m_outerSize'] if self.rowMajor else self.val['m_innerSize'] - - def cols(self): - return self.val['m_innerSize'] if self.rowMajor else self.val['m_outerSize'] - - def to_string(self): - - if self.data: - status = ("not compressed" if self.val['m_innerNonZeros'] else "compressed") - else: - status = "empty" - dimensions = "%d x %d" % (self.rows(), self.cols()) - layout = "row" if self.rowMajor else "column" - - return "Eigen::SparseMatrix<%s>, %s, %s major, %s" % ( - self.innerType, dimensions, layout, status) - - -class EigenQuaternionPrinter: - """Print an Eigen Quaternion""" - - def __init__(self, val): - """Extract all the necessary information""" - # The gdb extension does not support value template arguments - need to extract them by hand - typeinfo = val.type - if typeinfo.code == gdb.TYPE_CODE_REF: - typeinfo = typeinfo.target() - self.type = typeinfo.unqualified().strip_typedefs() - self.innerType = self.type.template_argument(0) - self.val = val - - # Quaternions have a struct as their storage, so we need to walk through this - self.data = self.val['m_coeffs']['m_storage']['m_data']['array'] - self.data = self.data.cast(self.innerType.pointer()) - - class _Iterator: - def __init__(self, data_ptr): - self.dataPtr = data_ptr - self.currentElement = 0 - self.elementNames = ['x', 'y', 'z', 'w'] - - def __iter__(self): - return self - - def next(self): - return self.__next__() # Python 2.x compatibility - - def __next__(self): - element = self.currentElement - - if self.currentElement >= 4: # there are 4 elements in a quaternion - raise StopIteration - - self.currentElement += 1 - - item = self.dataPtr.dereference() - self.dataPtr += 1 - return '[%s]' % (self.elementNames[element],), item - - def children(self): - return self._Iterator(self.data) - - def to_string(self): - return "Eigen::Quaternion<%s> (data ptr: %s)" % (self.innerType, self.data) - - -def cast_eigen_block_to_matrix(val): - # Get the type of the variable (and convert to a string) - # Example: 'const Eigen::Block<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, -1, -1, false> const, -1, -1, false>' - val_type = str(val.type) - - # Extract the Eigen::Matrix type from the Block: - # From the previous example: Eigen::Matrix<double, -1, -1, 0, -1, -1> - begin = val_type.find('Eigen::Matrix<') - end = val_type.find('>', begin) + 1 - - # Convert the Eigen::Block to an Eigen::Matrix - return val.cast(gdb.lookup_type(val_type[begin:end])) - - -def build_eigen_dictionary(): - pretty_printers_dict[re.compile('^Eigen::Quaternion<.*>$')] = lambda val: EigenQuaternionPrinter(val) - pretty_printers_dict[re.compile('^Eigen::Matrix<.*>$')] = lambda val: EigenMatrixPrinter("Matrix", val) - pretty_printers_dict[re.compile('^Eigen::Block<.*>$')] =\ - lambda val: EigenMatrixPrinter("Matrix", cast_eigen_block_to_matrix(val)) - pretty_printers_dict[re.compile('^Eigen::VectorBlock<.*>$')] =\ - lambda val: EigenMatrixPrinter("Matrix", cast_eigen_block_to_matrix(val)) - pretty_printers_dict[re.compile('^Eigen::SparseMatrix<.*>$')] = lambda val: EigenSparseMatrixPrinter(val) - pretty_printers_dict[re.compile('^Eigen::Array<.*>$')] = lambda val: EigenMatrixPrinter("Array", val) - - -def register_eigen_printers(obj): - """Register eigen pretty-printers with objfile Obj""" - - if obj is None: - obj = gdb - obj.pretty_printers.append(lookup_function) - - -def lookup_function(val): - """Look-up and return a pretty-printer that can print val.""" - - typeinfo = val.type - - if typeinfo.code == gdb.TYPE_CODE_REF: - typeinfo = typeinfo.target() - - typeinfo = typeinfo.unqualified().strip_typedefs() - - typename = typeinfo.tag - if typename is None: - return None - - for function in pretty_printers_dict: - if function.search(typename): - return pretty_printers_dict[function](val) - - return None - - -pretty_printers_dict = {} - -build_eigen_dictionary()
diff --git a/debug/lldb/eigenlldb.py b/debug/lldb/eigenlldb.py deleted file mode 100644 index 776545e..0000000 --- a/debug/lldb/eigenlldb.py +++ /dev/null
@@ -1,272 +0,0 @@ -# -*- coding: utf-8 -*- -# This file is part of Eigen, a lightweight C++ template library -# for linear algebra. -# -# Copyright (C) 2021 Huang, Zhaoquan <zhaoquan2008@hotmail.com> -# Copyright (C) 2025 Prince Mathew, Joseph <josephrpincemathew@outlook.com -# -# This Source Code Form is subject to the terms of the Mozilla 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/. -# SPDX-License-Identifier: MPL-2.0 - -# Pretty printers for Eigen::Matrix to use with LLDB debugger -# -# Usage: -# 1. Add the following line (change it according to the path to this file) -# to the file ~/.lldbinit (create one if it doesn't exist): -# `command script import /path/to/eigenlldb.py` -# 2. Inspect the variables in LLDB command line -# `frame variable` - -import lldb -from typing import List -import bisect - - -def __lldb_init_module(debugger, internal_dict): - debugger.HandleCommand( - "type synthetic add -x ^Eigen::Matrix<.*> --python-class eigenlldb.EigenMatrixChildProvider") - debugger.HandleCommand( - "type summary add -e -x ^Eigen::Matrix<.*> --python-function eigenlldb.eigen_matrix_summary_provider") - debugger.HandleCommand( - "type synthetic add -x ^Eigen::SparseMatrix<.*> --python-class eigenlldb.EigenSparseMatrixChildProvider") - -class EigenMatrixProvider: - def __init__(self, valobj: lldb.SBValue, internal_dict): - - if valobj.IsSynthetic(): - self._valobj: lldb.SBValue = valobj.GetNonSyntheticValue() - else: - self._valobj: lldb.SBValue = valobj - - _valtype = self._valobj.GetType().GetCanonicalType() - - scalar_type = _valtype.GetTemplateArgumentType(0) - if not scalar_type.IsValid(): - # In the case that scalar_type is invalid on LLDB 9.0 on Windows with CLion - storage = self._valobj.GetChildMemberWithName("m_storage") - data = storage.GetChildMemberWithName("m_data") - data_type = data.GetType() - if data_type.IsPointerType(): - scalar_type = data.GetType().GetPointeeType() - else: - scalar_type = data.GetChildMemberWithName("array").GetType().GetArrayElementType() - self._scalar_type: lldb.SBType = scalar_type - self._scalar_size: int = self._scalar_type.GetByteSize() - - name = _valtype.GetName() - template_begin = name.find("<") - template_end = name.rfind(">") - template_args = name[(template_begin + 1):template_end].split(",") - - template_args = [arg.strip() for arg in template_args] - - # Provide default values for missing template arguments - # Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> - try: - self._rows_compile_time: int = int(template_args[1]) if len(template_args) > 1 else -1 - except (ValueError, IndexError): - self._rows_compile_time: int = -1 - - try: - self._cols_compile_time: int = int(template_args[2]) if len(template_args) > 2 else -1 - except (ValueError, IndexError): - self._cols_compile_time: int = -1 - - try: - self._options: int = int(template_args[3]) if len(template_args) > 3 else 0 - self._row_major: bool = (self._options & 1) != 0 - except (ValueError, IndexError): - self._options = 0 - self._row_major: bool = False - - try: - max_rows = int(template_args[4]) if len(template_args) > 4 else self._rows_compile_time - except (ValueError, IndexError): - max_rows = self._rows_compile_time - - try: - max_cols = int(template_args[5]) if len(template_args) > 5 else self._cols_compile_time - except (ValueError, IndexError): - max_cols = self._cols_compile_time - - self._fixed_storage: bool = (max_rows != -1 and max_cols != -1) - - def _cols(self): - if self._cols_compile_time == -1: - storage = self._valobj.GetChildMemberWithName("m_storage") - cols = storage.GetChildMemberWithName("m_cols").GetValueAsUnsigned() - return cols - else: - return self._cols_compile_time - - def _rows(self): - if self._rows_compile_time == -1: - storage = self._valobj.GetChildMemberWithName("m_storage") - rows = storage.GetChildMemberWithName("m_rows").GetValueAsUnsigned() - return rows - else: - return self._rows_compile_time - def get_summary(self): - if self._rows() == 0 or self._cols() == 0: - return f"size=[0x0, order={'row_major' if self._row_major else 'column_major'}]" - else: - return f"size=[{self._rows()}x{self._cols()}, order={'row_major' if self._row_major else 'column_major'}] " - - -def eigen_matrix_summary_provider(valobj, dict): - prov = EigenMatrixProvider(valobj, dict) - return prov.get_summary() - -class EigenMatrixChildProvider(EigenMatrixProvider): - - def num_children(self): - return self._cols() * self._rows() - - def get_child_index(self, name): - pass - - def get_child_at_index(self, index): - storage = self._valobj.GetChildMemberWithName("m_storage") - data = storage.GetChildMemberWithName("m_data") - offset = self._scalar_size * index - - if self._row_major: - row = index // self._cols() - col = index % self._cols() - else: - row = index % self._rows() - col = index // self._rows() - if self._fixed_storage: - data = data.GetChildMemberWithName("array") - if self._cols() == 1: - name = '[{}]'.format(row) - elif self._rows() == 1: - name = '[{}]'.format(col) - else: - name = '[{},{}]'.format(row, col) - return data.CreateChildAtOffset( - name, offset, self._scalar_type - ) - -class EigenSparseMatrixChildProvider: - _valobj: lldb.SBValue - _scalar_type: lldb.SBType - _scalar_size: int - _index_type: lldb.SBType - _index_size: int - _row_major: bool - - _outer_size: int - _nnz: int - _values: lldb.SBValue - _inner_indices: lldb.SBValue - _outer_starts: lldb.SBValue - _inner_nnzs: lldb.SBValue - _compressed: bool - - # Index of the first synthetic child under each outer index - _child_indices: List[int] - - def __init__(self, valobj, internal_dict): - self._valobj = valobj - valtype = valobj.GetType().GetCanonicalType() - scalar_type = valtype.GetTemplateArgumentType(0) - if not scalar_type.IsValid(): - # In the case that scalar_type is invalid on LLDB 9.0 on Windows with CLion - data = valobj.GetChildMemberWithName("m_data") - values = data.GetChildMemberWithName("m_values") - scalar_type = values.GetType().GetPointeeType() - self._scalar_type = scalar_type - self._scalar_size = scalar_type.GetByteSize() - - index_type = valtype.GetTemplateArgumentType(2) - if not index_type.IsValid(): - # In the case that scalar_type is invalid on LLDB 9.0 on Windows with CLion - outer_starts = valobj.GetChildMemberWithName("m_outerIndex") - index_type = outer_starts.GetType().GetPointeeType() - self._index_type = index_type - self._index_size = index_type.GetByteSize() - - name = valtype.GetName() - template_begin = name.find("<") - template_end = name.find(">") - template_args = name[(template_begin + 1):template_end].split(",") - self._row_major = (int(template_args[1]) & 1) != 0 - - def num_children(self): - return self._nnz + 2 - - def get_child_index(self, name): - pass - - def get_child_at_index(self, index): - if index == 0: - name = "rows" if self._row_major else "cols" - return self._valobj.GetChildMemberWithName("m_outerSize") \ - .CreateChildAtOffset(name, 0, self._index_type) - elif index == 1: - name = "cols" if self._row_major else "rows" - return self._valobj.GetChildMemberWithName("m_innerSize") \ - .CreateChildAtOffset(name, 0, self._index_type) - else: - index = index - 2 - outer_index = bisect.bisect_right(self._child_indices, index) - 1 - total_nnzs = self._child_indices[outer_index] - if self._compressed: - item_index = index - inner_index = self._inner_indices \ - .CreateChildAtOffset("", item_index * self._index_size, self._index_type) \ - .GetValueAsUnsigned() - return self._values \ - .CreateChildAtOffset(self._child_name(outer_index, inner_index), - item_index * self._scalar_size, - self._scalar_type) - else: - index_begin = self._outer_starts \ - .CreateChildAtOffset("", outer_index * self._index_size, self._index_type) \ - .GetValueAsUnsigned() - item_index = index - total_nnzs + index_begin - inner_index = self._inner_indices \ - .CreateChildAtOffset("", item_index * self._index_size, self._index_type) \ - .GetValueAsUnsigned() - return self._values \ - .CreateChildAtOffset(self._child_name(outer_index, inner_index), - item_index * self._scalar_size, - self._scalar_type) - - def update(self): - valobj = self._valobj - self._outer_size = valobj.GetChildMemberWithName("m_outerSize").GetValueAsUnsigned() - data = valobj.GetChildMemberWithName("m_data") - self._values = data.GetChildMemberWithName("m_values") - self._inner_indices = data.GetChildMemberWithName("m_indices") - self._outer_starts = valobj.GetChildMemberWithName("m_outerIndex") - self._inner_nnzs = valobj.GetChildMemberWithName("m_innerNonZeros") - - self._compressed = self._inner_nnzs.GetValueAsUnsigned() == 0 - - total_nnzs = 0 - child_indices = [0] - for outer_index in range(self._outer_size): - if self._compressed: - index_end = self._outer_starts \ - .CreateChildAtOffset("", (outer_index + 1) * self._index_size, self._index_type) \ - .GetValueAsUnsigned() - total_nnzs = index_end - child_indices.append(total_nnzs) - else: - nnzs = self._inner_nnzs \ - .CreateChildAtOffset("", outer_index * self._index_size, self._index_type) \ - .GetValueAsUnsigned() - total_nnzs = total_nnzs + nnzs - child_indices.append(total_nnzs) - self._child_indices = child_indices - self._nnz = total_nnzs - - def _child_name(self, outer_index, inner_index): - if self._row_major: - return "[{0},{1}]".format(outer_index, inner_index) - else: - return "[{1},{0}]".format(outer_index, inner_index)
diff --git a/debug/msvc/eigen.natvis b/debug/msvc/eigen.natvis deleted file mode 100644 index da89857..0000000 --- a/debug/msvc/eigen.natvis +++ /dev/null
@@ -1,235 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> - - <!-- Fixed x Fixed Matrix --> - <Type Name="Eigen::Matrix<*,*,*,*,*,*>"> - <AlternativeType Name="Eigen::Array<*,-1,-1,*,*,*>"/> - <DisplayString>[{$T2}, {$T3}] (fixed matrix)</DisplayString> - <Expand> - <ArrayItems Condition="Flags%2"> <!-- row major layout --> - <Rank>2</Rank> - <Size>$i==0 ? $T2 : $T3</Size> - <ValuePointer>m_storage.m_data.array</ValuePointer> - </ArrayItems> - <ArrayItems Condition="!(Flags%2)"> <!-- column major layout --> - <Direction>Backward</Direction> - <Rank>2</Rank> - <Size>$i==0 ? $T2 : $T3</Size> - <ValuePointer>m_storage.m_data.array</ValuePointer> - </ArrayItems> - </Expand> - </Type> - - <!-- 2 x 2 Matrix --> - <Type Name="Eigen::Matrix<*,2,2,*,*,*>"> - <AlternativeType Name="Eigen::Array<*,2,2,*,*,*>"/> - <DisplayString>[2, 2] (fixed matrix)</DisplayString> - <Expand> - <Synthetic Name="[row 0]" Condition="Flags%2"> - <DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 0]" Condition="!(Flags%2)"> - <DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[2]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 1]" Condition="Flags%2"> - <DisplayString>({m_storage.m_data.array[2]}, {m_storage.m_data.array[3]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 1]" Condition="!(Flags%2)"> - <DisplayString>({m_storage.m_data.array[1]}, {m_storage.m_data.array[3]})</DisplayString> - </Synthetic> - </Expand> - </Type> - - <!-- 3 x 3 Matrix --> - <Type Name="Eigen::Matrix<*,3,3,*,*,*>"> - <AlternativeType Name="Eigen::Array<*,3,3,*,*,*>"/> - <DisplayString>[3, 3] (fixed matrix)</DisplayString> - <Expand> - <Synthetic Name="[row 0]" Condition="Flags%2"> - <DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]}, {m_storage.m_data.array[2]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 0]" Condition="!(Flags%2)"> - <DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[3]}, {m_storage.m_data.array[6]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 1]" Condition="Flags%2"> - <DisplayString>({m_storage.m_data.array[3]}, {m_storage.m_data.array[4]}, {m_storage.m_data.array[5]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 1]" Condition="!(Flags%2)"> - <DisplayString>({m_storage.m_data.array[1]}, {m_storage.m_data.array[4]}, {m_storage.m_data.array[7]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 2]" Condition="Flags%2"> - <DisplayString>({m_storage.m_data.array[6]}, {m_storage.m_data.array[7]}, {m_storage.m_data.array[8]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 2]" Condition="!(Flags%2)"> - <DisplayString>({m_storage.m_data.array[2]}, {m_storage.m_data.array[5]}, {m_storage.m_data.array[8]})</DisplayString> - </Synthetic> - </Expand> - </Type> - - <!-- 4 x 4 Matrix --> - <Type Name="Eigen::Matrix<*,4,4,*,*,*>"> - <AlternativeType Name="Eigen::Array<*,4,4,*,*,*>"/> - <DisplayString>[4, 4] (fixed matrix)</DisplayString> - <Expand> - <Synthetic Name="[row 0]" Condition="Flags%2"> - <DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]}, {m_storage.m_data.array[2]}, {m_storage.m_data.array[3]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 0]" Condition="!(Flags%2)"> - <DisplayString>({m_storage.m_data.array[0]}, {m_storage.m_data.array[4]}, {m_storage.m_data.array[8]}, {m_storage.m_data.array[12]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 1]" Condition="Flags%2"> - <DisplayString>({m_storage.m_data.array[4]}, {m_storage.m_data.array[5]}, {m_storage.m_data.array[6]}, {m_storage.m_data.array[7]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 1]" Condition="!(Flags%2)"> - <DisplayString>({m_storage.m_data.array[1]}, {m_storage.m_data.array[5]}, {m_storage.m_data.array[9]}, {m_storage.m_data.array[13]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 2]" Condition="Flags%2"> - <DisplayString>({m_storage.m_data.array[8]}, {m_storage.m_data.array[9]}, {m_storage.m_data.array[10]}, {m_storage.m_data.array[11]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 2]" Condition="!(Flags%2)"> - <DisplayString>({m_storage.m_data.array[2]}, {m_storage.m_data.array[6]}, {m_storage.m_data.array[10]}, {m_storage.m_data.array[14]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 3]" Condition="Flags%2"> - <DisplayString>({m_storage.m_data.array[12]}, {m_storage.m_data.array[13]}, {m_storage.m_data.array[14]}, {m_storage.m_data.array[15]})</DisplayString> - </Synthetic> - <Synthetic Name="[row 3]" Condition="!(Flags%2)"> - <DisplayString>({m_storage.m_data.array[3]}, {m_storage.m_data.array[7]}, {m_storage.m_data.array[11]}, {m_storage.m_data.array[15]})</DisplayString> - </Synthetic> - </Expand> - </Type> - - <!-- Dynamic x Dynamic Matrix --> - <Type Name="Eigen::Matrix<*,-1,-1,*,*,*>"> - <AlternativeType Name="Eigen::Array<*,-1,-1,*,*,*>"/> - <DisplayString Condition="m_storage.m_data == 0">empty</DisplayString> - <DisplayString Condition="m_storage.m_data != 0">[{m_storage.m_rows}, {m_storage.m_cols}] (dynamic matrix)</DisplayString> - <Expand> - <ArrayItems Condition="Flags%2"> <!-- row major layout --> - <Rank>2</Rank> - <Size>$i==0 ? m_storage.m_rows : m_storage.m_cols</Size> - <ValuePointer>m_storage.m_data</ValuePointer> - </ArrayItems> - <ArrayItems Condition="!(Flags%2)"> <!-- column major layout --> - <Direction>Backward</Direction> - <Rank>2</Rank> - <Size>$i==0 ? m_storage.m_rows : m_storage.m_cols</Size> - <ValuePointer>m_storage.m_data</ValuePointer> - </ArrayItems> - </Expand> - </Type> - - <!-- Fixed x Dynamic Matrix --> - <Type Name="Eigen::Matrix<*,*,-1,*,*,*>"> - <AlternativeType Name="Eigen::Array<*,*,-1,*,*,*>"/> - <DisplayString Condition="m_storage.m_data == 0">empty</DisplayString> - <DisplayString Condition="m_storage.m_data != 0">[{$T2}, {m_storage.m_cols}] (dynamic column matrix)</DisplayString> - <Expand> - <ArrayItems Condition="Flags%2"> <!-- row major layout --> - <Rank>2</Rank> - <Size>$i==0 ? $T2 : m_storage.m_cols</Size> - <ValuePointer>m_storage.m_data</ValuePointer> - </ArrayItems> - <ArrayItems Condition="!(Flags%2)"> <!-- column major layout --> - <Direction>Backward</Direction> - <Rank>2</Rank> - <Size>$i==0 ? $T2 : m_storage.m_cols</Size> - <ValuePointer>m_storage.m_data</ValuePointer> - </ArrayItems> - </Expand> - </Type> - - <!-- Dynamic x Fixed Matrix --> - <Type Name="Eigen::Matrix<*,-1,*,*,*,*>"> - <AlternativeType Name="Eigen::Array<*,-1,*,*,*,*>"/> - <DisplayString Condition="m_storage.m_data == 0">empty</DisplayString> - <DisplayString Condition="m_storage.m_data != 0">[{m_storage.m_rows}, {$T2}] (dynamic row matrix)</DisplayString> - <Expand> - <ArrayItems Condition="Flags%2"> <!-- row major layout --> - <Rank>2</Rank> - <Size>$i==0 ? m_storage.m_rows : $T2</Size> - <ValuePointer>m_storage.m_data</ValuePointer> - </ArrayItems> - <ArrayItems Condition="!(Flags%2)"> <!-- column major layout --> - <Direction>Backward</Direction> - <Rank>2</Rank> - <Size>$i==0 ? m_storage.m_rows : $T2</Size> - <ValuePointer>m_storage.m_data</ValuePointer> - </ArrayItems> - </Expand> - </Type> - - <!-- Dynamic Column Vector --> - <Type Name="Eigen::Matrix<*,1,-1,*,*,*>"> - <AlternativeType Name="Eigen::Array<*,1,-1,*,*,*>"/> - <DisplayString Condition="m_storage.m_data == 0">empty</DisplayString> - <DisplayString Condition="m_storage.m_data != 0">[{m_storage.m_cols}] (dynamic column vector)</DisplayString> - <Expand> - <Item Name="[size]">m_storage.m_cols</Item> - <ArrayItems> - <Size>m_storage.m_cols</Size> - <ValuePointer>m_storage.m_data</ValuePointer> - </ArrayItems> - </Expand> - </Type> - - <!-- Dynamic Row Vector --> - <Type Name="Eigen::Matrix<*,-1,1,*,*,*>"> - <AlternativeType Name="Eigen::Array<*,-1,1,*,*,*>"/> - <DisplayString Condition="m_storage.m_data == 0">empty</DisplayString> - <DisplayString Condition="m_storage.m_data != 0">[{m_storage.m_rows}] (dynamic row vector)</DisplayString> - <Expand> - <Item Name="[size]">m_storage.m_rows</Item> - <ArrayItems> - <Size>m_storage.m_rows</Size> - <ValuePointer>m_storage.m_data</ValuePointer> - </ArrayItems> - </Expand> - </Type> - - <!-- Fixed Vector --> - <Type Name="Eigen::Matrix<*,1,1,*,*,*>"> - <AlternativeType Name="Eigen::Array<*,1,1,*,*,*>"/> - <DisplayString>[1] ({m_storage.m_data.array[0]})</DisplayString> - <Expand> - <Item Name="[x]">m_storage.m_data.array[0]</Item> - </Expand> - </Type> - - <Type Name="Eigen::Matrix<*,2,1,*,*,*>"> - <AlternativeType Name="Eigen::Matrix<*,1,2,*,*,*>"/> - <AlternativeType Name="Eigen::Array<*,2,1,*,*,*>"/> - <AlternativeType Name="Eigen::Array<*,1,2,*,*,*>"/> - <DisplayString>[2] ({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]})</DisplayString> - <Expand> - <Item Name="[x]">m_storage.m_data.array[0]</Item> - <Item Name="[y]">m_storage.m_data.array[1]</Item> - </Expand> - </Type> - - <Type Name="Eigen::Matrix<*,3,1,*,*,*>"> - <AlternativeType Name="Eigen::Matrix<*,1,3,*,*,*>"/> - <AlternativeType Name="Eigen::Array<*,3,1,*,*,*>"/> - <AlternativeType Name="Eigen::Array<*,1,3,*,*,*>"/> - <DisplayString>[3] ({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]}, {m_storage.m_data.array[2]})</DisplayString> - <Expand> - <Item Name="[x]">m_storage.m_data.array[0]</Item> - <Item Name="[y]">m_storage.m_data.array[1]</Item> - <Item Name="[z]">m_storage.m_data.array[2]</Item> - </Expand> - </Type> - - <Type Name="Eigen::Matrix<*,4,1,*,*,*>"> - <AlternativeType Name="Eigen::Matrix<*,1,4,*,*,*>"/> - <AlternativeType Name="Eigen::Array<*,4,1,*,*,*>"/> - <AlternativeType Name="Eigen::Array<*,1,4,*,*,*>"/> - <DisplayString>[4] ({m_storage.m_data.array[0]}, {m_storage.m_data.array[1]}, {m_storage.m_data.array[2]}, {m_storage.m_data.array[3]})</DisplayString> - <Expand> - <Item Name="[x]">m_storage.m_data.array[0]</Item> - <Item Name="[y]">m_storage.m_data.array[1]</Item> - <Item Name="[z]">m_storage.m_data.array[2]</Item> - <Item Name="[w]">m_storage.m_data.array[3]</Item> - </Expand> - </Type> - -</AutoVisualizer>
diff --git a/debug/msvc/eigen_autoexp_part.dat b/debug/msvc/eigen_autoexp_part.dat deleted file mode 100644 index 35ef580..0000000 --- a/debug/msvc/eigen_autoexp_part.dat +++ /dev/null
@@ -1,295 +0,0 @@ -; *************************************************************** -; * Eigen Visualizer -; * -; * Author: Hauke Heibel <hauke.heibel@gmail.com> -; * -; * Support the enhanced debugging of the following Eigen -; * types (*: any, +:fixed dimension) : -; * -; * - Eigen::Matrix<*,4,1,*,*,*> and Eigen::Matrix<*,1,4,*,*,*> -; * - Eigen::Matrix<*,3,1,*,*,*> and Eigen::Matrix<*,1,3,*,*,*> -; * - Eigen::Matrix<*,2,1,*,*,*> and Eigen::Matrix<*,1,2,*,*,*> -; * - Eigen::Matrix<*,-1,-1,*,*,*> -; * - Eigen::Matrix<*,+,-1,*,*,*> -; * - Eigen::Matrix<*,-1,+,*,*,*> -; * - Eigen::Matrix<*,+,+,*,*,*> -; * -; * Matrices are displayed properly independently of the memory -; * alignment (RowMajor vs. ColMajor). -; * -; * This file is distributed WITHOUT ANY WARRANTY. Please ensure -; * that your original autoexp.dat file is copied to a safe -; * place before proceeding with its modification. -; *************************************************************** - -[Visualizer] - -; Fixed size 4-vectors -Eigen::Matrix<*,4,1,*,*,*>|Eigen::Matrix<*,1,4,*,*,*>{ - children - ( - #( - [internals]: [$c,!], - x : ($c.m_storage.m_data.array)[0], - y : ($c.m_storage.m_data.array)[1], - z : ($c.m_storage.m_data.array)[2], - w : ($c.m_storage.m_data.array)[3] - ) - ) - - preview - ( - #( - "[", - 4, - "](", - #array(expr: $e.m_storage.m_data.array[$i], size: 4), - ")" - ) - ) -} - -; Fixed size 3-vectors -Eigen::Matrix<*,3,1,*,*,*>|Eigen::Matrix<*,1,3,*,*,*>{ - children - ( - #( - [internals]: [$c,!], - x : ($c.m_storage.m_data.array)[0], - y : ($c.m_storage.m_data.array)[1], - z : ($c.m_storage.m_data.array)[2] - ) - ) - - preview - ( - #( - "[", - 3, - "](", - #array(expr: $e.m_storage.m_data.array[$i], size: 3), - ")" - ) - ) -} - -; Fixed size 2-vectors -Eigen::Matrix<*,2,1,*,*,*>|Eigen::Matrix<*,1,2,*,*,*>{ - children - ( - #( - [internals]: [$c,!], - x : ($c.m_storage.m_data.array)[0], - y : ($c.m_storage.m_data.array)[1] - ) - ) - - preview - ( - #( - "[", - 2, - "](", - #array(expr: $e.m_storage.m_data.array[$i], size: 2), - ")" - ) - ) -} - -; Fixed size 1-vectors -Eigen::Matrix<*,1,1,*,*,*>|Eigen::Matrix<*,1,1,*,*,*>{ - children - ( - #( - [internals]: [$c,!], - x : ($c.m_storage.m_data.array)[0] - ) - ) - - preview - ( - #( - "[", - 1, - "](", - #array(expr: $e.m_storage.m_data.array[$i], size: 1), - ")" - ) - ) -} - -; Dynamic matrices (ColMajor and RowMajor support) -Eigen::Matrix<*,-1,-1,*,*,*>{ - children - ( - #( - [internals]: [$c,!], - rows: $c.m_storage.m_rows, - cols: $c.m_storage.m_cols, - ; Check for RowMajorBit - #if ($c.Flags & 0x1) ( - #array( - rank: 2, - base: 0, - expr: ($c.m_storage.m_data)[($i % $c.m_storage.m_rows)*$c.m_storage.m_cols + (($i- $i % $c.m_storage.m_rows)/$c.m_storage.m_rows)], - size: ($r==1)*$c.m_storage.m_rows+($r==0)*$c.m_storage.m_cols - ) - ) #else ( - #array( - rank: 2, - base: 0, - expr: ($c.m_storage.m_data)[$i], - size: ($r==1)*$c.m_storage.m_rows+($r==0)*$c.m_storage.m_cols - ) - ) - ) - ) - - preview - ( - #( - "[", - $c.m_storage.m_rows, - ",", - $c.m_storage.m_cols, - "](", - #array( - expr : [($c.m_storage.m_data)[$i],g], - size : $c.m_storage.m_rows*$c.m_storage.m_cols - ), - ")" - ) - ) -} - -; Fixed rows, dynamic columns matrix (ColMajor and RowMajor support) -Eigen::Matrix<*,*,-1,*,*,*>{ - children - ( - #( - [internals]: [$c,!], - rows: $c.RowsAtCompileTime, - cols: $c.m_storage.m_cols, - ; Check for RowMajorBit - #if ($c.Flags & 0x1) ( - #array( - rank: 2, - base: 0, - expr: ($c.m_storage.m_data)[($i % $c.RowsAtCompileTime)*$c.m_storage.m_cols + (($i- $i % $c.RowsAtCompileTime)/$c.RowsAtCompileTime)], - size: ($r==1)*$c.RowsAtCompileTime+($r==0)*$c.m_storage.m_cols - ) - ) #else ( - #array( - rank: 2, - base: 0, - expr: ($c.m_storage.m_data)[$i], - size: ($r==1)*$c.RowsAtCompileTime+($r==0)*$c.m_storage.m_cols - ) - ) - ) - ) - - preview - ( - #( - "[", - $c.RowsAtCompileTime, - ",", - $c.m_storage.m_cols, - "](", - #array( - expr : [($c.m_storage.m_data)[$i],g], - size : $c.RowsAtCompileTime*$c.m_storage.m_cols - ), - ")" - ) - ) -} - -; Dynamic rows, fixed columns matrix (ColMajor and RowMajor support) -Eigen::Matrix<*,-1,*,*,*,*>{ - children - ( - #( - [internals]: [$c,!], - rows: $c.m_storage.m_rows, - cols: $c.ColsAtCompileTime, - ; Check for RowMajorBit - #if ($c.Flags & 0x1) ( - #array( - rank: 2, - base: 0, - expr: ($c.m_storage.m_data)[($i % $c.m_storage.m_rows)*$c.ColsAtCompileTime + (($i- $i % $c.m_storage.m_rows)/$c.m_storage.m_rows)], - size: ($r==1)*$c.m_storage.m_rows+($r==0)*$c.ColsAtCompileTime - ) - ) #else ( - #array( - rank: 2, - base: 0, - expr: ($c.m_storage.m_data)[$i], - size: ($r==1)*$c.m_storage.m_rows+($r==0)*$c.ColsAtCompileTime - ) - ) - ) - ) - - preview - ( - #( - "[", - $c.m_storage.m_rows, - ",", - $c.ColsAtCompileTime, - "](", - #array( - expr : [($c.m_storage.m_data)[$i],g], - size : $c.m_storage.m_rows*$c.ColsAtCompileTime - ), - ")" - ) - ) -} - -; Fixed size matrix (ColMajor and RowMajor support) -Eigen::Matrix<*,*,*,*,*,*>{ - children - ( - #( - [internals]: [$c,!], - rows: $c.RowsAtCompileTime, - cols: $c.ColsAtCompileTime, - ; Check for RowMajorBit - #if ($c.Flags & 0x1) ( - #array( - rank: 2, - base: 0, - expr: ($c.m_storage.m_data.array)[($i % $c.RowsAtCompileTime)*$c.ColsAtCompileTime + (($i- $i % $c.RowsAtCompileTime)/$c.RowsAtCompileTime)], - size: ($r==1)*$c.RowsAtCompileTime+($r==0)*$c.ColsAtCompileTime - ) - ) #else ( - #array( - rank: 2, - base: 0, - expr: ($c.m_storage.m_data.array)[$i], - size: ($r==1)*$c.RowsAtCompileTime+($r==0)*$c.ColsAtCompileTime - ) - ) - ) - ) - - preview - ( - #( - "[", - $c.RowsAtCompileTime, - ",", - $c.ColsAtCompileTime, - "](", - #array( - expr : [($c.m_storage.m_data.array)[$i],g], - size : $c.RowsAtCompileTime*$c.ColsAtCompileTime - ), - ")" - ) - ) -}
diff --git a/eigen3.pc.in b/eigen3.pc.in deleted file mode 100644 index 3368a3a..0000000 --- a/eigen3.pc.in +++ /dev/null
@@ -1,9 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} - -Name: Eigen3 -Description: A C++ template library for linear algebra: vectors, matrices, and related algorithms -Requires: -Version: @EIGEN_VERSION_NUMBER@ -Libs: -Cflags: -I${prefix}/@INCLUDE_INSTALL_DIR@
diff --git a/google_threads/env.h b/google_threads/env.h deleted file mode 100644 index 3addbc5..0000000 --- a/google_threads/env.h +++ /dev/null
@@ -1,95 +0,0 @@ -#ifndef THIRD_PARTY_EIGEN3_GOOGLE_THREADS_ENV_H_ -#define THIRD_PARTY_EIGEN3_GOOGLE_THREADS_ENV_H_ - -#include <functional> -#include <string> -#include <utility> - -#include "thread/fiber/fiber.h" -#include "thread/thread.h" -#include "thread/thread_options.h" - -namespace Eigen { - -inline std::string GetGoogleNamePrefix() { return "GoogleEigen_"; } - -// Implements the `Environment` interface needed by Eigen's `ThreadPoolTempl` -// class. See Eigen's `ThreadEnvironment.h` for an implementation that uses the -// banned `std::thread` library. -struct GoogleEnvironment { - struct Task { - std::function<void()> f; - }; - struct EnvThread { - virtual ~EnvThread() = default; - }; - virtual ~GoogleEnvironment() = default; - virtual EnvThread* CreateThread(std::function<void()> f) = 0; - virtual Task CreateTask(std::function<void()> f) = 0; - virtual void ExecuteTask(const Task& task) = 0; -}; - -// Uses Google Threads (go/c++-concurrency#threads_fibers) to handle thread -// management. -struct GoogleThreadEnvironment : public GoogleEnvironment { - // Constructor must start the thread, while destructor must join it. - struct EnvThread : public GoogleEnvironment::EnvThread { - EnvThread(std::function<void()> f) : func_thread_(std::move(f)) { - func_thread_.Start(); - }; - ~EnvThread() override { func_thread_.Join(); }; - void OnCancel() {}; - - private: - // Wraps a function in a thread and calls it when the thread starts. - // Needed to conform to Eigen's `EnvThread` interface. - class FuncThread : public ::Thread { - public: - static ::thread::Options options() { - ::thread::Options options; - options.set_joinable(true); - return options; - } - - FuncThread(std::function<void()> f) - : ::Thread(options(), GetGoogleNamePrefix()), f_(std::move(f)) {}; - ~FuncThread() override = default; - void Run() override { f_(); }; - - private: - std::function<void()> f_; - }; - - // Managed by `EnvThread` internally. - FuncThread func_thread_; - }; - - EnvThread* CreateThread(std::function<void()> f) { - return new EnvThread(std::move(f)); - } - Task CreateTask(std::function<void()> f) { return Task{std::move(f)}; } - void ExecuteTask(const Task& task) { task.f(); } -}; - -// Uses Google Fibers (go/fibers) to handle thread management. -struct GoogleFiberEnvironment : public GoogleEnvironment { - // Constructor must start the thread, while destructor must join it. - struct EnvThread : public GoogleEnvironment::EnvThread { - EnvThread(std::function<void()> f) : fiber_(std::move(f)) {}; - ~EnvThread() override { fiber_.Join(); }; - void OnCancel() {}; - - private: - ::thread::Fiber fiber_; - }; - - EnvThread* CreateThread(std::function<void()> f) { - return new EnvThread(std::move(f)); - } - Task CreateTask(std::function<void()> f) { return Task{std::move(f)}; } - void ExecuteTask(const Task& task) { task.f(); } -}; - -} // namespace Eigen - -#endif // THIRD_PARTY_EIGEN3_GOOGLE_THREADS_ENV_H_
diff --git a/google_threads/pool.h b/google_threads/pool.h deleted file mode 100644 index 9491b5b..0000000 --- a/google_threads/pool.h +++ /dev/null
@@ -1,14 +0,0 @@ -#ifndef THIRD_PARTY_EIGEN3_GOOGLE_THREADS_POOL_H_ -#define THIRD_PARTY_EIGEN3_GOOGLE_THREADS_POOL_H_ - -#include "third_party/eigen3/Eigen/ThreadPool" -#include "third_party/eigen3/google_threads/env.h" - -namespace Eigen { - -using GoogleThreadPool = ThreadPoolTempl<GoogleThreadEnvironment>; -using GoogleFiberPool = ThreadPoolTempl<GoogleFiberEnvironment>; - -} // namespace Eigen - -#endif // THIRD_PARTY_EIGEN3_GOOGLE_THREADS_POOL_H_
diff --git a/scripts/format.sh b/scripts/format.sh new file mode 100755 index 0000000..dc6d619 --- /dev/null +++ b/scripts/format.sh
@@ -0,0 +1,14 @@ +#!/bin/bash +# SPDX-FileCopyrightText: The Eigen Authors +# SPDX-License-Identifier: MPL-2.0 + +# Format files with extensions, excluding plugins because they're partial files that don't contain valid syntax +find . -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.cu' -o -name '*.cxx' -o -name '*.h' -o -name '*.inc' -not -path '*/plugins/*' \) | xargs -n 1 -P 0 clang-format-17 -i + +# Format main headers without extensions +find Eigen -maxdepth 1 -type f | xargs -n 1 -P 0 clang-format-17 -i +find contrib/Eigen -maxdepth 2 -type f -not -name '*.txt' | xargs -n 1 -P 0 clang-format-17 -i +find unsupported/Eigen -maxdepth 2 -type f -not -name '*.txt' | xargs -n 1 -P 0 clang-format-17 -i + +# Format examples +find doc/examples -type f -name '*.cpp.*' | xargs -n 1 -P 0 clang-format-17 -i
diff --git a/signature_of_eigen3_matrix_library b/signature_of_eigen3_matrix_library deleted file mode 100644 index 80aaf46..0000000 --- a/signature_of_eigen3_matrix_library +++ /dev/null
@@ -1 +0,0 @@ -This file is just there as a signature to help identify directories containing Eigen3. When writing a script looking for Eigen3, just look for this file. This is especially useful to help disambiguate with Eigen2...