예제 #1
0
        protected override void DoRun()
        {
            bool?nullable = new bool?();
            Dictionary <ushort, Factor> dictionary = new Dictionary <ushort, Factor>();

            Graph.EdgeEnumerator edgeEnumerator = this._source.GetEdgeEnumerator();
            for (uint vertex = 0; vertex < this._source.VertexCount; ++vertex)
            {
                edgeEnumerator.MoveTo(vertex);
                edgeEnumerator.Reset();
                while (edgeEnumerator.MoveNext())
                {
                    float  distance;
                    ushort profile;
                    EdgeDataSerializer.Deserialize(edgeEnumerator.Data0, out distance, out profile);
                    Factor factor = Factor.NoFactor;
                    if (!dictionary.TryGetValue(profile, out factor))
                    {
                        factor = this._getFactor(profile);
                        dictionary[profile] = factor;
                    }
                    if ((double)factor.Value != 0.0)
                    {
                        bool?direction = new bool?();
                        if ((int)factor.Direction == 1)
                        {
                            direction = new bool?(true);
                            if (edgeEnumerator.DataInverted)
                            {
                                direction = new bool?(false);
                            }
                        }
                        else if ((int)factor.Direction == 2)
                        {
                            direction = new bool?(false);
                            if (edgeEnumerator.DataInverted)
                            {
                                direction = new bool?(true);
                            }
                        }
                        uint data = ContractedEdgeDataSerializer.Serialize(distance * factor.Value, direction);
                        int  num  = (int)this._target.AddEdge(edgeEnumerator.From, edgeEnumerator.To, data, 4294967294U);
                    }
                }
            }
            this.HasSucceeded = true;
        }
예제 #2
0
 /// <summary>
 /// Resets this enumerator.
 /// </summary>
 public void Reset()
 {
     _enumerator.Reset();
 }