Added print() to Reduction
parent
b05cd24a0b
commit
f8b96ad090
|
|
@ -200,6 +200,13 @@ namespace internal {
|
|||
return it->second;
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
void Reduction::print(const std::string& s) const {
|
||||
cout << s << " reduction:" << endl;
|
||||
BOOST_FOREACH(const value_type& p, *this)
|
||||
cout << " " << p.first << " : " << p.second << endl;
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
Permutation createReducingPermutation(const std::set<Index>& indices) {
|
||||
Permutation p(indices.size());
|
||||
|
|
@ -210,6 +217,7 @@ namespace internal {
|
|||
}
|
||||
return p;
|
||||
}
|
||||
}
|
||||
} // \namespace internal
|
||||
|
||||
}
|
||||
/* ************************************************************************* */
|
||||
} // \namespace gtsam
|
||||
|
|
|
|||
|
|
@ -189,11 +189,15 @@ namespace internal {
|
|||
// An internal class used for storing and applying a permutation from a map
|
||||
class Reduction : public gtsam::FastMap<Index,Index> {
|
||||
public:
|
||||
typedef gtsam::FastMap<Index,Index> Base;
|
||||
|
||||
static Reduction CreateAsInverse(const Permutation& p);
|
||||
void applyInverse(std::vector<Index>& js) const;
|
||||
Permutation inverse() const;
|
||||
Index& operator[](const Index& j);
|
||||
const Index& operator[](const Index& j) const;
|
||||
|
||||
void print(const std::string& s="") const;
|
||||
};
|
||||
|
||||
// Reduce the variable indices so that those in the set are mapped to start at zero
|
||||
|
|
|
|||
Loading…
Reference in New Issue