Make concepts work in the boost path
parent
c6dd2bb0f0
commit
61a30b0162
|
@ -52,7 +52,7 @@ public:
|
|||
typedef typename traits<G>::group_flavor flavor_tag;
|
||||
//typedef typename traits<G>::identity::value_type identity_value_type;
|
||||
|
||||
GTSAM_CONCEPT_USAGE(IsGroup) {
|
||||
BOOST_CONCEPT_USAGE(IsGroup) {
|
||||
static_assert(
|
||||
(std::is_base_of<group_tag, structure_category_tag>::value),
|
||||
"This type's structure_category trait does not assert it as a group (or derived)");
|
||||
|
|
|
@ -264,7 +264,7 @@ public:
|
|||
typedef typename traits<T>::TangentVector TangentVector;
|
||||
typedef typename traits<T>::ChartJacobian ChartJacobian;
|
||||
|
||||
GTSAM_CONCEPT_USAGE(IsLieGroup) {
|
||||
BOOST_CONCEPT_USAGE(IsLieGroup) {
|
||||
static_assert(
|
||||
(std::is_base_of<lie_group_tag, structure_category_tag>::value),
|
||||
"This type's trait does not assert it is a Lie group (or derived)");
|
||||
|
|
|
@ -61,7 +61,7 @@ struct HasManifoldPrereqs {
|
|||
Eigen::Matrix<double, dim, 1> v;
|
||||
OptionalJacobian<dim, dim> Hp, Hq, Hv;
|
||||
|
||||
GTSAM_CONCEPT_USAGE(HasManifoldPrereqs) {
|
||||
BOOST_CONCEPT_USAGE(HasManifoldPrereqs) {
|
||||
v = p.localCoordinates(q);
|
||||
q = p.retract(v);
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ public:
|
|||
typedef typename traits<T>::ManifoldType ManifoldType;
|
||||
typedef typename traits<T>::TangentVector TangentVector;
|
||||
|
||||
GTSAM_CONCEPT_USAGE(IsManifold) {
|
||||
BOOST_CONCEPT_USAGE(IsManifold) {
|
||||
static_assert(
|
||||
(std::is_base_of<manifold_tag, structure_category_tag>::value),
|
||||
"This type's structure_category trait does not assert it as a manifold (or derived)");
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace gtsam {
|
|||
bool r1,r2;
|
||||
public:
|
||||
|
||||
GTSAM_CONCEPT_USAGE(IsTestable) {
|
||||
BOOST_CONCEPT_USAGE(IsTestable) {
|
||||
// check print function, with optional string
|
||||
traits<T>::Print(t, std::string());
|
||||
traits<T>::Print(t);
|
||||
|
@ -134,7 +134,7 @@ namespace gtsam {
|
|||
template<typename T>
|
||||
struct HasTestablePrereqs {
|
||||
|
||||
GTSAM_CONCEPT_USAGE(HasTestablePrereqs) {
|
||||
BOOST_CONCEPT_USAGE(HasTestablePrereqs) {
|
||||
t->print(str);
|
||||
b = t->equals(*s,tol);
|
||||
}
|
||||
|
|
|
@ -168,7 +168,7 @@ struct HasVectorSpacePrereqs {
|
|||
Class p, q;
|
||||
Vector v;
|
||||
|
||||
GTSAM_CONCEPT_USAGE(HasVectorSpacePrereqs) {
|
||||
BOOST_CONCEPT_USAGE(HasVectorSpacePrereqs) {
|
||||
p = Class::Identity(); // identity
|
||||
q = p + p; // addition
|
||||
q = p - p; // subtraction
|
||||
|
@ -472,7 +472,7 @@ public:
|
|||
|
||||
typedef typename traits<T>::structure_category structure_category_tag;
|
||||
|
||||
GTSAM_CONCEPT_USAGE(IsVectorSpace) {
|
||||
BOOST_CONCEPT_USAGE(IsVectorSpace) {
|
||||
static_assert(
|
||||
(std::is_base_of<vector_space_tag, structure_category_tag>::value),
|
||||
"This type's trait does not assert it as a vector space (or derived)");
|
||||
|
|
|
@ -10,16 +10,18 @@
|
|||
|
||||
#ifdef GTSAM_USE_BOOST_FEATURES
|
||||
#include <boost/concept_check.hpp>
|
||||
#define GTSAM_CONCEPT_USAGE(concept) BOOST_CONCEPT_USAGE((concept))
|
||||
#include <boost/concept/assert.hpp>
|
||||
#include <boost/concept/requires.hpp>
|
||||
#include <boost/concept_check.hpp>
|
||||
#define GTSAM_CONCEPT_ASSERT(concept) BOOST_CONCEPT_ASSERT((concept))
|
||||
#define GTSAM_CONCEPT_ASSERT1(concept) BOOST_CONCEPT_ASSERT((concept))
|
||||
#define GTSAM_CONCEPT_ASSERT2(concept) BOOST_CONCEPT_ASSERT((concept))
|
||||
#define GTSAM_CONCEPT_ASSERT3(concept) BOOST_CONCEPT_ASSERT((concept))
|
||||
#define GTSAM_CONCEPT_ASSERT4(concept) BOOST_CONCEPT_ASSERT((concept))
|
||||
#define GTSAM_CONCEPT_REQUIRES(concept, return_type) BOOST_CONCEPT_REQUIRES((concept), (return_type))
|
||||
#define GTSAM_CONCEPT_REQUIRES(concept, return_type) BOOST_CONCEPT_REQUIRES(((concept)), (return_type))
|
||||
#else
|
||||
// These do something sensible:
|
||||
#define GTSAM_CONCEPT_USAGE(concept) void check##concept()
|
||||
#define BOOST_CONCEPT_USAGE(concept) void check##concept()
|
||||
// TODO(dellaert): would be nice if it was a single macro...
|
||||
#define GTSAM_CONCEPT_ASSERT(concept) concept checkConcept [[maybe_unused]];
|
||||
#define GTSAM_CONCEPT_ASSERT1(concept) concept checkConcept1 [[maybe_unused]];
|
||||
|
|
Loading…
Reference in New Issue