Пример #1
0
        private NoInEdgeInOutVertexVertex GetAll_Filter(NoInEdgeInOutVertexVertex currentSet, IEdge expressionEdge)
        {
            NoInEdgeInOutVertexVertex newSet = new NoInEdgeInOutVertexVertex(MinusZero.Instance.TempStore);

            IEdge nextTerminal = GetNextExpressionEdgeTerminal(expressionEdge);

            foreach (IEdge ee in currentSet)
            {
                if (nextTerminal == null)
                {
                    if (EdgeExpressionEdgeCompare(ee, expressionEdge))
                    {
                        //newSet.AddEdge(ee.Meta, ee.To);
                        newSet.AddEdgeForNoInEdgeInOutVertexVertex(ee);
                    }
                }
                else
                if (EdgeExpressionEdgeCompare(ee, expressionEdge) &&
                    GetAll_Filter_nextTerminal(ee.To, nextTerminal))
                {
                    //newSet.AddEdge(ee.Meta, ee.To);
                    newSet.AddEdgeForNoInEdgeInOutVertexVertex(ee);
                }
            }

            return(newSet);
        }
Пример #2
0
 private void GetlAll_AllLevelsDeeper(NoInEdgeInOutVertexVertex currentSet, IVertex iterateSet)
 {
     foreach (IEdge e in iterateSet)
     {
         if (GraphUtil.DoIEnumerableIEdgeContainsVertex(currentSet, e.To) == false)
         {
             //currentSet.AddEdge(e.Meta, e.To);
             currentSet.AddEdgeForNoInEdgeInOutVertexVertex(e);
             GetlAll_AllLevelsDeeper(currentSet, e.To);
         }
     }
 }
Пример #3
0
        private NoInEdgeInOutVertexVertex GetAll_OneLevelDeeper(NoInEdgeInOutVertexVertex currentSet)
        {
            NoInEdgeInOutVertexVertex newSet = new NoInEdgeInOutVertexVertex(MinusZero.Instance.TempStore);

            foreach (IEdge e in currentSet)
            {
                foreach (IEdge ee in e.To)
                {
                    //newSet.AddEdge(ee.Meta, ee.To);
                    newSet.AddEdgeForNoInEdgeInOutVertexVertex(ee);
                }
            }

            return(newSet);
        }
Пример #4
0
        protected IVertex GetAll_Internal(IVertex baseVertex, IVertex expression, bool isSingleResult)
        {
            // FOR DEBUG
            //Console.WriteLine(m0.Instance.DefaultGraphCreationCodeGenerator.GraphCreationCodeGenerateAsString(expression));

            NoInEdgeInOutVertexVertex currentSet = new NoInEdgeInOutVertexVertex(MinusZero.Instance.TempStore);

            foreach (IEdge e in baseVertex)
            {
                //currentSet.AddEdge(e.Meta, e.To);
                currentSet.AddEdgeForNoInEdgeInOutVertexVertex(e);
            }


            if (expression.OutEdges.Count() == 0)
            {
                return(currentSet);
            }

            return(RemoveDuplicates(GetAll_Iterate(currentSet, expression, isSingleResult)));
        }
Пример #5
0
        public static IVertex RemoveDuplicates(IEnumerable <IEdge> inVertex)
        {
            NoInEdgeInOutVertexVertex outVertex = new NoInEdgeInOutVertexVertex(MinusZero.Instance.TempStore);

            foreach (IEdge e in inVertex)
            {
                bool donocopy = false;

                foreach (IEdge ee in outVertex)
                {
                    if (ee.To == e.To && ee.Meta == e.Meta)
                    {
                        donocopy = true;
                    }
                }

                if (!donocopy)
                {
                    outVertex.AddEdgeForNoInEdgeInOutVertexVertex(e);
                }
            }

            return(outVertex);
        }