示例#1
0
        public AdjacencyMatrix Clone()
        {
            var clone = new AdjacencyMatrix(m_internal.Length, m_numerOfEvents);

            for (int i = 0; i < m_internal.Length; i++)
            {
                if (m_events[i] != null)
                {
                    clone.m_events[i] = (BitArray)m_events[i].Clone();
                }

                if (m_internal[i] != null)
                {
                    clone.m_internal[i] = new SortedList <int, int>();
                    foreach (var c in m_internal[i])
                    {
                        clone.m_internal[i].Add(c.Key, c.Value);
                    }
                }
            }
            return(clone);
        }
示例#2
0
        public AdjacencyMatrix Clone()
        {
            var clone = new AdjacencyMatrix(_internal.Length, _eventsNum);

            for (int i = 0; i < _internal.Length; i++)
            {
                if (_events[i] != null)
                {
                    clone._events[i] = (BitArray)_events[i].Clone();
                }

                if (_internal[i] == null)
                {
                    continue;
                }
                clone._internal[i] = new SortedList <int, int>();
                foreach (var c in _internal[i])
                {
                    clone._internal[i].Add(c.Key, c.Value);
                }
            }
            return(clone);
        }