Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/operators/iterate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,15 @@ impl<G: Scope, D: Data, R: Abelian> Variable<G, D, R> where G::Timestamp: Lattic

/// Adds a new source of data to the `Variable`.
pub fn set(self, result: &Collection<G, D, R>) -> Collection<G, D, R> {
let in_result = self.source.negate().concat(result);
self.set_concat(&in_result)
}


/// Concat a new source of data to the data already in the `Variable`.
pub fn set_concat(self, result: &Collection<G, D, R>) -> Collection<G, D, R> {
let step = self.step;
self.source
.negate()
.concat(result)
result
.inner
.flat_map(move |(x,t,d)| step.results_in(&t).map(|t| (x,t,d)))
.connect_loop(self.feedback);
Expand Down Expand Up @@ -276,4 +281,4 @@ impl<G: Scope, D: Data, R: Semigroup> Deref for SemigroupVariable<G, D, R> where
fn deref(&self) -> &Self::Target {
&self.collection
}
}
}