Merge pull request #968 from borglab/feature/discrete_wrapper_2

release/4.3a0
Frank Dellaert 2021-12-16 15:32:39 -05:00 committed by GitHub
commit 93978cf3a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -31,7 +31,7 @@ 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> {
@ -39,16 +39,16 @@ namespace gtsam {
// 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) {
}