Пример #1
0
 /// <summary>
 /// Sets results storage for the matcher instance.
 /// Everything else is done in the base constructor.
 /// </summary>
 /// <param name="pat"> A pattern to find.</param>
 /// <param name="gr"> A graph to search. </param>
 /// <param name="res"> An object to store found results. </param>
 public DFSPatternMatcher(IDFSPattern pat, Graph gr, MatchFixedResults.MatcherFixedResultsInternal res) : base(pat, gr)
 {
     if (res == null)
     {
         throw new ArgumentException($"{this.GetType()}, passed null to a constructor.");
     }
     this.results = res;
 }
 /// <summary>
 /// Sets results storage for the matcher instance.
 /// Everything else is done in the base constructor.
 /// </summary>
 /// <param name="pat"> The pattern to find.</param>
 /// <param name="gr"> The graph to search. </param>
 /// <param name="mID"> ID of the matcher. Will be used as a resultProcessor argument.</param>
 public DFSPatternMatcherStreamed(IDFSPattern pat, Graph gr, int mID) : base(pat, gr)
 {
     if (mID < 0)
     {
         throw new ArgumentException($"{this.GetType()}, matcherId cannot be < 0");
     }
     else
     {
         this.matcherID = mID;
     }
 }
        /// <summary>
        /// Starting vertices are implicitly set to entire graph.
        /// </summary>
        /// <param name="pat"> A pattern to find.</param>
        /// <param name="gr"> A graph to search. </param>
        protected DFSPatternMatcherBase(IDFSPattern pat, Graph gr)
        {
            if (gr == null || pat == null)
            {
                throw new ArgumentException($"{this.GetType()}, passed null to a constructor.");
            }

            this.graph           = gr;
            this.matchedElements = new Element[pat.AllNodeCount];
            this.pattern         = (DFSPattern)pat;

            // Implicit range of vertices to iterate over the entire graph.
            this.startVerticesIndex    = 0;
            this.startVerticesEndIndex = gr.vertices.Count;
        }