Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DiscreteKeys Fix #968

Merged
merged 2 commits into from
Dec 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions gtsam/discrete/DiscreteKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ namespace gtsam {
* Key type for discrete conditionals
* Includes name and cardinality
*/
typedef std::pair<Key,size_t> DiscreteKey;
using DiscreteKey = std::pair<Key,size_t>;

/// DiscreteKeys is a set of keys that can be assembled using the & operator
struct DiscreteKeys: public std::vector<DiscreteKey> {

// Forward all constructors.
using std::vector<DiscreteKey>::vector;

/// Get around gcc bug, which does not like above.
DiscreteKeys() {}
/// Constructor for serialization
GTSAM_EXPORT DiscreteKeys() : std::vector<DiscreteKey>::vector() {}

/// Construct from a key
DiscreteKeys(const DiscreteKey& key) {
GTSAM_EXPORT DiscreteKeys(const DiscreteKey& key) {
push_back(key);
}

/// Construct from a vector of keys
DiscreteKeys(const std::vector<DiscreteKey>& keys) :
GTSAM_EXPORT DiscreteKeys(const std::vector<DiscreteKey>& keys) :
std::vector<DiscreteKey>(keys) {
}

Expand Down