adiar
adiar copied to clipboard
Add generator overload to `internal::file<T>` and `internal::file_stream<T>`
For code clarity (and performance?), we should ditch the make_generator<Stream>
in favour of making the streams into generators directly.
Tasks (Internal/IO)
- [ ] Add
operator()
tointernal::file_stream
which wraps apull()
into anoptional<T>
. - [ ] Add member function
::generator()
tointernal::file_stream
that returns a lambda with a reference tothis
. - [ ] Add member function
::generator(bool reverse)
tointernal::file
that creates a (mutable) lambda that carries theinternal::file_stream<>
inside of it. - [ ] Replace all uses of
make_generator<Stream>
; use the stream directly if possible (e.g.zdd_complement()
) or one of the above static functions (preferably the one oninternal::file
).
Tasks (Domain)
- [ ] Add
domain_generator(bool reverse)
to public API usinginternal::file<domain_var>::generator()
.
This can be further extended to make the domain_set(varcount)
an O(1) space operation which is always computed on-the-fly.