public void RemoveMiddle()
        {
            var chain = new MultipleChainsInSingleArray <long>();

            var entry = chain.GetUnusedChainIndex();

            chain.StartChain(entry, 0, 1L);
            entry = chain.GetUnusedChainIndex();
            chain.AppendChainElement(entry, 0, 2L);
            entry = chain.GetUnusedChainIndex();
            chain.AppendChainElement(entry, 1, 101L);
            var todeleteentry = chain.GetUnusedChainIndex();

            chain.AppendChainElement(todeleteentry, 1, 102L);
            entry = chain.GetUnusedChainIndex();
            chain.AppendChainElement(entry, 1, 103L);
            chain.RemoveChainElement(1, todeleteentry);

            var enumerator = chain.GetEnumerator(1);
            var count      = 0L;

            while (enumerator.MoveNext())
            {
                count += enumerator.CurrentElement;
            }
            count.ShouldBe(101L + 103L);
        }
Ejemplo n.º 2
0
        public LtmdpContinuationDistributionMapper()
        {
            _continuationOfDistributionChain = new MultipleChainsInSingleArray <ContinuationElement>();

            _distributionOfContinuationChain = new MultipleChainsInSingleArray <DistributionElement>();
        }
Ejemplo n.º 3
0
 public ContinuationsOfDistributionEnumerator(LtmdpContinuationDistributionMapper cidToDidMapper, int distributionId)
 {
     _continuationsOfDistributionChainEnumerator = cidToDidMapper._continuationOfDistributionChain.GetEnumerator(distributionId);
     _offset = cidToDidMapper._offset;
 }
Ejemplo n.º 4
0
 public DistributionsOfContinuationEnumerator(LtmdpContinuationDistributionMapper cidToDidMapper, int continuationId)
 {
     _distributionOfContinuationChainEnumerator = cidToDidMapper._distributionOfContinuationChain.GetEnumerator(continuationId);
 }