rplzzz / tgraph

Tools for finding parallelization opportunities in data flow graphs.
GNU Lesser General Public License v2.1
0 stars 0 forks source link

bitvector class conflates vector and set concepts #1

Open rplzzz opened 8 years ago

rplzzz commented 8 years ago

The bitvector class provides a vector of bits along with methods to get and set individual elements and so forth. However, our intent was always to use it to represent sets drawn from a fixed-size universe, so we mixed in a some set operations. As a result, we have a class where some methods act like a set and some methods act like a vector. This confusion is particularly problematic when a single operation has slightly different semantics between the two containers, such as size (length of vector vs. number of set elements) or iteration (iterate over all vector slots vs. iterate over set elements).

rplzzz commented 8 years ago

Continuing the thought alluded to in the log message for ea0e271, what we really need is not just a set class that uses a bitvector for its representation (hiding that implementation behind a set of coherent set semantics), but also a class representing, specifically, a set of graph nodes, including a reference back to the topology that governs the set. That would give you a self-contained representation of the node set. By contrast, in the current implementation you need to keep track of two objects, the set and the graph, separately to have the complete representation of the node set.