public int MoveWindow(IEnumerable <T> nextItems) { ItemsRemoved.DequeueAll(); ItemsInside.EnqueueAll(ItemsInserted.DequeueAll()); StrongBox <int> amount = new StrongBox <int>(0); nextItems.ForEach(newItem => { ItemsInserted.Enqueue(newItem); ItemsRemoved.Enqueue(ItemsInside.Dequeue()); amount.Value++; }); return(amount.Value); }
public Vector ChangedCountVector() { var vec = ItemsInserted.CountVector() - ItemsRemoved.CountVector(); return(vec); }
public Vector CountVector() => ItemsInside.CountVector() + ItemsInserted.CountVector();