From daecd28cd509163ba7bb12552020ac9d8e18ff21 Mon Sep 17 00:00:00 2001 From: Pavel Guzenfeld Date: Sat, 21 Mar 2026 01:50:58 +0000 Subject: [PATCH] Add Array relational operator docs and FetchContent CMake guide libeigen/eigen!2329 Closes #2801 and #2793 --- doc/CoeffwiseMathFunctionsTable.dox | 80 +++++++++++++++++++++++++++++ doc/TopicCMakeGuide.dox | 60 ++++++++++++++++++++++ 2 files changed, 140 insertions(+) diff --git a/doc/CoeffwiseMathFunctionsTable.dox b/doc/CoeffwiseMathFunctionsTable.dox index cda19d985..53e3e18b1 100644 --- a/doc/CoeffwiseMathFunctionsTable.dox +++ b/doc/CoeffwiseMathFunctionsTable.dox @@ -471,6 +471,86 @@ This also means that, unless specified, if the function \c std::foo is available plus \c using \c std::isnan ; \cpp11 + + + \anchor cwisetable_less + a \link ArrayBase::operator< operator< \endlink(b); \n + a \link ArrayBase::operator< operator< \endlink(s); + + coefficient-wise less than comparison (\f$ a_i \lt b_i \f$). \n + \c a and \c b can be either an array or scalar. + + a[i] < b[i]; + + + + + + \anchor cwisetable_less_equal + a \link ArrayBase::operator<= operator<= \endlink(b); \n + a \link ArrayBase::operator<= operator<= \endlink(s); + + coefficient-wise less than or equal comparison (\f$ a_i \le b_i \f$). \n + \c a and \c b can be either an array or scalar. + + a[i] <= b[i]; + + + + + + \anchor cwisetable_greater + a \link ArrayBase::operator> operator> \endlink(b); \n + a \link ArrayBase::operator> operator> \endlink(s); + + coefficient-wise greater than comparison (\f$ a_i \gt b_i \f$). \n + \c a and \c b can be either an array or scalar. + + a[i] > b[i]; + + + + + + \anchor cwisetable_greater_equal + a \link ArrayBase::operator>= operator>= \endlink(b); \n + a \link ArrayBase::operator>= operator>= \endlink(s); + + coefficient-wise greater than or equal comparison (\f$ a_i \ge b_i \f$). \n + \c a and \c b can be either an array or scalar. + + a[i] >= b[i]; + + + + + + \anchor cwisetable_equal + a \link ArrayBase::operator== operator== \endlink(b); \n + a \link ArrayBase::operator== operator== \endlink(s); + + coefficient-wise equality comparison (\f$ a_i = b_i \f$). \n + \c a and \c b can be either an array or scalar. \n + \warning Performs exact comparison; prefer \c isApprox() for floating-point types. + + a[i] == b[i]; + + + + + + \anchor cwisetable_not_equal + a \link ArrayBase::operator!= operator!= \endlink(b); \n + a \link ArrayBase::operator!= operator!= \endlink(s); + + coefficient-wise not-equal comparison (\f$ a_i \ne b_i \f$). \n + \c a and \c b can be either an array or scalar. \n + \warning Performs exact comparison; prefer \c isApprox() for floating-point types. + + a[i] != b[i]; + + + Error and gamma functions diff --git a/doc/TopicCMakeGuide.dox b/doc/TopicCMakeGuide.dox index dc0d7068c..48d20ab75 100644 --- a/doc/TopicCMakeGuide.dox +++ b/doc/TopicCMakeGuide.dox @@ -60,6 +60,66 @@ if (TARGET Eigen3::Eigen) endif (TARGET Eigen3::Eigen) \endcode +\section title_fetchcontent Using FetchContent + +Starting with CMake 3.11, you can use the +FetchContent +module to download and include %Eigen directly in your project without +installing it first. + +A basic example: +\code{.cmake} +cmake_minimum_required(VERSION 3.11) +project(myproject) + +include(FetchContent) +FetchContent_Declare( + Eigen + GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git + GIT_TAG master + GIT_SHALLOW TRUE + EXCLUDE_FROM_ALL +) +FetchContent_MakeAvailable(Eigen) + +add_executable(example example.cpp) +target_link_libraries(example Eigen3::Eigen) +\endcode + +\subsection title_fetchcontent_options Disabling Eigen build options + +When %Eigen is added as a sub-project, its documentation, testing, and +pkg-config targets may collide with your project's own targets. Disable +them before calling \c FetchContent_MakeAvailable: +\code{.cmake} +set(EIGEN_BUILD_DOC OFF CACHE BOOL "" FORCE) +set(EIGEN_BUILD_TESTING OFF CACHE BOOL "" FORCE) +set(BUILD_TESTING OFF CACHE BOOL "" FORCE) +set(EIGEN_BUILD_PKGCONFIG OFF CACHE BOOL "" FORCE) + +FetchContent_MakeAvailable(Eigen) +\endcode + +\subsection title_fetchcontent_exclude Using EXCLUDE_FROM_ALL + +Projects that depend on %Eigen should typically exclude installing %Eigen by +default to avoid overwriting a previous installation. Pass +\c EXCLUDE_FROM_ALL in the \c FetchContent_Declare call (as shown above) or +the equivalent \c add_subdirectory option so that %Eigen's install rules are +not included in the default install target. + +\subsection title_fetchcontent_cmake330 Note for CMake 3.30 and later + +CMake 3.30 changed the default value of the +CMP0168 +policy so that \c FetchContent_Declare uses +\c FetchContent_Populate internally with a different sub-build strategy. +If you encounter issues with sub-builds you can either upgrade to a +compatible %Eigen version or set the policy explicitly: +\code{.cmake} +cmake_policy(SET CMP0168 OLD) +\endcode + */ }