breaks
parent
fcf339a31a
commit
4eb73db1c1
|
@ -9,9 +9,9 @@ endif()
|
||||||
option(GTSAM_NO_BOOST_CPP17 "Require and use boost" ON)
|
option(GTSAM_NO_BOOST_CPP17 "Require and use boost" ON)
|
||||||
add_definitions(-Wno-deprecated-declarations)
|
add_definitions(-Wno-deprecated-declarations)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
if (GTSAM_NO_BOOST_CPP17)
|
if (GTSAM_NO_BOOST_CPP17)
|
||||||
add_definitions(-DNO_BOOST_CPP17)
|
add_definitions(-DNO_BOOST_CPP17)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Set the version number for the library
|
# Set the version number for the library
|
||||||
|
|
|
@ -251,7 +251,12 @@ public:
|
||||||
* both the function evaluation and its derivative(s) in H.
|
* both the function evaluation and its derivative(s) in H.
|
||||||
*/
|
*/
|
||||||
virtual Vector unwhitenedError(const Values& x, OptionalMatrixVec H = OptionalNone) const = 0;
|
virtual Vector unwhitenedError(const Values& x, OptionalMatrixVec H = OptionalNone) const = 0;
|
||||||
|
#ifdef NO_BOOST_C17
|
||||||
|
// support taking in the actual vector instead of the pointer as well
|
||||||
|
Vector unwhitenedError(const Values& x, std::vector<Matrix>& H) {
|
||||||
|
return unwhitenedError(x, &H);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
* Vector of errors, whitened
|
* Vector of errors, whitened
|
||||||
* This is the raw error, i.e., i.e. \f$ (h(x)-z)/\sigma \f$ in case of a Gaussian
|
* This is the raw error, i.e., i.e. \f$ (h(x)-z)/\sigma \f$ in case of a Gaussian
|
||||||
|
@ -611,12 +616,16 @@ protected:
|
||||||
*
|
*
|
||||||
* e.g. `const Vector error = factor.evaluateError(pose, point, Hpose);`
|
* e.g. `const Vector error = factor.evaluateError(pose, point, Hpose);`
|
||||||
*/
|
*/
|
||||||
template <typename... OptionalJacArgs,
|
template <typename... OptionalJacArgs, typename = IndexIsValid<sizeof...(OptionalJacArgs) + 1>>
|
||||||
typename = IndexIsValid<sizeof...(OptionalJacArgs) + 1>>
|
inline Vector evaluateError(const ValueTypes&... x, OptionalJacArgs&&... H) const {
|
||||||
inline Vector evaluateError(const ValueTypes&... x,
|
constexpr bool are_all_opt_mat = (... && std::is_same<OptionalMatrix, std::decay_t<OptionalJacArgs>>::value);
|
||||||
OptionalJacArgs&&... H) const {
|
constexpr bool are_all_mat = (... && std::is_same<Matrix, std::decay_t<OptionalJacArgs>>::value);
|
||||||
return evaluateError(x..., std::forward<OptionalJacArgs>(H)...,
|
static_assert((are_all_mat == false && are_all_opt_mat == false), "ERRORRR");
|
||||||
OptionalNone);
|
if constexpr ((... && std::is_same<OptionalMatrix, std::decay_t<OptionalJacArgs>>::value)) {
|
||||||
|
return evaluateError(x..., std::forward<OptionalJacArgs>(H)..., OptionalNone);
|
||||||
|
} else if constexpr ((... && std::is_same<Matrix, std::decay_t<OptionalJacArgs>>::value)) {
|
||||||
|
return evaluateError(x..., std::forward<OptionalJacArgs>(H)..., OptionalNone);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
Loading…
Reference in New Issue