Filters the components of an aggregate and keeps track of where the survivors end up.
More...
|
| | Sieve (size_t num) |
| | Sieve (size_t num, std::predicate< size_t > auto pred) |
| | Keeps those of num candidates that satisfy pred.
|
| | Sieve (Defs ops, std::predicate< const Def * > auto pred) |
| | Keeps those ops that satisfy pred.
|
Candidates the rewrite adds; they have no old counterpart and simply continue the candidate indices.
|
| void | cat (size_t num, std::predicate< size_t > auto pred) |
| size_t | num_cat () const |
| | Number of concat'ed candidates.
|
| size_t | cat (size_t i) const |
| | As Sieve::operator[] but for concat'ed i.
|
| size_t | num_old () const |
| | Number of old components.
|
| size_t | num_new () const |
| | Number of survivors.
|
| bool | all () const |
| | Is the new aggregate the old one - nothing dropped and nothing concat'ed?
|
| fe::View< size_t > | new2old () const |
| | The old index of the i th survivor; this is what Rewriter::rewrite_stub expects.
|
| size_t | operator[] (size_t i) const |
| | The new index of the candidate i - or Sieve::Gone, if it didn't survive.
|
| DefVec | gather (Defs ops) const |
| | The surviving components of ops - one per candidate, concat'ed ones included.
|
Filters the components of an aggregate and keeps track of where the survivors end up.
This is what a Phase needs that drops components of a Sigma - or the parameters of a Lam:
- Note
- Only a Sigma ever needs that last adjustment: an Arr's components all share one type - so it is dropped as a whole - and World::extract_fused splits a fused index at the Arr boundary, which leaves a Sigma's index scalar.
A rewrite that also adds components - mem::SEO threads fresh φs through a Lam - Sieve::cats them as further candidates: they extend the very same index space, so one Sieve still answers the whole new layout.
Definition at line 116 of file tuple.h.