added group concept check
parent
c225ee223c
commit
b6576d7e27
|
@ -162,7 +162,7 @@ The group composition operation can be of two flavors:
|
|||
* `gtsam::traits::additive_group_tag`
|
||||
* `gtsam::traits::multiplicative_group_tag`
|
||||
|
||||
which should be queryable by `gtsam::traits::group_flavor<T>`
|
||||
which should be queryable by `gtsam::traits::group_flavor<T>::tag`
|
||||
|
||||
|
||||
Manifold Example
|
||||
|
|
|
@ -66,6 +66,29 @@ class ChartConcept {
|
|||
|
||||
};
|
||||
|
||||
template<class G>
|
||||
class GroupConcept {
|
||||
public:
|
||||
typedef G Group;
|
||||
static const Group identity = traits::identity<G>::value;
|
||||
|
||||
BOOST_CONCEPT_USAGE(GroupConcept) {
|
||||
Group ip = inverse(p);
|
||||
Group pq = compose(p, q);
|
||||
Group d = between(p, q);
|
||||
bool test = equal(p, q);
|
||||
}
|
||||
|
||||
bool check_invariants(const Group& a, const Group& b) {
|
||||
return (equal(compose(a, inverse(a)), identity))
|
||||
&& (equal(between(a, b), compose(inverse(a), b)))
|
||||
&& (equal(compose(a, between(a, b)), b));
|
||||
}
|
||||
|
||||
private:
|
||||
Group p,q;
|
||||
};
|
||||
|
||||
} // namespace gtsam
|
||||
|
||||
#endif /* CONCEPTS_H_ */
|
||||
|
|
Loading…
Reference in New Issue