コード例 #1
0
 private void AssertOuters(
     int[][] outersPerStream,
     OuterInnerDirectionalGraph graph)
 {
     for (var i = 0; i < outersPerStream.Length; i++)
     {
         EPAssertionUtil.AssertEqualsAnyOrder(outersPerStream[i], graph.GetOuter(i));
     }
 }
コード例 #2
0
        private static bool RecursiveHasInnerJoin(
            int toStream,
            OuterInnerDirectionalGraph outerInnerGraph,
            InnerJoinGraph innerJoinGraph,
            ISet<int> completedStreams)
        {
            // Check if the to-stream is in any of the inner joins
            var hasInnerJoin = innerJoinGraph.HasInnerJoin(toStream);

            if (hasInnerJoin) {
                return true;
            }

            var innerToToStream = outerInnerGraph.GetInner(toStream);
            if (innerToToStream != null) {
                foreach (var nextStream in innerToToStream) {
                    if (completedStreams.Contains(nextStream)) {
                        continue;
                    }

                    var notConsider = new HashSet<int>(completedStreams);
                    notConsider.Add(toStream);
                    var result = RecursiveHasInnerJoin(nextStream, outerInnerGraph, innerJoinGraph, notConsider);

                    if (result) {
                        return true;
                    }
                }
            }

            var outerToToStream = outerInnerGraph.GetOuter(toStream);
            if (outerToToStream != null) {
                foreach (var nextStream in outerToToStream) {
                    if (completedStreams.Contains(nextStream)) {
                        continue;
                    }

                    var notConsider = new HashSet<int>(completedStreams);
                    notConsider.Add(toStream);
                    var result = RecursiveHasInnerJoin(nextStream, outerInnerGraph, innerJoinGraph, notConsider);

                    if (result) {
                        return true;
                    }
                }
            }

            return false;
        }