Go to the documentation of this file.
48 for (
const auto &kv :
init)
56 if (it !=
delta.end()) {
68 cout <<
str << (
str.empty() ?
"" :
"\n");
69 cout <<
"Values with " <<
size() <<
" values:\n";
71 cout <<
"Value " << keyFormatter(
key) <<
": ";
81 for (
auto it1 =
values_.begin(), it2 =
other.values_.begin();
82 it1 !=
values_.end(); ++it1, ++it2) {
83 const Value* value1 = it1->second.get();
84 const Value* value2 = it2->second.get();
85 if (
typeid(*value1) !=
typeid(*value2) || it1->first != it2->first
106 assert(this->
size() == delta.
size());
107 auto key_value =
values_.begin();
110 for (; key_value !=
values_.end(); ++key_value) {
111 key_delta =
delta.find(key_value->first);
113 for (key_delta =
delta.begin(); key_value !=
values_.end();
114 ++key_value, ++key_delta) {
115 assert(key_value->first == key_delta->first);
117 Key var = key_value->first;
118 assert(
static_cast<size_t>(
delta[var].
size()) == key_value->second->dim());
119 assert(
delta[var].allFinite());
123 *(key_value->second) = *retracted;
135 it1 !=
values_.end(); ++it1, ++it2) {
136 if(it1->first != it2->first)
140 result.insert(it1->first, it1->second->localCoordinates_(*it2->second));
147 KeyValueMap::const_iterator it =
values_.find(
j);
158 if(!insertResult.second)
172 KeyValueMap::iterator it =
values_.find(
j);
177 const Value& old_value = *it->second;
178 if (
typeid(old_value) !=
typeid(val))
212 KeyValueMap::iterator it =
values_.find(
j);
253 std::map<Key,size_t>
result;
272 "Attempting to add a key-value pair with key \"" +
DefaultKeyFormatter(key_) +
"\", key already exists.";
273 return message_.c_str();
280 "Attempting to " + std::string(operation_) +
" the key \"" +
282 return message_.c_str();
287 if(message_.empty()) {
288 std::string storedTypeName =
demangle(storedTypeId_.name());
289 std::string requestedTypeName =
demangle(requestedTypeId_.name());
291 if (storedTypeName == requestedTypeName) {
292 message_ =
"WARNING: Detected types with same name but different `typeid`. \
293 This is usually caused by incorrect linking/inlining settings when compiling libraries using GTSAM. \
294 If you are a user, please report to the author of the library using GTSAM. \
295 If you are a package maintainer, please consult `cmake/GtsamPybindWrap.cmake`, line 74 for details.";
298 "Attempting to retrieve value with key \"" +
DefaultKeyFormatter(key_) +
"\", type stored in Values is " +
299 storedTypeName +
" but requested type was " + requestedTypeName;
302 return message_.c_str();
307 if(message_.empty()) {
310 <<
"Attempting to retrieve fixed-size matrix with dimensions "
312 <<
", but found dynamic Matrix with mismatched dimensions "
313 << M2_ <<
"x" << N2_;
314 message_ = oss.str();
316 return message_.c_str();
virtual bool equals_(const Value &other, double tol=1e-9) const =0
std::map< Key, size_t > dims() const
bool exists(const VALUE &e) const
void retractMasked(const VectorValues &delta, const KeySet &mask)
virtual void deallocate_() const =0
void update(Key j, const Value &val)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
VectorValues localCoordinates(const Values &cp) const
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Values::const_iterator const_iterator
Const iterator over vector values.
const ValueType at(Key j) const
Values retract(const VectorValues &delta) const
virtual Value * clone_() const =0
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
const GTSAM_EXPORT char * what() const noexcept override
The message to be displayed to the user.
bool equals(const Values &other, double tol=1e-9) const
const GTSAM_EXPORT char * what() const noexcept override
const gtsam::Symbol key('X', 0)
VectorValues zeroVectors() const
detail::enable_if_t<!detail::move_never< T >::value, T > move(object &&obj)
std::vector< float > Values
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
const GTSAM_EXPORT char * what() const noexcept override
The message to be displayed to the user.
std::string demangle(const char *name)
Pretty print Value type name.
void insert(Key j, const Value &val)
Array< int, Dynamic, 1 > v
std::uint64_t Key
Integer nonlinear key type.
const GTSAM_EXPORT char * what() const noexcept override
The message to be displayed to the user.
Values & operator=(const Values &rhs)
virtual Value * retract_(const Vector &delta) const =0
A non-templated config holding any types of Manifold-group elements.
void insert_or_assign(Key j, const Value &val)
If key j exists, update value, else perform an insert.
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:18:23