private void SetChainPositions(VertexListMatrix chains, VertexIntDictionary chain_number, VertexIntDictionary pos_in_chain) // Record chain number and position in chain of each vertex in chains { if (chain_number == null) { throw new ArgumentNullException("chain_number"); } if (pos_in_chain == null) { throw new ArgumentNullException("pos_in_chain"); } for (int i = 0; i < chains.RowCount; i++) { for (int j = 0; j < chains[i].Count; j++) { IVertex v = (IVertex)chains[i][j]; if (!chain_number.ContainsKey(v)) { chain_number.Add(v, i); } if (!pos_in_chain.ContainsKey(v)) { pos_in_chain.Add(v, j); } } } }