36 template<
class ValueType>
45 template<
class ValueType>
51 key(_key), value(_value) {
62 template<
class ValueType,
class CastedKeyValuePairType,
class KeyValuePairType>
64 static CastedKeyValuePairType cast(KeyValuePairType key_value) {
66 return CastedKeyValuePairType(key_value.key,
68 ValueType>&>(key_value.value)).
value());
72 template<
class CastedKeyValuePairType,
class KeyValuePairType>
74 static CastedKeyValuePairType cast(KeyValuePairType key_value) {
78 return CastedKeyValuePairType(key_value.key, key_value.value);
82 template<
class CastedKeyValuePairType,
class KeyValuePairType>
84 static CastedKeyValuePairType cast(KeyValuePairType key_value) {
88 return CastedKeyValuePairType(key_value.key, key_value.value);
93 template <
class ValueType>
94 size_t Values::count()
const {
96 for (
const auto& [_,
value] : values_) {
103 template <
class ValueType>
104 std::map<Key, ValueType>
106 std::map<Key, ValueType> result;
107 for (
const auto& [
key,
value] : values_) {
109 if (filterFcn(
key)) {
113 result[
key] = t->value();
121 inline bool Values::filterHelper<Value>(
const std::function<bool(Key)> filter,
124 return filter(key_value.key);
133 template <
typename ValueType>
135 ValueType operator()(
Key j,
const Value*
const pointer) {
146 template <
typename MatrixType,
bool isDynamic>
150 template <
int M,
int N>
152 inline Eigen::Matrix<double, M, N> operator()(
Key j,
const Value*
const pointer) {
165 template <
int M,
int N>
167 inline Eigen::Matrix<double, M, N> operator()(
Key j,
const Value*
const pointer) {
183 if (A.rows() != M || A.cols() != N)
192 template <
int M,
int N>
193 struct handle<Eigen::Matrix<double, M, N>> {
194 Eigen::Matrix<double, M, N> operator()(
Key j,
const Value*
const pointer) {
196 (M == Eigen::Dynamic || N == Eigen::Dynamic)>()(j, pointer);
203 template <
typename ValueType>
206 KeyValueMap::const_iterator item = values_.find(j);
214 return h(j, item->second.get());
218 template<
typename ValueType>
221 KeyValueMap::const_iterator item = values_.find(j);
223 if(item != values_.end()) {
228 return &ptr->
value();
241 template<
typename ValueType>
247 template <
typename ValueType>
253 template <
typename ValueType>
Definition: Values-inl.h:46
Definition: Values-inl.h:147
A non-templated config holding any types of Manifold-group elements.
void insert(Key j, const Value &val)
const ValueType at(Key j) const
Definition: Values-inl.h:204
std::map< Key, ValueType > extract(const std::function< bool(Key)> &filterFcn=&_truePredicate< Key >) const
Definition: Values-inl.h:105
Definition: Values-inl.h:63
Definition: Values-inl.h:37
Definition: GenericValue.h:44
A key-value pair, which you get by dereferencing iterators.
Definition: Values.h:98
const Key key
The key.
Definition: Values-inl.h:47
const Key key
The key.
Definition: Values-inl.h:38
void insert_or_assign(Key j, const Value &val)
If key j exists, update value, else perform an insert.
Definition: chartTesting.h:28
ValueType & value
The value.
Definition: Values-inl.h:39
Definition: Values-inl.h:134
void update(Key j, const Value &val)
const ValueType & value
The value.
Definition: Values-inl.h:48
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102
const T & value() const
Return a constant value.
Definition: GenericValue.h:64