51 (std::is_base_of_v<group_tag, structure_category_tag>),
52 "This type's structure_category trait does not assert it as a group (or derived)");
58 if constexpr (std::is_same_v<flavor_tag, multiplicative_group_tag>) {
61 }
else if constexpr (std::is_same_v<flavor_tag, additive_group_tag>) {
92 static Class Identity() {
return Class::Identity(); }
93 static Class Compose(
const Class &g,
const Class & h) {
return g * h;}
94 static Class Between(
const Class &g,
const Class & h) {
return g.inverse() * h;}
95 static Class Inverse(
const Class &g) {
return g.inverse();}
108 static Class Identity() {
return Class::Identity(); }
109 static Class Compose(
const Class &g,
const Class & h) {
return g + h;}
110 static Class Between(
const Class &g,
const Class & h) {
return h - g;}
111 static Class Inverse(
const Class &g) {
return -g;}
125 else if (n == 1)
return g;
131template<
typename G,
typename H>
147 return DirectProduct(traits<G>::Compose(this->first, other.first),
148 traits<H>::Compose(this->second, other.second));
151 return DirectProduct(this->first.inverse(), this->second.inverse());
156template<
typename G,
typename H>
162template<
typename G,
typename H>
167 const G& g()
const {
return this->first; }
168 const H& h()
const {
return this->second;}
175 DirectSum(
const G& g,
const H& h):
std::pair<G,H>(g,h) {}
181 return DirectSum(g()+other.g(), h()+other.h());
184 return DirectSum(g()-other.g(), h()-other.h());
192template<
typename G,
typename H>
206#define GTSAM_CONCEPT_GROUP_INST(T) template class gtsam::IsGroup<T>;
207#define GTSAM_CONCEPT_GROUP_TYPE(T) typedef gtsam::IsGroup<T> _gtsam_IsGroup_##T;
Concept check for values that can be used in unit tests.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
compose_pow(const G &g, size_t n)
compose multiple times
Definition Group.h:123
check_group_invariants(const G &a, const G &b, double tol=1e-9)
Check invariants.
Definition Group.h:77
tag to assert a type is a group
Definition Group.h:31
Group operator syntax flavors.
Definition Group.h:34
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition Group.h:37
Group Concept.
Definition Group.h:43
A helper class that implements the traits interface for multiplicative groups.
Definition Group.h:89
Both multiplicative group traits and Testable.
Definition Group.h:100
A helper class that implements the traits interface for additive groups.
Definition Group.h:105
Both additive group traits and Testable.
Definition Group.h:116
Template to construct the direct product of two arbitrary groups Assumes nothing except group structu...
Definition Group.h:132
DirectProduct()
Default constructor yields identity.
Definition Group.h:138
Template to construct the direct sum of two additive groups Assumes existence of three additive opera...
Definition Group.h:163
DirectSum()
Default constructor yields identity.
Definition Group.h:172
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:152