Add missing adolc isinf/isnan.

Also modified cmake/FindAdolc.cmake to eliminate warnings, and added
search paths to match install layout.

Fixed: #2157
This commit is contained in:
Antonio Sanchez 2021-02-19 14:17:10 -08:00 committed by Antonio Sánchez
parent ce4af0b38f
commit 5f9cfb2529
3 changed files with 11 additions and 8 deletions

View File

@ -4,17 +4,17 @@ if (ADOLC_INCLUDES AND ADOLC_LIBRARIES)
endif () endif ()
find_path(ADOLC_INCLUDES find_path(ADOLC_INCLUDES
NAMES NAMES adolc/adtl.h
adolc/adtl.h PATHS $ENV{ADOLCDIR} $ENV{ADOLCDIR}/include ${INCLUDE_INSTALL_DIR}
PATHS
$ENV{ADOLCDIR}
${INCLUDE_INSTALL_DIR}
) )
find_library(ADOLC_LIBRARIES adolc PATHS $ENV{ADOLCDIR} ${LIB_INSTALL_DIR}) find_library(ADOLC_LIBRARIES
adolc
PATHS $ENV{ADOLCDIR} ${LIB_INSTALL_DIR}
PATH_SUFFIXES lib lib64)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ADOLC DEFAULT_MSG find_package_handle_standard_args(Adolc DEFAULT_MSG
ADOLC_INCLUDES ADOLC_LIBRARIES) ADOLC_INCLUDES ADOLC_LIBRARIES)
mark_as_advanced(ADOLC_INCLUDES ADOLC_LIBRARIES) mark_as_advanced(ADOLC_INCLUDES ADOLC_LIBRARIES)

View File

@ -74,6 +74,9 @@ inline adouble imag(const adouble&) { return 0.; }
inline adouble abs(const adouble& x) { return fabs(x); } inline adouble abs(const adouble& x) { return fabs(x); }
inline adouble abs2(const adouble& x) { return x*x; } inline adouble abs2(const adouble& x) { return x*x; }
inline bool (isinf)(const adouble& x) { return (Eigen::numext::isinf)(x.getValue()); }
inline bool (isnan)(const adouble& x) { return (Eigen::numext::isnan)(x.getValue()); }
} }
namespace Eigen { namespace Eigen {

View File

@ -23,7 +23,7 @@ endif()
find_package(Adolc) find_package(Adolc)
if(ADOLC_FOUND) if(Adolc_FOUND)
include_directories(${ADOLC_INCLUDES}) include_directories(${ADOLC_INCLUDES})
ei_add_property(EIGEN_TESTED_BACKENDS "Adolc, ") ei_add_property(EIGEN_TESTED_BACKENDS "Adolc, ")
if(EIGEN_TEST_CXX11) if(EIGEN_TEST_CXX11)