Go to the documentation of this file.
32 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
33 #include <boost/serialization/unique_ptr.hpp>
45 class ValueAutomaticCasting;
75 std::map<Key, std::unique_ptr<Value>, std::less<Key>,
76 std::allocator<std::pair<const Key, std::unique_ptr<Value>>>>;
125 Values(std::initializer_list<ConstKeyValuePair>
init);
152 template <
typename ValueType>
153 const ValueType at(
Key j)
const;
168 bool exists(
Key j)
const;
174 template<
typename ValueType>
175 const ValueType * exists(
Key j)
const;
178 size_t size()
const {
return values_.size(); }
181 bool empty()
const {
return values_.empty(); }
193 return std::make_unique<ConstKeyValuePair>(it_->first, *(it_->second));
196 return it_ ==
other.it_;
245 template <
typename ValueType>
257 template <
typename UnaryOp,
typename ValueType>
270 template <
typename BinaryOp,
typename ValueType1,
typename ValueType2>
283 template <
typename T>
289 template <
typename UnaryOp,
typename ValueType>
295 template <
typename BinaryOp,
typename ValueType1,
typename ValueType2>
302 void insert_or_assign(
Key j,
const Value& val);
311 template <
typename ValueType>
312 void insert_or_assign(
Key j,
const ValueType& val);
317 template <
typename UnaryOp,
typename ValueType>
323 template <
typename BinaryOp,
typename ValueType1,
typename ValueType2>
353 std::map<Key,size_t> dims()
const;
359 template <
class ValueType>
360 size_t count()
const;
381 template <
class ValueType>
382 std::map<Key, ValueType>
383 extract(
const std::function<
bool(
Key)>& filterFcn = &_truePredicate<Key>)
const;
388 template<
class ValueType>
396 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
398 friend class boost::serialization::access;
399 template<
class ARCHIVE>
400 void serialize(ARCHIVE & ar,
const unsigned int ) {
401 ar & BOOST_SERIALIZATION_NVP(values_);
426 GTSAM_EXPORT
const char*
what() const noexcept override;
441 operation_(operation),
key_(
key) {}
449 GTSAM_EXPORT
const char*
what() const noexcept override;
465 const std::type_info& storedTypeId,
const std::type_info& requestedTypeId) noexcept :
466 key_(
key), storedTypeId_(storedTypeId), requestedTypeId_(requestedTypeId) {}
480 GTSAM_EXPORT
const char*
what() const noexcept override;
491 const char*
what() const noexcept
override {
492 return "The Values 'this' and the argument passed to Values::localCoordinates have mismatched keys and values";
508 M1_(
M1), N1_(N1), M2_(
M2), N2_(N2) {
514 GTSAM_EXPORT
const char*
what() const noexcept override;
bool operator==(const deref_iterator &other) const
M1<< 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12;Map< MatrixXf > M2(M1.data(), 6, 2)
const std::type_info & storedTypeId() const
The typeid of the value stores in the Values.
typename KeyValueMap::const_iterator const_iterator_type
const std::type_info & requestedTypeId() const
The requested typeid.
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
double atDouble(size_t key) const
version for double
const char * operation_
The operation that attempted to access the key.
~DynamicValuesMismatched() noexcept override
std::shared_ptr< Values > shared_ptr
A shared_ptr to this class.
deref_iterator lower_bound(Key j) const
A key-value pair, which you get by dereferencing iterators.
const char * what() const noexcept override
def retract(a, np.ndarray xi)
static Value * allocate_clone(const Value &a)
ConstKeyValuePair(Key _key, const Value &_value)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
bool operator!=(const deref_iterator &other) const
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
deref_iterator upper_bound(Key j) const
Default allocator for list, map, and set types.
Key key() const noexcept
The key that was attempted to be accessed that does not exist.
void insertDouble(Key j, double c)
version for double
std::map< Key, std::unique_ptr< Value >, std::less< Key >, std::allocator< std::pair< const Key, std::unique_ptr< Value > >> > KeyValueMap
deref_iterator & operator++()
~NoMatchFoundForFixed() noexcept override
void print(const Matrix &A, const string &s, ostream &stream)
internal::FastDefaultAllocator< typename std::pair< const Key, void * > >::type KeyValuePtrPairAllocator
deref_iterator end() const
const Key key_
The key that does not exist.
std::shared_ptr< const Values > const_shared_ptr
A const shared_ptr to this class.
static bool _truePredicate(const T &)
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
const Key key_
The key that already existed.
KeyValuePair(Key _key, Value &_value)
ConstKeyValuePair operator*() const
A small structure to hold a non zero as a triplet (i,j,value).
NoMatchFoundForFixed(size_t M1, size_t N1, size_t M2, size_t N2) noexcept
const gtsam::Symbol key('X', 0)
deref_iterator begin() const
static void deallocate_clone(const Value *a)
~ValuesKeyDoesNotExist() noexcept override
A key-value pair, which you get by dereferencing iterators.
ValuesKeyAlreadyExists(Key key) noexcept
Construct with the key-value pair attempted to be added.
std::vector< float > Values
ConstKeyValuePair(const KeyValuePair &kv)
const std::type_info & requestedTypeId_
~ValuesIncorrectType() noexcept override
Generic expression where a coefficient-wise unary operator is applied to an expression.
const GTSAM_EXPORT char * what() const noexcept override
The message to be displayed to the user.
const Value & value
The value.
Key key() const noexcept
The key that was attempted to be accessed that does not exist.
std::unique_ptr< ConstKeyValuePair > operator->() const
~ValuesKeyAlreadyExists() noexcept override
static bool filterHelper(const std::function< bool(Key)> filter, const ConstKeyValuePair &key_value)
Key key() const noexcept
The duplicate key that was attempted to be added.
ValuesIncorrectType(Key key, const std::type_info &storedTypeId, const std::type_info &requestedTypeId) noexcept
Construct with the key that does not exist in the values.
const Key key_
The key requested.
An easy way to control which allocator is used for Fast* collections.
const std::type_info & storedTypeId_
DynamicValuesMismatched() noexcept
std::uint64_t Key
Integer nonlinear key type.
ValuesKeyDoesNotExist(const char *operation, Key key) noexcept
Construct with the key that does not exist in the values.
deref_iterator(const_iterator_type it)
deref_iterator find(Key j) const
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:09:41