It is not possible to remove elements from an idict.
+Finally mfp<K> implements a merge-find set data structure (aka. disjoint-set or
+union–find) over the type K ("mfp" = merge-find-promote).
+
2. Standard STL data types
In Yosys we use std::vector<T> and std::string whenever applicable. When
parents[i] = -1;
}
+ int lookup(const K &a) const
+ {
+ return ifind((*this)(a));
+ }
+
const K &find(const K &a) const
{
return (*this)[ifind((*this)(a))];
for (int i = 0; i < GetSize(from); i++)
{
- RTLIL::SigBit bf = database.find(from[i]);
- RTLIL::SigBit bt = database.find(to[i]);
+ int bfi = database.lookup(from[i]);
+ int bti = database.lookup(to[i]);
+
+ const RTLIL::SigBit &bf = database[bfi];
+ const RTLIL::SigBit &bt = database[bti];
if (bf.wire || bt.wire)
{
- database.merge(bf, bt);
+ database.imerge(bfi, bti);
if (bf.wire == nullptr)
- database.promote(bf);
+ database.ipromote(bfi);
if (bt.wire == nullptr)
- database.promote(bt);
+ database.ipromote(bti);
}
}
}