void DynamicPersistenceTrails<D,CT,OT,E,Cmp,CCmp>:: rearrange(Iter i) { order().rearrange(i); consistent_order().rearrange(i); // Resort the cycles Cycle z; for(iterator i = begin(); i != end(); ++i) { Parent::swap_cycle(i, z); z.sort(ccmp_); Parent::swap_cycle(i, z); } }
void StaticPersistence<D, CT, OT, E, Cmp>:: initialize(const Filtration& filtration) { order_.assign(filtration.size(), OrderElement()); rLog(rlPersistence, "Initializing persistence"); OffsetMap<typename Filtration::Index, iterator> om(filtration.begin(), begin()); for (typename Filtration::Index cur = filtration.begin(); cur != filtration.end(); ++cur) { Cycle z; BOOST_FOREACH(const typename Filtration::Simplex& s, std::make_pair(cur->boundary_begin(), cur->boundary_end())) z.push_back(index(om[filtration.find(s)])); z.sort(ocmp_); iterator ocur = om[cur]; swap_cycle(ocur, z); set_pair(ocur, ocur); } }