Beispiel #1
0
        protected override PatternNodePPA ComputeMaximalDepth(PatternNodePPA node,
                                                              IPermutationsCollection avoidedPermutations,
                                                              int depthComputed, ResultPPA result)
        {
            List <PatternNodePPA> nodes = Compute(node, avoidedPermutations, depthComputed - 1, result);

            foreach (var nodeProcessed in nodes)
            {
                result.ProcessPermutations(
                    successorsComputation.Successors(nodeProcessed.Permutation,
                                                     node.ExtensionMap, avoidedPermutations));
            }


            return(node);
        }
        protected void ComputeStepProcessPermutations(PatternNodePPA node, ResultPPA result)
        {
            PatternNodePPA        parent = node.Parent;
            List <PatternNodePPA> nodes;

            List <PatternNodePPA>[] descendants;
            parent.TryGetDescendants(out descendants);

            nodes = descendants[node.PositionPrecedingLetters(node.Permutation.Length - 1)];

            foreach (var nodeProcessed in nodes)
            {
                result.ProcessPermutations(permSuccessorsComputation.Successors(nodeProcessed.Permutation,
                                                                                nodeProcessed.ExtensionMap,
                                                                                avoidedPermutations));
            }
        }