示例#1
0
        private static Pattern CreatePerformScalarOperationPattern()
        {
            PatternNode node = new PatternNode(
                new Type[] { typeof(Addition), typeof(Multiplication) });

            node.AddChild(new PatternNode(typeof(Scalar)));
            node.AddChild(new PatternNode(typeof(Scalar)));
            return(new Pattern(node));
        }
示例#2
0
        private static Pattern CreateDeleteZeroAdditionPattern()
        {
            PatternNode node = new PatternNode(typeof(Addition));

            node.AddChild(new PatternNode(typeof(Scalar), null, 0));
            return(new Pattern(node));
        }