Skip to content
Snippets Groups Projects
Commit ecfaff1b authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Clear instead of clone histograms when clearing the roadmap

parent ff59a07d
No related merge requests found
......@@ -98,6 +98,8 @@ namespace hpp {
virtual void add (const RoadmapNodePtr_t& node) = 0;
virtual HistogramPtr_t clone () const = 0;
virtual void clear () = 0;
};
class HPP_MANIPULATION_DLLLOCAL LeafHistogram : public ::hpp::statistics::Statistics < LeafBin >
......@@ -124,6 +126,8 @@ namespace hpp {
statistics::DiscreteDistribution < RoadmapNodePtr_t > getDistrib () const;
void clear () { Parent::clear(); }
private:
/// The constraint that creates the foliation.
ConstraintSetPtr_t constraint_;
......@@ -151,6 +155,8 @@ namespace hpp {
virtual HistogramPtr_t clone () const;
void clear () { Parent::clear(); }
private:
/// The constraint graph
graph::GraphPtr_t graph_;
......
......@@ -38,12 +38,10 @@ namespace hpp {
void Roadmap::clear ()
{
Parent::clear ();
Histograms newHistograms;
Histograms::iterator it;
for (it = histograms_.begin(); it != histograms_.end(); ++it) {
newHistograms.push_back ((*it)->clone ());
for (Histograms::iterator it = histograms_.begin();
it != histograms_.end(); ++it) {
(*it)->clear ();
}
histograms_ = newHistograms;
}
void Roadmap::push_node (const core::NodePtr_t& n)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment