Added dim function and removed commented out code
parent
965417ea1b
commit
6a125ed5cb
|
@ -58,12 +58,6 @@ namespace gtsam {
|
|||
}
|
||||
};
|
||||
|
||||
// /* ************************************************************************* */
|
||||
// template<class ValueType>
|
||||
// ValueType& operator=(ValueType& lhs, const ValueAutomaticCasting& rhs) {
|
||||
// lhs = rhs;
|
||||
// }
|
||||
|
||||
/* ************************************************************************* */
|
||||
template<typename ValueType>
|
||||
const ValueType& Values::at(const Symbol& j) const {
|
||||
|
|
|
@ -175,6 +175,15 @@ namespace gtsam {
|
|||
return result;
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
size_t Values::dim() const {
|
||||
size_t result = 0;
|
||||
BOOST_FOREACH(const ConstKeyValuePair& key_value, *this) {
|
||||
result += key_value.second.dim();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
Ordering::shared_ptr Values::orderingArbitrary(Index firstVar) const {
|
||||
Ordering::shared_ptr ordering(new Ordering);
|
||||
|
|
|
@ -255,9 +255,12 @@ namespace gtsam {
|
|||
/** Remove all variables from the config */
|
||||
void clear() { values_.clear(); }
|
||||
|
||||
/** Create an array of variable dimensions using the given ordering */
|
||||
/** Create an array of variable dimensions using the given ordering (\f$ O(n) \f$) */
|
||||
std::vector<size_t> dims(const Ordering& ordering) const;
|
||||
|
||||
/** Compute the total dimensionality of all values (\f$ O(n) \f$) */
|
||||
size_t dim() const;
|
||||
|
||||
/**
|
||||
* Generate a default ordering, simply in key sort order. To instead
|
||||
* create a fill-reducing ordering, use
|
||||
|
|
Loading…
Reference in New Issue